0) {
+ if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
+ while(i >= 0) {
+ if(p < k) {
+ d = (this[i]&((1<>(p+=this.DB-k);
}
- } else {
- throw new Error('Invalid connection string.')
- }
- break
-
- case '{':
- if (parsing === 'value') {
- if (buffer.trim().length === 0) {
- // value is wrapped in qotes
- original[param].escape = ['{', '}']
- quotes = '{}'
- buffer = ''
- } else {
- buffer += char
+ else {
+ d = (this[i]>>(p-=k))&km;
+ if(p <= 0) { p += this.DB; --i; }
}
- } else {
- throw new Error('Invalid connection string.')
+ if(d > 0) m = true;
+ if(m) r += int2char(d);
}
- break
+ }
+ return m?r:"0";
+ }
- case '}':
- if (parsing === 'value') {
- if (quotes === '{}') {
- // end of value
- parsed[param] = buffer
- param = null
- parsing = null
- buffer = ''
- quotes = null
- } else {
- buffer += char
- }
- } else {
- throw new Error('Invalid connection string.')
- }
- break
+ // (public) -this
+ function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
- case ';':
- if (parsing === 'value') {
- if (quotes) {
- buffer += char
- } else {
- // end of value
- parsed[param] = buffer
- param = null
- parsing = 'name'
- buffer = ''
- }
- } else {
- buffer = ''
- parsing = 'name'
- }
- break
+ // (public) |this|
+ function bnAbs() { return (this.s<0)?this.negate():this; }
- default:
- buffer += char
+ // (public) return + if this > a, - if this < a, 0 if equal
+ function bnCompareTo(a) {
+ var r = this.s-a.s;
+ if(r != 0) return r;
+ var i = this.t;
+ r = i-a.t;
+ if(r != 0) return (this.s<0)?-r:r;
+ while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
+ return 0;
}
- cursor++
- }
+ // returns bit length of the integer x
+ function nbits(x) {
+ var r = 1, t;
+ if((t=x>>>16) != 0) { x = t; r += 16; }
+ if((t=x>>8) != 0) { x = t; r += 8; }
+ if((t=x>>4) != 0) { x = t; r += 4; }
+ if((t=x>>2) != 0) { x = t; r += 2; }
+ if((t=x>>1) != 0) { x = t; r += 1; }
+ return r;
+ }
- if (parsing === 'value') {
- // end of value
- parsed[param] = buffer
- }
+ // (public) return the number of bits in "this"
+ function bnBitLength() {
+ if(this.t <= 0) return 0;
+ return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
+ }
- return parsed
-}
+ // (protected) r = this << n*DB
+ function bnpDLShiftTo(n,r) {
+ var i;
+ for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
+ for(i = n-1; i >= 0; --i) r[i] = 0;
+ r.t = this.t+n;
+ r.s = this.s;
+ }
-const resolveConnectionString = function (string, driver) {
- const parsed = /^(mssql|tedious|msnodesql|tds):\/\//i.test(string) ? parseConnectionURI(string) : parseConnectionString(string)
- const stream = (parsed.stream || '').toLowerCase()
- const encrypt = (parsed.encrypt || '').toLowerCase()
+ // (protected) r = this >> n*DB
+ function bnpDRShiftTo(n,r) {
+ for(var i = n; i < this.t; ++i) r[i-n] = this[i];
+ r.t = Math.max(this.t-n,0);
+ r.s = this.s;
+ }
- if (driver === 'msnodesqlv8') {
- parsed.driver = 'SQL Server Native Client 11.0'
+ // (protected) r = this << n
+ function bnpLShiftTo(n,r) {
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<= 0; --i) {
+ r[i+ds+1] = (this[i]>>cbs)|c;
+ c = (this[i]&bm)<= 0; --i) r[i] = 0;
+ r[ds] = c;
+ r.t = this.t+ds+1;
+ r.s = this.s;
+ r.clamp();
+ }
- if (parsed.__original__) {
- parsed.__original__.driver = { name: 'Driver', escape: ['{', '}'] }
+ // (protected) r = this >> n
+ function bnpRShiftTo(n,r) {
+ r.s = this.s;
+ var ds = Math.floor(n/this.DB);
+ if(ds >= this.t) { r.t = 0; return; }
+ var bs = n%this.DB;
+ var cbs = this.DB-bs;
+ var bm = (1<>bs;
+ for(var i = ds+1; i < this.t; ++i) {
+ r[i-ds-1] |= (this[i]&bm)<>bs;
+ }
+ if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;
+ }
+ if(a.t < this.t) {
+ c -= a.s;
+ while(i < this.t) {
+ c += this[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c -= a[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c -= a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c < -1) r[i++] = this.DV+c;
+ else if(c > 0) r[i++] = c;
+ r.t = i;
+ r.clamp();
+ }
- let user = parsed.uid || parsed.uid || parsed['user id']
- let server = parsed.server || parsed.address || parsed.addr || parsed['data source'] || parsed['network address']
+ // (protected) r = this * a, r != this,a (HAC 14.12)
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyTo(a,r) {
+ var x = this.abs(), y = a.abs();
+ var i = x.t;
+ r.t = i+y.t;
+ while(--i >= 0) r[i] = 0;
+ for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
+ r.s = 0;
+ r.clamp();
+ if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
+ }
- const config = {
- password: oror(parsed.pwd, parsed.password),
- database: oror(parsed.database, parsed['initial catalog']),
- connectionTimeout: oror(parsed.connectionTimeout, parsed.timeout, parsed['connect timeout'], parsed['connection timeout']),
- requestTimeout: oror(parsed.requestTimeout, parsed['request timeout']),
- stream: stream === 'true' || stream === 'yes' || stream === '1',
- options: {
- readOnlyIntent: parsed.applicationintent && parsed.applicationintent.toLowerCase() === 'readonly',
- encrypt: encrypt === 'true' || encrypt === 'yes' || encrypt === '1'
+ // (protected) r = this^2, r != this (HAC 14.16)
+ function bnpSquareTo(r) {
+ var x = this.abs();
+ var i = r.t = 2*x.t;
+ while(--i >= 0) r[i] = 0;
+ for(i = 0; i < x.t-1; ++i) {
+ var c = x.am(i,x[i],r,2*i,0,1);
+ if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
+ r[i+x.t] -= x.DV;
+ r[i+x.t+1] = 1;
+ }
+ }
+ if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
+ r.s = 0;
+ r.clamp();
}
- }
- if (parsed.useUTC != null) {
- const utc = parsed.useUTC.toLowerCase()
- config.options.useUTC = utc === 'true' || utc === 'yes' || utc === '1'
- }
- if (config.connectionTimeout != null) {
- config.connectionTimeout = parseInt(config.connectionTimeout, 10) * 1000
- }
- if (config.requestTimeout != null) {
- config.requestTimeout = parseInt(config.requestTimeout, 10)
- }
+ // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
+ // r != q, this != m. q or r may be null.
+ function bnpDivRemTo(m,q,r) {
+ var pm = m.abs();
+ if(pm.t <= 0) return;
+ var pt = this.abs();
+ if(pt.t < pm.t) {
+ if(q != null) q.fromInt(0);
+ if(r != null) this.copyTo(r);
+ return;
+ }
+ if(r == null) r = nbi();
+ var y = nbi(), ts = this.s, ms = m.s;
+ var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
+ if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
+ else { pm.copyTo(y); pt.copyTo(r); }
+ var ys = y.t;
+ var y0 = y[ys-1];
+ if(y0 == 0) return;
+ var yt = y0*(1<1)?y[ys-2]>>this.F2:0);
+ var d1 = this.FV/yt, d2 = (1<= 0) {
+ r[r.t++] = 1;
+ r.subTo(t,r);
+ }
+ BigInteger.ONE.dlShiftTo(ys,t);
+ t.subTo(y,y); // "negative" y so we can replace sub with am later
+ while(y.t < ys) y[y.t++] = 0;
+ while(--j >= 0) {
+ // Estimate quotient digit
+ var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
+ if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
+ y.dlShiftTo(j,t);
+ r.subTo(t,r);
+ while(r[i] < --qd) r.subTo(t,r);
+ }
+ }
+ if(q != null) {
+ r.drShiftTo(ys,q);
+ if(ts != ms) BigInteger.ZERO.subTo(q,q);
+ }
+ r.t = ys;
+ r.clamp();
+ if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
+ if(ts < 0) BigInteger.ZERO.subTo(r,r);
+ }
- if (parsed.multisubnetfailover != null) {
- config.options.multiSubnetFailover = parsed.multisubnetfailover.toLowerCase() === 'true'
- }
+ // (public) this mod a
+ function bnMod(a) {
+ var r = nbi();
+ this.abs().divRemTo(a,null,r);
+ if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
+ return r;
+ }
- if (/^(.*)\\(.*)$/.exec(user)) {
- config.domain = RegExp.$1
- user = RegExp.$2
- }
+ // Modular reduction using "classic" algorithm
+ function Classic(m) { this.m = m; }
+ function cConvert(x) {
+ if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
+ else return x;
+ }
+ function cRevert(x) { return x; }
+ function cReduce(x) { x.divRemTo(this.m,null,x); }
+ function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+ function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
- if (server) {
- server = server.trim()
+ Classic.prototype.convert = cConvert;
+ Classic.prototype.revert = cRevert;
+ Classic.prototype.reduce = cReduce;
+ Classic.prototype.mulTo = cMulTo;
+ Classic.prototype.sqrTo = cSqrTo;
- if (/^np:/i.test(server)) {
- throw new Error('Connection via Named Pipes is not supported.')
+ // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
+ // justification:
+ // xy == 1 (mod m)
+ // xy = 1+km
+ // xy(2-xy) = (1+km)(1-km)
+ // x[y(2-xy)] = 1-k^2m^2
+ // x[y(2-xy)] == 1 (mod m^2)
+ // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
+ // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
+ // JS multiply "overflows" differently from C/C++, so care is needed here.
+ function bnpInvDigit() {
+ if(this.t < 1) return 0;
+ var x = this[0];
+ if((x&1) == 0) return 0;
+ var y = x&3; // y == 1/x mod 2^2
+ y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
+ y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
+ y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
+ // last step - calculate inverse mod DV directly;
+ // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
+ y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
+ // we really want the negative inverse, and -DV < y < DV
+ return (y>0)?this.DV-y:-y;
}
- if (/^tcp:/i.test(server)) {
- server = server.substr(4)
+ // Montgomery reduction
+ function Montgomery(m) {
+ this.m = m;
+ this.mp = m.invDigit();
+ this.mpl = this.mp&0x7fff;
+ this.mph = this.mp>>15;
+ this.um = (1<<(m.DB-15))-1;
+ this.mt2 = 2*m.t;
}
- if (/^(.*)\\(.*)$/.exec(server)) {
- server = RegExp.$1
- config.options.instanceName = RegExp.$2
+ // xR mod m
+ function montConvert(x) {
+ var r = nbi();
+ x.abs().dlShiftTo(this.m.t,r);
+ r.divRemTo(this.m,null,r);
+ if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
+ return r;
}
- if (/^(.*),(.*)$/.exec(server)) {
- server = RegExp.$1.trim()
- config.port = parseInt(RegExp.$2.trim(), 10)
+ // x/R mod m
+ function montRevert(x) {
+ var r = nbi();
+ x.copyTo(r);
+ this.reduce(r);
+ return r;
}
- if (server === '.' || server === '(.)' || server.toLowerCase() === '(localdb)' || server.toLowerCase() === '(local)') {
- server = 'localhost'
+ // x = x/R mod m (HAC 14.32)
+ function montReduce(x) {
+ while(x.t <= this.mt2) // pad x so am has enough room later
+ x[x.t++] = 0;
+ for(var i = 0; i < this.m.t; ++i) {
+ // faster way of calculating u0 = x[i]*mp mod DV
+ var j = x[i]&0x7fff;
+ var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
+ // use am to combine the multiply-shift-add into one call
+ j = i+this.m.t;
+ x[j] += this.m.am(0,u0,x,i,0,this.m.t);
+ // propagate carry
+ while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
+ }
+ x.clamp();
+ x.drShiftTo(this.m.t,x);
+ if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
}
- }
- config.user = user
- config.server = server
- return config
-}
+ // r = "x^2/R mod m"; x != r
+ function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
-module.exports = {
- parse: parseConnectionString,
- resolve: resolveConnectionString
-}
+ // r = "xy/R mod m"; x,y != r
+ function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
+ Montgomery.prototype.convert = montConvert;
+ Montgomery.prototype.revert = montRevert;
+ Montgomery.prototype.reduce = montReduce;
+ Montgomery.prototype.mulTo = montMulTo;
+ Montgomery.prototype.sqrTo = montSqrTo;
-/***/ }),
+ // (protected) true iff this is even
+ function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
-/***/ 62388:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
+ function bnpExp(e,z) {
+ if(e > 0xffffffff || e < 1) return BigInteger.ONE;
+ var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
+ g.copyTo(r);
+ while(--i >= 0) {
+ z.sqrTo(r,r2);
+ if((e&(1< 0) z.mulTo(r2,g,r);
+ else { var t = r; r = r2; r2 = t; }
+ }
+ return z.revert(r);
+ }
-"use strict";
+ // (public) this^e % m, 0 <= e < 2^32
+ function bnModPowInt(e,m) {
+ var z;
+ if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
+ return this.exp(e,z);
+ }
-const objectHasProperty = __nccwpck_require__(14178).objectHasProperty
-const inspect = Symbol.for('nodejs.util.inspect.custom')
+ // protected
+ BigInteger.prototype.copyTo = bnpCopyTo;
+ BigInteger.prototype.fromInt = bnpFromInt;
+ BigInteger.prototype.fromString = bnpFromString;
+ BigInteger.prototype.clamp = bnpClamp;
+ BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
+ BigInteger.prototype.drShiftTo = bnpDRShiftTo;
+ BigInteger.prototype.lShiftTo = bnpLShiftTo;
+ BigInteger.prototype.rShiftTo = bnpRShiftTo;
+ BigInteger.prototype.subTo = bnpSubTo;
+ BigInteger.prototype.multiplyTo = bnpMultiplyTo;
+ BigInteger.prototype.squareTo = bnpSquareTo;
+ BigInteger.prototype.divRemTo = bnpDivRemTo;
+ BigInteger.prototype.invDigit = bnpInvDigit;
+ BigInteger.prototype.isEven = bnpIsEven;
+ BigInteger.prototype.exp = bnpExp;
-const TYPES = {
- VarChar (length) {
- return { type: TYPES.VarChar, length }
- },
- NVarChar (length) {
- return { type: TYPES.NVarChar, length }
- },
- Text () {
- return { type: TYPES.Text }
- },
- Int () {
- return { type: TYPES.Int }
- },
- BigInt () {
- return { type: TYPES.BigInt }
- },
- TinyInt () {
- return { type: TYPES.TinyInt }
- },
- SmallInt () {
- return { type: TYPES.SmallInt }
- },
- Bit () {
- return { type: TYPES.Bit }
- },
- Float () {
- return { type: TYPES.Float }
- },
- Numeric (precision, scale) {
- return { type: TYPES.Numeric, precision, scale }
- },
- Decimal (precision, scale) {
- return { type: TYPES.Decimal, precision, scale }
- },
- Real () {
- return { type: TYPES.Real }
- },
- Date () {
- return { type: TYPES.Date }
- },
- DateTime () {
- return { type: TYPES.DateTime }
- },
- DateTime2 (scale) {
- return { type: TYPES.DateTime2, scale }
- },
- DateTimeOffset (scale) {
- return { type: TYPES.DateTimeOffset, scale }
- },
- SmallDateTime () {
- return { type: TYPES.SmallDateTime }
- },
- Time (scale) {
- return { type: TYPES.Time, scale }
- },
- UniqueIdentifier () {
- return { type: TYPES.UniqueIdentifier }
- },
- SmallMoney () {
- return { type: TYPES.SmallMoney }
- },
- Money () {
- return { type: TYPES.Money }
- },
- Binary (length) {
- return { type: TYPES.Binary, length }
- },
- VarBinary (length) {
- return { type: TYPES.VarBinary, length }
- },
- Image () {
- return { type: TYPES.Image }
- },
- Xml () {
- return { type: TYPES.Xml }
- },
- Char (length) {
- return { type: TYPES.Char, length }
- },
- NChar (length) {
- return { type: TYPES.NChar, length }
- },
- NText () {
- return { type: TYPES.NText }
- },
- TVP (tvpType) {
- return { type: TYPES.TVP, tvpType }
- },
- UDT () {
- return { type: TYPES.UDT }
- },
- Geography () {
- return { type: TYPES.Geography }
- },
- Geometry () {
- return { type: TYPES.Geometry }
- },
- Variant () {
- return { type: TYPES.Variant }
- }
-}
+ // public
+ BigInteger.prototype.toString = bnToString;
+ BigInteger.prototype.negate = bnNegate;
+ BigInteger.prototype.abs = bnAbs;
+ BigInteger.prototype.compareTo = bnCompareTo;
+ BigInteger.prototype.bitLength = bnBitLength;
+ BigInteger.prototype.mod = bnMod;
+ BigInteger.prototype.modPowInt = bnModPowInt;
-module.exports.TYPES = TYPES
-module.exports.DECLARATIONS = {}
+ // "constants"
+ BigInteger.ZERO = nbv(0);
+ BigInteger.ONE = nbv(1);
-const zero = function (value, length) {
- if (length == null) length = 2
+ // Copyright (c) 2005-2009 Tom Wu
+ // All Rights Reserved.
+ // See "LICENSE" for details.
- value = String(value)
- if (value.length < length) {
- for (let i = 1; i <= length - value.length; i++) {
- value = `0${value}`
- }
- }
- return value
-}
+ // Extended JavaScript BN functions, required for RSA private ops.
-for (const key in TYPES) {
- if (objectHasProperty(TYPES, key)) {
- const value = TYPES[key]
- value.declaration = key.toLowerCase()
- module.exports.DECLARATIONS[value.declaration] = value;
+ // Version 1.1: new BigInteger("0", 10) returns "proper" zero
+ // Version 1.2: square() API, isProbablePrime fix
- ((key, value) => {
- value[inspect] = () => `[sql.${key}]`
- })(key, value)
- }
-}
+ // (public)
+ function bnClone() { var r = nbi(); this.copyTo(r); return r; }
-module.exports.declare = (type, options) => {
- switch (type) {
- case TYPES.VarChar: case TYPES.VarBinary:
- return `${type.declaration} (${options.length > 8000 ? 'MAX' : (options.length == null ? 'MAX' : options.length)})`
- case TYPES.NVarChar:
- return `${type.declaration} (${options.length > 4000 ? 'MAX' : (options.length == null ? 'MAX' : options.length)})`
- case TYPES.Char: case TYPES.NChar: case TYPES.Binary:
- return `${type.declaration} (${options.length == null ? 1 : options.length})`
- case TYPES.Decimal: case TYPES.Numeric:
- return `${type.declaration} (${options.precision == null ? 18 : options.precision}, ${options.scale == null ? 0 : options.scale})`
- case TYPES.Time: case TYPES.DateTime2: case TYPES.DateTimeOffset:
- return `${type.declaration} (${options.scale == null ? 7 : options.scale})`
- case TYPES.TVP:
- return `${options.tvpType} readonly`
- default:
- return type.declaration
- }
-}
+ // (public) return value as integer
+ function bnIntValue() {
+ if(this.s < 0) {
+ if(this.t == 1) return this[0]-this.DV;
+ else if(this.t == 0) return -1;
+ }
+ else if(this.t == 1) return this[0];
+ else if(this.t == 0) return 0;
+ // assumes 16 < DB < 32
+ return ((this[1]&((1<<(32-this.DB))-1))< {
- if (value == null) {
- return null
- }
+ // (public) return value as byte
+ function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
- switch (typeof value) {
- case 'string':
- return `N'${value.replace(/'/g, '\'\'')}'`
+ // (public) return value as short (assumes DB>=16)
+ function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
- case 'number':
- return value
+ // (protected) return x s.t. r^x < DV
+ function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
- case 'boolean':
- return value ? 1 : 0
+ // (public) 0 if this == 0, 1 if this > 0
+ function bnSigNum() {
+ if(this.s < 0) return -1;
+ else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
+ else return 1;
+ }
- case 'object':
- if (value instanceof Date) {
- let ns = value.getUTCMilliseconds() / 1000
- if (value.nanosecondDelta != null) {
- ns += value.nanosecondDelta
+ // (protected) convert to radix string
+ function bnpToRadix(b) {
+ if(b == null) b = 10;
+ if(this.signum() == 0 || b < 2 || b > 36) return "0";
+ var cs = this.chunkSize(b);
+ var a = Math.pow(b,cs);
+ var d = nbv(a), y = nbi(), z = nbi(), r = "";
+ this.divRemTo(d,y,z);
+ while(y.signum() > 0) {
+ r = (a+z.intValue()).toString(b).substr(1) + r;
+ y.divRemTo(d,y,z);
+ }
+ return z.intValue().toString(b) + r;
+ }
+
+ // (protected) convert from radix string
+ function bnpFromRadix(s,b) {
+ this.fromInt(0);
+ if(b == null) b = 10;
+ var cs = this.chunkSize(b);
+ var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
+ for(var i = 0; i < s.length; ++i) {
+ var x = intAt(s,i);
+ if(x < 0) {
+ if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
+ continue;
}
- const scale = options.scale == null ? 7 : options.scale
+ w = b*w+x;
+ if(++j >= cs) {
+ this.dMultiply(d);
+ this.dAddOffset(w,0);
+ j = 0;
+ w = 0;
+ }
+ }
+ if(j > 0) {
+ this.dMultiply(Math.pow(b,j));
+ this.dAddOffset(w,0);
+ }
+ if(mi) BigInteger.ZERO.subTo(this,this);
+ }
- if (scale > 0) {
- ns = String(ns).substr(1, scale + 1)
- } else {
- ns = ''
+ // (protected) alternate constructor
+ function bnpFromNumber(a,b,c) {
+ if("number" == typeof b) {
+ // new BigInteger(int,int,RNG)
+ if(a < 2) this.fromInt(1);
+ else {
+ this.fromNumber(a,c);
+ if(!this.testBit(a-1)) // force MSB set
+ this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
+ if(this.isEven()) this.dAddOffset(1,0); // force odd
+ while(!this.isProbablePrime(b)) {
+ this.dAddOffset(2,0);
+ if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
+ }
}
+ }
+ else {
+ // new BigInteger(int,RNG)
+ var x = new Array(), t = a&7;
+ x.length = (a>>3)+1;
+ b.nextBytes(x);
+ if(t > 0) x[0] &= ((1< 0) {
+ if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
+ r[k++] = d|(this.s<<(this.DB-p));
+ while(i >= 0) {
+ if(p < 8) {
+ d = (this[i]&((1<>(p+=this.DB-8);
+ }
+ else {
+ d = (this[i]>>(p-=8))&0xff;
+ if(p <= 0) { p += this.DB; --i; }
+ }
+ if((d&0x80) != 0) d |= -256;
+ if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
+ if(k > 0 || d != this.s) r[k++] = d;
+ }
}
+ return r;
+ }
- return null
+ function bnEquals(a) { return(this.compareTo(a)==0); }
+ function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
+ function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
- default:
- return null
- }
-}
+ // (protected) r = this op a (bitwise)
+ function bnpBitwiseTo(a,op,r) {
+ var i, f, m = Math.min(a.t,this.t);
+ for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
+ if(a.t < this.t) {
+ f = a.s&this.DM;
+ for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
+ r.t = this.t;
+ }
+ else {
+ f = this.s&this.DM;
+ for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
+ r.t = a.t;
+ }
+ r.s = op(this.s,a.s);
+ r.clamp();
+ }
+ // (public) this & a
+ function op_and(x,y) { return x&y; }
+ function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
-/***/ }),
+ // (public) this | a
+ function op_or(x,y) { return x|y; }
+ function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
-/***/ 86485:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // (public) this ^ a
+ function op_xor(x,y) { return x^y; }
+ function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
-"use strict";
+ // (public) this & ~a
+ function op_andnot(x,y) { return x&~y; }
+ function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
+ // (public) ~this
+ function bnNot() {
+ var r = nbi();
+ for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
+ r.t = this.t;
+ r.s = ~this.s;
+ return r;
+ }
-const MSSQLError = __nccwpck_require__(24022)
+ // (public) this << n
+ function bnShiftLeft(n) {
+ var r = nbi();
+ if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
+ return r;
+ }
-/**
- * Class ConnectionError.
- */
+ // (public) this >> n
+ function bnShiftRight(n) {
+ var r = nbi();
+ if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
+ return r;
+ }
-class ConnectionError extends MSSQLError {
- /**
- * Creates a new ConnectionError.
- *
- * @param {String} message Error message.
- * @param {String} [code] Error code.
- */
+ // return index of lowest 1-bit in x, x < 2^31
+ function lbit(x) {
+ if(x == 0) return -1;
+ var r = 0;
+ if((x&0xffff) == 0) { x >>= 16; r += 16; }
+ if((x&0xff) == 0) { x >>= 8; r += 8; }
+ if((x&0xf) == 0) { x >>= 4; r += 4; }
+ if((x&3) == 0) { x >>= 2; r += 2; }
+ if((x&1) == 0) ++r;
+ return r;
+ }
- constructor (message, code) {
- super(message, code)
+ // (public) returns index of lowest 1-bit (or -1 if none)
+ function bnGetLowestSetBit() {
+ for(var i = 0; i < this.t; ++i)
+ if(this[i] != 0) return i*this.DB+lbit(this[i]);
+ if(this.s < 0) return this.t*this.DB;
+ return -1;
+ }
- this.name = 'ConnectionError'
- }
-}
+ // return number of 1 bits in x
+ function cbit(x) {
+ var r = 0;
+ while(x != 0) { x &= x-1; ++r; }
+ return r;
+ }
-module.exports = ConnectionError
+ // (public) return number of set bits
+ function bnBitCount() {
+ var r = 0, x = this.s&this.DM;
+ for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
+ return r;
+ }
+ // (public) true iff nth bit is set
+ function bnTestBit(n) {
+ var j = Math.floor(n/this.DB);
+ if(j >= this.t) return(this.s!=0);
+ return((this[j]&(1<<(n%this.DB)))!=0);
+ }
-/***/ }),
+ // (protected) this op (1< {
+ // (public) this | (1<>= this.DB;
+ }
+ if(a.t < this.t) {
+ c += a.s;
+ while(i < this.t) {
+ c += this[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += this.s;
+ }
+ else {
+ c += this.s;
+ while(i < a.t) {
+ c += a[i];
+ r[i++] = c&this.DM;
+ c >>= this.DB;
+ }
+ c += a.s;
+ }
+ r.s = (c<0)?-1:0;
+ if(c > 0) r[i++] = c;
+ else if(c < -1) r[i++] = this.DV+c;
+ r.t = i;
+ r.clamp();
+ }
-module.exports = {
- ConnectionError,
- MSSQLError,
- PreparedStatementError,
- RequestError,
- TransactionError
-}
+ // (public) this + a
+ function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
+ // (public) this - a
+ function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
-/***/ }),
+ // (public) this * a
+ function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
-/***/ 24022:
-/***/ ((module) => {
+ // (public) this^2
+ function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
-"use strict";
+ // (public) this / a
+ function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
+ // (public) this % a
+ function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
-class MSSQLError extends Error {
- /**
- * Creates a new ConnectionError.
- *
- * @param {String} message Error message.
- * @param {String} [code] Error code.
- */
+ // (public) [this/a,this%a]
+ function bnDivideAndRemainder(a) {
+ var q = nbi(), r = nbi();
+ this.divRemTo(a,q,r);
+ return new Array(q,r);
+ }
- constructor (message, code) {
- if (message instanceof Error) {
- super(message.message)
- this.code = message.code || code
+ // (protected) this *= n, this >= 0, 1 < n < DV
+ function bnpDMultiply(n) {
+ this[this.t] = this.am(0,n-1,this,0,0,this.t);
+ ++this.t;
+ this.clamp();
+ }
- Error.captureStackTrace(this, this.constructor)
- Object.defineProperty(this, 'originalError', { enumerable: true, value: message })
- } else {
- super(message)
- this.code = code
+ // (protected) this += n << w words, this >= 0
+ function bnpDAddOffset(n,w) {
+ if(n == 0) return;
+ while(this.t <= w) this[this.t++] = 0;
+ this[w] += n;
+ while(this[w] >= this.DV) {
+ this[w] -= this.DV;
+ if(++w >= this.t) this[this.t++] = 0;
+ ++this[w];
+ }
}
- this.name = 'MSSQLError'
- }
-}
-
-module.exports = MSSQLError
-
-
-/***/ }),
-
-/***/ 47641:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
+ // A "null" reducer
+ function NullExp() {}
+ function nNop(x) { return x; }
+ function nMulTo(x,y,r) { x.multiplyTo(y,r); }
+ function nSqrTo(x,r) { x.squareTo(r); }
+ NullExp.prototype.convert = nNop;
+ NullExp.prototype.revert = nNop;
+ NullExp.prototype.mulTo = nMulTo;
+ NullExp.prototype.sqrTo = nSqrTo;
-const MSSQLError = __nccwpck_require__(24022)
+ // (public) this^e
+ function bnPow(e) { return this.exp(e,new NullExp()); }
-/**
- * Class PreparedStatementError.
- */
+ // (protected) r = lower n words of "this * a", a.t <= n
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyLowerTo(a,n,r) {
+ var i = Math.min(this.t+a.t,n);
+ r.s = 0; // assumes a,this >= 0
+ r.t = i;
+ while(i > 0) r[--i] = 0;
+ var j;
+ for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
+ for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
+ r.clamp();
+ }
-class PreparedStatementError extends MSSQLError {
- /**
- * Creates a new PreparedStatementError.
- *
- * @param {String} message Error message.
- * @param {String} [code] Error code.
- */
+ // (protected) r = "this * a" without lower n words, n > 0
+ // "this" should be the larger one if appropriate.
+ function bnpMultiplyUpperTo(a,n,r) {
+ --n;
+ var i = r.t = this.t+a.t-n;
+ r.s = 0; // assumes a,this >= 0
+ while(--i >= 0) r[i] = 0;
+ for(i = Math.max(n-this.t,0); i < a.t; ++i)
+ r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
+ r.clamp();
+ r.drShiftTo(1,r);
+ }
- constructor (message, code) {
- super(message, code)
+ // Barrett modular reduction
+ function Barrett(m) {
+ // setup Barrett
+ this.r2 = nbi();
+ this.q3 = nbi();
+ BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
+ this.mu = this.r2.divide(m);
+ this.m = m;
+ }
- this.name = 'PreparedStatementError'
- }
-}
+ function barrettConvert(x) {
+ if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
+ else if(x.compareTo(this.m) < 0) return x;
+ else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
+ }
-module.exports = PreparedStatementError
+ function barrettRevert(x) { return x; }
+ // x = x mod m (HAC 14.42)
+ function barrettReduce(x) {
+ x.drShiftTo(this.m.t-1,this.r2);
+ if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
+ this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
+ this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
+ while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
+ x.subTo(this.r2,x);
+ while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
+ }
-/***/ }),
+ // r = x^2 mod m; x != r
+ function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
-/***/ 31296:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ // r = x*y mod m; x,y != r
+ function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
-"use strict";
+ Barrett.prototype.convert = barrettConvert;
+ Barrett.prototype.revert = barrettRevert;
+ Barrett.prototype.reduce = barrettReduce;
+ Barrett.prototype.mulTo = barrettMulTo;
+ Barrett.prototype.sqrTo = barrettSqrTo;
+ // (public) this^e % m (HAC 14.85)
+ function bnModPow(e,m) {
+ var i = e.bitLength(), k, r = nbv(1), z;
+ if(i <= 0) return r;
+ else if(i < 18) k = 1;
+ else if(i < 48) k = 3;
+ else if(i < 144) k = 4;
+ else if(i < 768) k = 5;
+ else k = 6;
+ if(i < 8)
+ z = new Classic(m);
+ else if(m.isEven())
+ z = new Barrett(m);
+ else
+ z = new Montgomery(m);
-const MSSQLError = __nccwpck_require__(24022)
+ // precomputation
+ var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {
+ var g2 = nbi();
+ z.sqrTo(g[1],g2);
+ while(n <= km) {
+ g[n] = nbi();
+ z.mulTo(g2,g[n-2],g[n]);
+ n += 2;
+ }
+ }
-/**
- * Class RequestError.
- *
- * @property {String} number Error number.
- * @property {Number} lineNumber Line number.
- * @property {String} state Error state.
- * @property {String} class Error class.
- * @property {String} serverName Server name.
- * @property {String} procName Procedure name.
- */
+ var j = e.t-1, w, is1 = true, r2 = nbi(), t;
+ i = nbits(e[j])-1;
+ while(j >= 0) {
+ if(i >= k1) w = (e[j]>>(i-k1))&km;
+ else {
+ w = (e[j]&((1<<(i+1))-1))<<(k1-i);
+ if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
+ }
-class RequestError extends MSSQLError {
- /**
- * Creates a new RequestError.
- *
- * @param {String} message Error message.
- * @param {String} [code] Error code.
- */
+ n = k;
+ while((w&1) == 0) { w >>= 1; --n; }
+ if((i -= n) < 0) { i += this.DB; --j; }
+ if(is1) { // ret == 1, don't bother squaring or multiplying it
+ g[w].copyTo(r);
+ is1 = false;
+ }
+ else {
+ while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
+ if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
+ z.mulTo(r2,g[w],r);
+ }
- constructor (message, code) {
- super(message, code)
- if (message instanceof Error) {
- if (message.info) {
- this.number = message.info.number || message.code // err.code is returned by msnodesql driver
- this.lineNumber = message.info.lineNumber
- this.state = message.info.state || message.sqlstate // err.sqlstate is returned by msnodesql driver
- this.class = message.info.class
- this.serverName = message.info.serverName
- this.procName = message.info.procName
- } else {
- this.number = message.code // err.code is returned by msnodesql driver
- this.state = message.sqlstate // err.sqlstate is returned by msnodesql driver
+ while(j >= 0 && (e[j]&(1< 0) {
+ x.rShiftTo(g,x);
+ y.rShiftTo(g,y);
+ }
+ while(x.signum() > 0) {
+ if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
+ if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
+ if(x.compareTo(y) >= 0) {
+ x.subTo(y,x);
+ x.rShiftTo(1,x);
+ }
+ else {
+ y.subTo(x,y);
+ y.rShiftTo(1,y);
+ }
+ }
+ if(g > 0) y.lShiftTo(g,y);
+ return y;
}
- }
-}
-
-module.exports = RequestError
-
-
-/***/ }),
-
-/***/ 70274:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const MSSQLError = __nccwpck_require__(24022)
-
-/**
- * Class TransactionError.
- */
-
-class TransactionError extends MSSQLError {
- /**
- * Creates a new TransactionError.
- *
- * @param {String} message Error message.
- * @param {String} [code] Error code.
- */
-
- constructor (message, code) {
- super(message, code)
-
- this.name = 'TransactionError'
- }
-}
-
-module.exports = TransactionError
-
-
-/***/ }),
-
-/***/ 89105:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const shared = __nccwpck_require__(67636)
-
-let globalConnection = null
-const globalConnectionHandlers = {}
-
-/**
- * Open global connection pool.
- *
- * @param {Object|String} config Connection configuration object or connection string.
- * @param {basicCallback} [callback] A callback which is called after connection has established, or an error has occurred. If omited, method returns Promise.
- * @return {Promise.}
- */
-function connect (config, callback) {
- if (!globalConnection) {
- globalConnection = new shared.driver.ConnectionPool(config)
+ // (protected) this % n, n < 2^26
+ function bnpModInt(n) {
+ if(n <= 0) return 0;
+ var d = this.DV%n, r = (this.s<0)?n-1:0;
+ if(this.t > 0)
+ if(d == 0) r = this[0]%n;
+ else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
+ return r;
+ }
- for (const event in globalConnectionHandlers) {
- for (let i = 0, l = globalConnectionHandlers[event].length; i < l; i++) {
- globalConnection.on(event, globalConnectionHandlers[event][i])
+ // (public) 1/this % m (HAC 14.61)
+ function bnModInverse(m) {
+ var ac = m.isEven();
+ if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
+ var u = m.clone(), v = this.clone();
+ var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
+ while(u.signum() != 0) {
+ while(u.isEven()) {
+ u.rShiftTo(1,u);
+ if(ac) {
+ if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
+ a.rShiftTo(1,a);
+ }
+ else if(!b.isEven()) b.subTo(m,b);
+ b.rShiftTo(1,b);
+ }
+ while(v.isEven()) {
+ v.rShiftTo(1,v);
+ if(ac) {
+ if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
+ c.rShiftTo(1,c);
+ }
+ else if(!d.isEven()) d.subTo(m,d);
+ d.rShiftTo(1,d);
+ }
+ if(u.compareTo(v) >= 0) {
+ u.subTo(v,u);
+ if(ac) a.subTo(c,a);
+ b.subTo(d,b);
+ }
+ else {
+ v.subTo(u,v);
+ if(ac) c.subTo(a,c);
+ d.subTo(b,d);
+ }
}
+ if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
+ if(d.compareTo(m) >= 0) return d.subtract(m);
+ if(d.signum() < 0) d.addTo(m,d); else return d;
+ if(d.signum() < 0) return d.add(m); else return d;
}
- const ogClose = globalConnection.close
+ var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
+ var lplim = (1<<26)/lowprimes[lowprimes.length-1];
- const globalClose = function (callback) {
- // remove event handlers from the global connection
- for (const event in globalConnectionHandlers) {
- for (let i = 0, l = globalConnectionHandlers[event].length; i < l; i++) {
- this.removeListener(event, globalConnectionHandlers[event][i])
- }
+ // (public) test primality with certainty >= 1-.5^t
+ function bnIsProbablePrime(t) {
+ var i, x = this.abs();
+ if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
+ for(i = 0; i < lowprimes.length; ++i)
+ if(x[0] == lowprimes[i]) return true;
+ return false;
+ }
+ if(x.isEven()) return false;
+ i = 1;
+ while(i < lowprimes.length) {
+ var m = lowprimes[i], j = i+1;
+ while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
+ m = x.modInt(m);
+ while(i < j) if(m%lowprimes[i++] == 0) return false;
}
+ return x.millerRabin(t);
+ }
- // attach error handler to prevent process crash in case of error
- this.on('error', err => {
- if (globalConnectionHandlers.error) {
- for (let i = 0, l = globalConnectionHandlers.error.length; i < l; i++) {
- globalConnectionHandlers.error[i].call(this, err)
+ // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
+ function bnpMillerRabin(t) {
+ var n1 = this.subtract(BigInteger.ONE);
+ var k = n1.getLowestSetBit();
+ if(k <= 0) return false;
+ var r = n1.shiftRight(k);
+ t = (t+1)>>1;
+ if(t > lowprimes.length) t = lowprimes.length;
+ var a = nbi();
+ for(var i = 0; i < t; ++i) {
+ //Pick bases at random, instead of starting at 2
+ a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
+ var y = a.modPow(r,this);
+ if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
+ var j = 1;
+ while(j++ < k && y.compareTo(n1) != 0) {
+ y = y.modPowInt(2,this);
+ if(y.compareTo(BigInteger.ONE) == 0) return false;
}
+ if(y.compareTo(n1) != 0) return false;
}
- })
-
- globalConnection = null
- return ogClose.call(this, callback)
- }
-
- globalConnection.close = globalClose.bind(globalConnection)
- }
- if (typeof callback === 'function') {
- return globalConnection.connect((err, connection) => {
- if (err) {
- globalConnection = null
}
- callback(err, connection)
- })
- }
- return globalConnection.connect().catch((err) => {
- globalConnection = null
- return shared.Promise.reject(err)
- })
-}
-
-/**
- * Close all active connections in the global pool.
- *
- * @param {basicCallback} [callback] A callback which is called after connection has closed, or an error has occurred. If omited, method returns Promise.
- * @return {ConnectionPool|Promise}
- */
+ return true;
+ }
-function close (callback) {
- if (globalConnection) {
- const gc = globalConnection
- globalConnection = null
- return gc.close(callback)
- }
+ // protected
+ BigInteger.prototype.chunkSize = bnpChunkSize;
+ BigInteger.prototype.toRadix = bnpToRadix;
+ BigInteger.prototype.fromRadix = bnpFromRadix;
+ BigInteger.prototype.fromNumber = bnpFromNumber;
+ BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
+ BigInteger.prototype.changeBit = bnpChangeBit;
+ BigInteger.prototype.addTo = bnpAddTo;
+ BigInteger.prototype.dMultiply = bnpDMultiply;
+ BigInteger.prototype.dAddOffset = bnpDAddOffset;
+ BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
+ BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
+ BigInteger.prototype.modInt = bnpModInt;
+ BigInteger.prototype.millerRabin = bnpMillerRabin;
- if (typeof callback === 'function') {
- setImmediate(callback)
- return null
- }
+ // public
+ BigInteger.prototype.clone = bnClone;
+ BigInteger.prototype.intValue = bnIntValue;
+ BigInteger.prototype.byteValue = bnByteValue;
+ BigInteger.prototype.shortValue = bnShortValue;
+ BigInteger.prototype.signum = bnSigNum;
+ BigInteger.prototype.toByteArray = bnToByteArray;
+ BigInteger.prototype.equals = bnEquals;
+ BigInteger.prototype.min = bnMin;
+ BigInteger.prototype.max = bnMax;
+ BigInteger.prototype.and = bnAnd;
+ BigInteger.prototype.or = bnOr;
+ BigInteger.prototype.xor = bnXor;
+ BigInteger.prototype.andNot = bnAndNot;
+ BigInteger.prototype.not = bnNot;
+ BigInteger.prototype.shiftLeft = bnShiftLeft;
+ BigInteger.prototype.shiftRight = bnShiftRight;
+ BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
+ BigInteger.prototype.bitCount = bnBitCount;
+ BigInteger.prototype.testBit = bnTestBit;
+ BigInteger.prototype.setBit = bnSetBit;
+ BigInteger.prototype.clearBit = bnClearBit;
+ BigInteger.prototype.flipBit = bnFlipBit;
+ BigInteger.prototype.add = bnAdd;
+ BigInteger.prototype.subtract = bnSubtract;
+ BigInteger.prototype.multiply = bnMultiply;
+ BigInteger.prototype.divide = bnDivide;
+ BigInteger.prototype.remainder = bnRemainder;
+ BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
+ BigInteger.prototype.modPow = bnModPow;
+ BigInteger.prototype.modInverse = bnModInverse;
+ BigInteger.prototype.pow = bnPow;
+ BigInteger.prototype.gcd = bnGCD;
+ BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
- return new shared.Promise((resolve) => {
- resolve(globalConnection)
- })
-}
+ // JSBN-specific extension
+ BigInteger.prototype.square = bnSquare;
-/**
- * Attach event handler to global connection pool.
- *
- * @param {String} event Event name.
- * @param {Function} handler Event handler.
- * @return {ConnectionPool}
- */
+ // Expose the Barrett function
+ BigInteger.prototype.Barrett = Barrett
-function on (event, handler) {
- if (!globalConnectionHandlers[event]) globalConnectionHandlers[event] = []
- globalConnectionHandlers[event].push(handler)
+ // BigInteger interfaces not implemented in jsbn:
- if (globalConnection) globalConnection.on(event, handler)
- return globalConnection
-}
+ // BigInteger(int signum, byte[] magnitude)
+ // double doubleValue()
+ // float floatValue()
+ // int hashCode()
+ // long longValue()
+ // static BigInteger valueOf(long val)
-/**
- * Detach event handler from global connection.
- *
- * @param {String} event Event name.
- * @param {Function} handler Event handler.
- * @return {ConnectionPool}
- */
+ // Random number generator - requires a PRNG backend, e.g. prng4.js
-function removeListener (event, handler) {
- if (!globalConnectionHandlers[event]) return globalConnection
- const index = globalConnectionHandlers[event].indexOf(handler)
- if (index === -1) return globalConnection
- globalConnectionHandlers[event].splice(index, 1)
- if (globalConnectionHandlers[event].length === 0) globalConnectionHandlers[event] = undefined
+ // For best results, put code like
+ //
+ // in your main HTML document.
- if (globalConnection) globalConnection.removeListener(event, handler)
- return globalConnection
-}
+ var rng_state;
+ var rng_pool;
+ var rng_pptr;
-/**
- * Creates a new query using global connection from a tagged template string.
- *
- * @variation 1
- * @param {Array|String} strings Array of string literals or sql command.
- * @param {...*} keys Values.
- * @return {Request}
- */
+ // Mix in a 32-bit integer into the pool
+ function rng_seed_int(x) {
+ rng_pool[rng_pptr++] ^= x & 255;
+ rng_pool[rng_pptr++] ^= (x >> 8) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 16) & 255;
+ rng_pool[rng_pptr++] ^= (x >> 24) & 255;
+ if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
+ }
-/**
- * Execute the SQL command.
- *
- * @variation 2
- * @param {String} command T-SQL command to be executed.
- * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
- * @return {Request|Promise}
- */
+ // Mix in the current time (w/milliseconds) into the pool
+ function rng_seed_time() {
+ rng_seed_int(new Date().getTime());
+ }
-function query () {
- if (typeof arguments[0] === 'string') { return new shared.driver.Request().query(arguments[0], arguments[1]) }
+ // Initialize the pool with junk if needed.
+ if(rng_pool == null) {
+ rng_pool = new Array();
+ rng_pptr = 0;
+ var t;
+ if(typeof window !== "undefined" && window.crypto) {
+ if (window.crypto.getRandomValues) {
+ // Use webcrypto if available
+ var ua = new Uint8Array(32);
+ window.crypto.getRandomValues(ua);
+ for(t = 0; t < 32; ++t)
+ rng_pool[rng_pptr++] = ua[t];
+ }
+ else if(navigator.appName == "Netscape" && navigator.appVersion < "5") {
+ // Extract entropy (256 bits) from NS4 RNG if available
+ var z = window.crypto.random(32);
+ for(t = 0; t < z.length; ++t)
+ rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
+ }
+ }
+ while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
+ t = Math.floor(65536 * Math.random());
+ rng_pool[rng_pptr++] = t >>> 8;
+ rng_pool[rng_pptr++] = t & 255;
+ }
+ rng_pptr = 0;
+ rng_seed_time();
+ //rng_seed_int(window.screenX);
+ //rng_seed_int(window.screenY);
+ }
- const values = Array.prototype.slice.call(arguments)
- const strings = values.shift()
+ function rng_get_byte() {
+ if(rng_state == null) {
+ rng_seed_time();
+ rng_state = prng_newstate();
+ rng_state.init(rng_pool);
+ for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
+ rng_pool[rng_pptr] = 0;
+ rng_pptr = 0;
+ //rng_pool = null;
+ }
+ // TODO: allow reseeding after first request
+ return rng_state.next();
+ }
- return new shared.driver.Request()._template(strings, values, 'query')
-}
+ function rng_get_bytes(ba) {
+ var i;
+ for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
+ }
-/**
- * Creates a new batch using global connection from a tagged template string.
- *
- * @variation 1
- * @param {Array} strings Array of string literals.
- * @param {...*} keys Values.
- * @return {Request}
- */
+ function SecureRandom() {}
-/**
- * Execute the SQL command.
- *
- * @variation 2
- * @param {String} command T-SQL command to be executed.
- * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
- * @return {Request|Promise}
- */
+ SecureRandom.prototype.nextBytes = rng_get_bytes;
-function batch () {
- if (typeof arguments[0] === 'string') { return new shared.driver.Request().batch(arguments[0], arguments[1]) }
+ // prng4.js - uses Arcfour as a PRNG
- const values = Array.prototype.slice.call(arguments)
- const strings = values.shift()
+ function Arcfour() {
+ this.i = 0;
+ this.j = 0;
+ this.S = new Array();
+ }
- return new shared.driver.Request()._template(strings, values, 'batch')
-}
+ // Initialize arcfour context from key, an array of ints, each from [0..255]
+ function ARC4init(key) {
+ var i, j, t;
+ for(i = 0; i < 256; ++i)
+ this.S[i] = i;
+ j = 0;
+ for(i = 0; i < 256; ++i) {
+ j = (j + this.S[i] + key[i % key.length]) & 255;
+ t = this.S[i];
+ this.S[i] = this.S[j];
+ this.S[j] = t;
+ }
+ this.i = 0;
+ this.j = 0;
+ }
-module.exports = {
- batch,
- close,
- connect,
- off: removeListener,
- on,
- query,
- removeListener
-}
+ function ARC4next() {
+ var t;
+ this.i = (this.i + 1) & 255;
+ this.j = (this.j + this.S[this.i]) & 255;
+ t = this.S[this.i];
+ this.S[this.i] = this.S[this.j];
+ this.S[this.j] = t;
+ return this.S[(t + this.S[this.i]) & 255];
+ }
-Object.defineProperty(module.exports, "pool", ({
- get: () => {
- return globalConnection
- },
- set: () => {}
-}))
+ Arcfour.prototype.init = ARC4init;
+ Arcfour.prototype.next = ARC4next;
+ // Plug in your RNG constructor here
+ function prng_newstate() {
+ return new Arcfour();
+ }
-/***/ }),
+ // Pool size must be a multiple of 4 and greater than 32.
+ // An array of bytes the size of the pool will be passed to init()
+ var rng_psize = 256;
-/***/ 62202:
-/***/ ((module) => {
+ BigInteger.SecureRandom = SecureRandom;
+ BigInteger.BigInteger = BigInteger;
+ if (true) {
+ exports = module.exports = BigInteger;
+ } else {}
-"use strict";
-
-
-module.exports = {
- READ_UNCOMMITTED: 0x01,
- READ_COMMITTED: 0x02,
- REPEATABLE_READ: 0x03,
- SERIALIZABLE: 0x04,
- SNAPSHOT: 0x05
-}
+}).call(this);
/***/ }),
-/***/ 67636:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+/***/ 52533:
+/***/ ((module) => {
"use strict";
-const TYPES = __nccwpck_require__(62388).TYPES
-const Table = __nccwpck_require__(67417)
-
-let PromiseLibrary = Promise
-const driver = {}
-const map = []
-
-/**
- * Register you own type map.
- *
- * @path module.exports.map
- * @param {*} jstype JS data type.
- * @param {*} sqltype SQL data type.
- */
-
-map.register = function (jstype, sqltype) {
- for (let index = 0; index < this.length; index++) {
- const item = this[index]
- if (item.js === jstype) {
- this.splice(index, 1)
- break
- }
+var traverse = module.exports = function (schema, opts, cb) {
+ // Legacy support for v0.3.1 and earlier.
+ if (typeof opts == 'function') {
+ cb = opts;
+ opts = {};
}
- this.push({
- js: jstype,
- sql: sqltype
- })
+ cb = opts.cb || cb;
+ var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
+ var post = cb.post || function() {};
- return null
-}
+ _traverse(opts, pre, post, schema, '', schema);
+};
-map.register(String, TYPES.NVarChar)
-map.register(Number, TYPES.Int)
-map.register(Boolean, TYPES.Bit)
-map.register(Date, TYPES.DateTime)
-map.register(Buffer, TYPES.VarBinary)
-map.register(Table, TYPES.TVP)
-/**
- * @ignore
- */
+traverse.keywords = {
+ additionalItems: true,
+ items: true,
+ contains: true,
+ additionalProperties: true,
+ propertyNames: true,
+ not: true
+};
-const getTypeByValue = function (value) {
- if ((value === null) || (value === undefined)) { return TYPES.NVarChar }
+traverse.arrayKeywords = {
+ items: true,
+ allOf: true,
+ anyOf: true,
+ oneOf: true
+};
- switch (typeof value) {
- case 'string':
- for (var item of Array.from(map)) {
- if (item.js === String) {
- return item.sql
- }
- }
+traverse.propsKeywords = {
+ definitions: true,
+ properties: true,
+ patternProperties: true,
+ dependencies: true
+};
- return TYPES.NVarChar
+traverse.skipKeywords = {
+ default: true,
+ enum: true,
+ const: true,
+ required: true,
+ maximum: true,
+ minimum: true,
+ exclusiveMaximum: true,
+ exclusiveMinimum: true,
+ multipleOf: true,
+ maxLength: true,
+ minLength: true,
+ pattern: true,
+ format: true,
+ maxItems: true,
+ minItems: true,
+ uniqueItems: true,
+ maxProperties: true,
+ minProperties: true
+};
- case 'number':
- if (value % 1 === 0) {
- return TYPES.Int
- } else {
- return TYPES.Float
- }
- case 'boolean':
- for (item of Array.from(map)) {
- if (item.js === Boolean) {
- return item.sql
+function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
+ if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
+ pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
+ for (var key in schema) {
+ var sch = schema[key];
+ if (Array.isArray(sch)) {
+ if (key in traverse.arrayKeywords) {
+ for (var i=0; i {
- return PromiseLibrary
- },
- set: (value) => {
- PromiseLibrary = value
- }
-}))
-
-
-/***/ }),
-
-/***/ 67417:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const TYPES = __nccwpck_require__(62388).TYPES
-const declareType = __nccwpck_require__(62388).declare
-const objectHasProperty = __nccwpck_require__(14178).objectHasProperty
-
-const MAX = 65535 // (1 << 16) - 1
-const JSON_COLUMN_ID = 'JSON_F52E2B61-18A1-11d1-B105-00805F49916B'
-
-function Table (name) {
- if (name) {
- const parsed = Table.parseName(name)
- this.name = parsed.name
- this.schema = parsed.schema
- this.database = parsed.database
- this.path = (this.database ? `[${this.database}].` : '') + (this.schema ? `[${this.schema}].` : '') + `[${this.name}]`
- this.temporary = this.name.charAt(0) === '#'
- }
-
- this.columns = []
- this.rows = []
-
- Object.defineProperty(this.columns, 'add', {
- value (name, column, options) {
- if (column == null) {
- throw new Error('Column data type is not defined.')
- }
- if (column instanceof Function) {
- column = column()
- }
-
- options = options || {}
- column.name = name;
-
- ['nullable', 'primary', 'identity', 'readOnly', 'length'].forEach(prop => {
- if (objectHasProperty(options, prop)) {
- column[prop] = options[prop]
- }
- })
-
- return this.push(column)
- }
- })
-
- Object.defineProperty(this.rows, 'add', {
- value () {
- return this.push(Array.prototype.slice.call(arguments))
- }
- }
- )
-}
-
-/*
-@private
-*/
-
-Table.prototype._makeBulk = function _makeBulk () {
- for (let i = 0; i < this.columns.length; i++) {
- const col = this.columns[i]
- switch (col.type) {
- case TYPES.Date:
- case TYPES.DateTime:
- case TYPES.DateTime2:
- for (let j = 0; j < this.rows.length; j++) {
- const dateValue = this.rows[j][i]
- if (typeof dateValue === 'string' || typeof dateValue === 'number') {
- const date = new Date(dateValue)
- if (isNaN(date.getDate())) {
- throw new TypeError('Invalid date value passed to bulk rows')
- }
- this.rows[j][i] = date
- }
- }
- break
-
- case TYPES.Xml:
- col.type = TYPES.NVarChar(MAX).type
- break
-
- case TYPES.UDT:
- case TYPES.Geography:
- case TYPES.Geometry:
- col.type = TYPES.VarBinary(MAX).type
- break
-
- default:
- break
}
+ post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
}
-
- return this
}
-Table.prototype.declare = function declare () {
- const pkey = this.columns.filter(col => col.primary === true).map(col => col.name)
- const cols = this.columns.map(col => {
- const def = [`[${col.name}] ${declareType(col.type, col)}`]
-
- if (col.nullable === true) {
- def.push('null')
- } else if (col.nullable === false) {
- def.push('not null')
- }
-
- if (col.primary === true && pkey.length === 1) {
- def.push('primary key')
- }
-
- return def.join(' ')
- })
- const constraint = pkey.length > 1 ? `, constraint PK_${this.temporary ? this.name.substr(1) : this.name} primary key (${pkey.join(', ')})` : ''
- return `create table ${this.path} (${cols.join(', ')}${constraint})`
+function escapeJsonPtr(str) {
+ return str.replace(/~/g, '~0').replace(/\//g, '~1');
}
-Table.fromRecordset = function fromRecordset (recordset, name) {
- const t = new this(name)
-
- for (const colName in recordset.columns) {
- if (objectHasProperty(recordset.columns, colName)) {
- const col = recordset.columns[colName]
-
- t.columns.add(colName, {
- type: col.type,
- length: col.length,
- scale: col.scale,
- precision: col.precision
- }, {
- nullable: col.nullable,
- identity: col.identity,
- readOnly: col.readOnly
- })
- }
- }
-
- if (t.columns.length === 1 && t.columns[0].name === JSON_COLUMN_ID) {
- for (let i = 0; i < recordset.length; i++) {
- t.rows.add(JSON.stringify(recordset[i]))
- }
- } else {
- for (let i = 0; i < recordset.length; i++) {
- t.rows.add.apply(t.rows, t.columns.map(col => recordset[i][col.name]))
- }
- }
- return t
-}
+/***/ }),
-Table.parseName = function parseName (name) {
- const length = name.length
- let cursor = -1
- let buffer = ''
- let escaped = false
- const path = []
+/***/ 21328:
+/***/ (function(module) {
- while (++cursor < length) {
- const char = name.charAt(cursor)
- if (char === '[') {
- if (escaped) {
- buffer += char
- } else {
- escaped = true
- }
- } else if (char === ']') {
- if (escaped) {
- escaped = false
- } else {
- throw new Error('Invalid table name.')
- }
- } else if (char === '.') {
- if (escaped) {
- buffer += char
- } else {
- path.push(buffer)
- buffer = ''
- }
- } else {
- buffer += char
- }
- }
+/**
+ * JSONSchema Validator - Validates JavaScript objects using JSON Schemas
+ * (http://www.json.com/json-schema-proposal/)
+ *
+ * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
+ * Licensed under the MIT (MIT-LICENSE.txt) license.
+To use the validator call the validate function with an instance object and an optional schema object.
+If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
+that schema will be used to validate and the schema parameter is not necessary (if both exist,
+both validations will occur).
+The validate method will return an array of validation errors. If there are no errors, then an
+empty list will be returned. A validation error will have two properties:
+"property" which indicates which property had the error
+"message" which indicates what the error was
+ */
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define([], function () {
+ return factory();
+ });
+ } else if ( true && module.exports) {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like environments that support module.exports,
+ // like Node.
+ module.exports = factory();
+ } else {
+ // Browser globals
+ root.jsonSchema = factory();
+ }
+}(this, function () {// setup primitive classes to be JSON Schema types
+var exports = validate
+exports.Integer = {type:"integer"};
+var primitiveConstructors = {
+ String: String,
+ Boolean: Boolean,
+ Number: Number,
+ Object: Object,
+ Array: Array,
+ Date: Date
+}
+exports.validate = validate;
+function validate(/*Any*/instance,/*Object*/schema) {
+ // Summary:
+ // To use the validator call JSONSchema.validate with an instance object and an optional schema object.
+ // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
+ // that schema will be used to validate and the schema parameter is not necessary (if both exist,
+ // both validations will occur).
+ // The validate method will return an object with two properties:
+ // valid: A boolean indicating if the instance is valid by the schema
+ // errors: An array of validation errors. If there are no errors, then an
+ // empty list will be returned. A validation error will have two properties:
+ // property: which indicates which property had the error
+ // message: which indicates what the error was
+ //
+ return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false});
+ };
+exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) {
+ // Summary:
+ // The checkPropertyChange method will check to see if an value can legally be in property with the given schema
+ // This is slightly different than the validate method in that it will fail if the schema is readonly and it will
+ // not check for self-validation, it is assumed that the passed in value is already internally valid.
+ // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for
+ // information.
+ //
+ return validate(value, schema, {changing: property || "property"});
+ };
+var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
+
+ if (!options) options = {};
+ var _changing = options.changing;
+
+ function getType(schema){
+ return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
+ }
+ var errors = [];
+ // validate a value against a property definition
+ function checkProp(value, schema, path,i){
+
+ var l;
+ path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
+ function addError(message){
+ errors.push({property:path,message:message});
+ }
+
+ if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){
+ if(typeof schema == 'function'){
+ if(!(value instanceof schema)){
+ addError("is not an instance of the class/constructor " + schema.name);
+ }
+ }else if(schema){
+ addError("Invalid schema/property definition " + schema);
+ }
+ return null;
+ }
+ if(_changing && schema.readonly){
+ addError("is a readonly field, it can not be changed");
+ }
+ if(schema['extends']){ // if it extends another schema, it must pass that schema as well
+ checkProp(value,schema['extends'],path,i);
+ }
+ // validate a value against a type definition
+ function checkType(type,value){
+ if(type){
+ if(typeof type == 'string' && type != 'any' &&
+ (type == 'null' ? value !== null : typeof value != type) &&
+ !(value instanceof Array && type == 'array') &&
+ !(value instanceof Date && type == 'date') &&
+ !(type == 'integer' && value%1===0)){
+ return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
+ }
+ if(type instanceof Array){
+ var unionErrors=[];
+ for(var j = 0; j < type.length; j++){ // a union type
+ if(!(unionErrors=checkType(type[j],value)).length){
+ break;
+ }
+ }
+ if(unionErrors.length){
+ return unionErrors;
+ }
+ }else if(typeof type == 'object'){
+ var priorErrors = errors;
+ errors = [];
+ checkProp(value,type,path);
+ var theseErrors = errors;
+ errors = priorErrors;
+ return theseErrors;
+ }
+ }
+ return [];
+ }
+ if(value === undefined){
+ if(schema.required){
+ addError("is missing and it is required");
+ }
+ }else{
+ errors = errors.concat(checkType(getType(schema),value));
+ if(schema.disallow && !checkType(schema.disallow,value).length){
+ addError(" disallowed value was matched");
+ }
+ if(value !== null){
+ if(value instanceof Array){
+ if(schema.items){
+ var itemsIsArray = schema.items instanceof Array;
+ var propDef = schema.items;
+ for (i = 0, l = value.length; i < l; i += 1) {
+ if (itemsIsArray)
+ propDef = schema.items[i];
+ if (options.coerce)
+ value[i] = options.coerce(value[i], propDef);
+ errors.concat(checkProp(value[i],propDef,path,i));
+ }
+ }
+ if(schema.minItems && value.length < schema.minItems){
+ addError("There must be a minimum of " + schema.minItems + " in the array");
+ }
+ if(schema.maxItems && value.length > schema.maxItems){
+ addError("There must be a maximum of " + schema.maxItems + " in the array");
+ }
+ }else if(schema.properties || schema.additionalProperties){
+ errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));
+ }
+ if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){
+ addError("does not match the regex pattern " + schema.pattern);
+ }
+ if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){
+ addError("may only be " + schema.maxLength + " characters long");
+ }
+ if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){
+ addError("must be at least " + schema.minLength + " characters long");
+ }
+ if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&
+ schema.minimum > value){
+ addError("must have a minimum value of " + schema.minimum);
+ }
+ if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&
+ schema.maximum < value){
+ addError("must have a maximum value of " + schema.maximum);
+ }
+ if(schema['enum']){
+ var enumer = schema['enum'];
+ l = enumer.length;
+ var found;
+ for(var j = 0; j < l; j++){
+ if(enumer[j]===value){
+ found=1;
+ break;
+ }
+ }
+ if(!found){
+ addError("does not have a value in the enumeration " + enumer.join(", "));
+ }
+ }
+ if(typeof schema.maxDecimal == 'number' &&
+ (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){
+ addError("may only have " + schema.maxDecimal + " digits of decimal places");
+ }
+ }
+ }
+ return null;
+ }
+ // validate an object against a schema
+ function checkObj(instance,objTypeDef,path,additionalProp){
+
+ if(typeof objTypeDef =='object'){
+ if(typeof instance != 'object' || instance instanceof Array){
+ errors.push({property:path,message:"an object is required"});
+ }
+
+ for(var i in objTypeDef){
+ if(objTypeDef.hasOwnProperty(i)){
+ var value = instance[i];
+ // skip _not_ specified properties
+ if (value === undefined && options.existingOnly) continue;
+ var propDef = objTypeDef[i];
+ // set default
+ if(value === undefined && propDef["default"]){
+ value = instance[i] = propDef["default"];
+ }
+ if(options.coerce && i in instance){
+ value = instance[i] = options.coerce(value, propDef);
+ }
+ checkProp(value,propDef,path,i);
+ }
+ }
+ }
+ for(i in instance){
+ if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){
+ if (options.filter) {
+ delete instance[i];
+ continue;
+ } else {
+ errors.push({property:path,message:(typeof value) + "The property " + i +
+ " is not defined in the schema and the schema does not allow additional properties"});
+ }
+ }
+ var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;
+ if(requires && !(requires in instance)){
+ errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"});
+ }
+ value = instance[i];
+ if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){
+ if(options.coerce){
+ value = instance[i] = options.coerce(value, additionalProp);
+ }
+ checkProp(value,additionalProp,path,i);
+ }
+ if(!_changing && value && value.$schema){
+ errors = errors.concat(checkProp(value,value.$schema,path,i));
+ }
+ }
+ return errors;
+ }
+ if(schema){
+ checkProp(instance,schema,'',_changing || '');
+ }
+ if(!_changing && instance && instance.$schema){
+ checkProp(instance,instance.$schema,'','');
+ }
+ return {valid:!errors.length,errors:errors};
+};
+exports.mustBeValid = function(result){
+ // summary:
+ // This checks to ensure that the result is valid and will throw an appropriate error message if it is not
+ // result: the result returned from checkPropertyChange or validate
+ if(!result.valid){
+ throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n"));
+ }
+}
+
+return exports;
+}));
- if (buffer) {
- path.push(buffer)
- }
- switch (path.length) {
- case 1:
- return {
- name: path[0],
- schema: null,
- database: null
- }
+/***/ }),
- case 2:
- return {
- name: path[1],
- schema: path[0],
- database: null
- }
+/***/ 57073:
+/***/ ((module, exports) => {
- case 3:
- return {
- name: path[2],
- schema: path[1],
- database: path[0]
- }
+exports = module.exports = stringify
+exports.getSerialize = serializer
- default:
- throw new Error('Invalid table name.')
- }
+function stringify(obj, replacer, spaces, cycleReplacer) {
+ return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
}
-module.exports = Table
-
-
-/***/ }),
-
-/***/ 89:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function serializer(replacer, cycleReplacer) {
+ var stack = [], keys = []
-"use strict";
+ if (cycleReplacer == null) cycleReplacer = function(key, value) {
+ if (stack[0] === value) return "[Circular ~]"
+ return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
+ }
+ return function(key, value) {
+ if (stack.length > 0) {
+ var thisPos = stack.indexOf(this)
+ ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
+ ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
+ if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
+ }
+ else stack.push(value)
-const tds = __nccwpck_require__(62459)
-const debug = __nccwpck_require__(38237)('mssql:tedi')
-const BaseConnectionPool = __nccwpck_require__(85558)
-const { IDS } = __nccwpck_require__(14178)
-const shared = __nccwpck_require__(67636)
-const ConnectionError = __nccwpck_require__(86485)
+ return replacer == null ? value : replacer.call(this, key, value)
+ }
+}
-class ConnectionPool extends BaseConnectionPool {
- _poolCreate () {
- return new shared.Promise((resolve, reject) => {
- const resolveOnce = (v) => {
- resolve(v)
- resolve = reject = () => {}
- }
- const rejectOnce = (e) => {
- reject(e)
- resolve = reject = () => {}
- }
- const cfg = {
- server: this.config.server,
- options: Object.assign({
- encrypt: typeof this.config.encrypt === 'boolean' ? this.config.encrypt : true
- }, this.config.options),
- authentication: Object.assign({
- type: this.config.domain !== undefined ? 'ntlm' : 'default',
- options: {
- userName: this.config.user,
- password: this.config.password,
- domain: this.config.domain
- }
- }, this.config.authentication)
- }
- cfg.options.database = this.config.database
- cfg.options.port = this.config.port
- cfg.options.connectTimeout = this.config.connectionTimeout || this.config.timeout || 15000
- cfg.options.requestTimeout = this.config.requestTimeout != null ? this.config.requestTimeout : 15000
- cfg.options.tdsVersion = cfg.options.tdsVersion || '7_4'
- cfg.options.rowCollectionOnDone = false
- cfg.options.rowCollectionOnRequestCompletion = false
- cfg.options.useColumnNames = false
- cfg.options.appName = cfg.options.appName || 'node-mssql'
+/***/ }),
- // tedious always connect via tcp when port is specified
- if (cfg.options.instanceName) delete cfg.options.port
+/***/ 6287:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
- if (isNaN(cfg.options.requestTimeout)) cfg.options.requestTimeout = 15000
- if (cfg.options.requestTimeout === Infinity) cfg.options.requestTimeout = 0
- if (cfg.options.requestTimeout < 0) cfg.options.requestTimeout = 0
+/*
+ * lib/jsprim.js: utilities for primitive JavaScript types
+ */
- if (this.config.debug) {
- cfg.options.debug = {
- packet: true,
- token: true,
- data: true,
- payload: true
- }
- }
- const tedious = new tds.Connection(cfg)
- IDS.add(tedious, 'Connection')
- debug('pool(%d): connection #%d created', IDS.get(this), IDS.get(tedious))
- debug('connection(%d): establishing', IDS.get(tedious))
+var mod_assert = __nccwpck_require__(66631);
+var mod_util = __nccwpck_require__(31669);
- tedious.once('connect', err => {
- if (err) {
- err = new ConnectionError(err)
- return rejectOnce(err)
- }
+var mod_extsprintf = __nccwpck_require__(87264);
+var mod_verror = __nccwpck_require__(81692);
+var mod_jsonschema = __nccwpck_require__(21328);
- debug('connection(%d): established', IDS.get(tedious))
- resolveOnce(tedious)
- })
+/*
+ * Public interface
+ */
+exports.deepCopy = deepCopy;
+exports.deepEqual = deepEqual;
+exports.isEmpty = isEmpty;
+exports.hasKey = hasKey;
+exports.forEachKey = forEachKey;
+exports.pluck = pluck;
+exports.flattenObject = flattenObject;
+exports.flattenIter = flattenIter;
+exports.validateJsonObject = validateJsonObjectJS;
+exports.validateJsonObjectJS = validateJsonObjectJS;
+exports.randElt = randElt;
+exports.extraProperties = extraProperties;
+exports.mergeObjects = mergeObjects;
- tedious.on('end', () => {
- const err = new ConnectionError('The connection ended without ever completing the connection')
- rejectOnce(err)
- })
- tedious.on('error', err => {
- if (err.code === 'ESOCKET') {
- tedious.hasError = true
- } else {
- this.emit('error', err)
- }
- rejectOnce(err)
- })
+exports.startsWith = startsWith;
+exports.endsWith = endsWith;
- if (this.config.debug) {
- tedious.on('debug', this.emit.bind(this, 'debug', tedious))
- }
- if (typeof this.config.beforeConnect === 'function') {
- this.config.beforeConnect(tedious)
- }
- })
- }
+exports.parseInteger = parseInteger;
- _poolValidate (tedious) {
- return tedious && !tedious.closed && !tedious.hasError
- }
+exports.iso8601 = iso8601;
+exports.rfc1123 = rfc1123;
+exports.parseDateTime = parseDateTime;
- _poolDestroy (tedious) {
- return new shared.Promise((resolve, reject) => {
- if (!tedious) {
- resolve()
- return
- }
- debug('connection(%d): destroying', IDS.get(tedious))
+exports.hrtimediff = hrtimeDiff;
+exports.hrtimeDiff = hrtimeDiff;
+exports.hrtimeAccum = hrtimeAccum;
+exports.hrtimeAdd = hrtimeAdd;
+exports.hrtimeNanosec = hrtimeNanosec;
+exports.hrtimeMicrosec = hrtimeMicrosec;
+exports.hrtimeMillisec = hrtimeMillisec;
- if (tedious.closed) {
- debug('connection(%d): already closed', IDS.get(tedious))
- resolve()
- } else {
- tedious.once('end', () => {
- debug('connection(%d): destroyed', IDS.get(tedious))
- resolve()
- })
- tedious.close()
- }
- })
- }
-}
+/*
+ * Deep copy an acyclic *basic* Javascript object. This only handles basic
+ * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects
+ * containing these. This does *not* handle instances of other classes.
+ */
+function deepCopy(obj)
+{
+ var ret, key;
+ var marker = '__deepCopy';
-module.exports = ConnectionPool
+ if (obj && obj[marker])
+ throw (new Error('attempted deep copy of cyclic object'));
+ if (obj && obj.constructor == Object) {
+ ret = {};
+ obj[marker] = true;
-/***/ }),
+ for (key in obj) {
+ if (key == marker)
+ continue;
-/***/ 37197:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ ret[key] = deepCopy(obj[key]);
+ }
-'use struct'
+ delete (obj[marker]);
+ return (ret);
+ }
-const base = __nccwpck_require__(26042)
-const ConnectionPool = __nccwpck_require__(89)
-const Transaction = __nccwpck_require__(41670)
-const Request = __nccwpck_require__(22906)
+ if (obj && obj.constructor == Array) {
+ ret = [];
+ obj[marker] = true;
-module.exports = Object.assign({
- ConnectionPool,
- Transaction,
- Request,
- PreparedStatement: base.PreparedStatement
-}, base.exports)
+ for (key = 0; key < obj.length; key++)
+ ret.push(deepCopy(obj[key]));
-Object.defineProperty(module.exports, "Promise", ({
- enumerable: true,
- get: () => {
- return base.Promise
- },
- set: (value) => {
- base.Promise = value
- }
-}))
+ delete (obj[marker]);
+ return (ret);
+ }
-base.driver.name = 'tedious'
-base.driver.ConnectionPool = ConnectionPool
-base.driver.Transaction = Transaction
-base.driver.Request = Request
+ /*
+ * It must be a primitive type -- just return it.
+ */
+ return (obj);
+}
+function deepEqual(obj1, obj2)
+{
+ if (typeof (obj1) != typeof (obj2))
+ return (false);
-/***/ }),
+ if (obj1 === null || obj2 === null || typeof (obj1) != 'object')
+ return (obj1 === obj2);
-/***/ 22906:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (obj1.constructor != obj2.constructor)
+ return (false);
-"use strict";
+ var k;
+ for (k in obj1) {
+ if (!obj2.hasOwnProperty(k))
+ return (false);
+ if (!deepEqual(obj1[k], obj2[k]))
+ return (false);
+ }
-const tds = __nccwpck_require__(62459)
-const debug = __nccwpck_require__(38237)('mssql:tedi')
-const BaseRequest = __nccwpck_require__(65225)
-const RequestError = __nccwpck_require__(31296)
-const { IDS, objectHasProperty } = __nccwpck_require__(14178)
-const { TYPES, DECLARATIONS, declare, cast } = __nccwpck_require__(62388)
-const Table = __nccwpck_require__(67417)
-const { PARSERS: UDT } = __nccwpck_require__(33199)
+ for (k in obj2) {
+ if (!obj1.hasOwnProperty(k))
+ return (false);
+ }
-const JSON_COLUMN_ID = 'JSON_F52E2B61-18A1-11d1-B105-00805F49916B'
-const XML_COLUMN_ID = 'XML_F52E2B61-18A1-11d1-B105-00805F49916B'
+ return (true);
+}
-const N_TYPES = {
- BitN: 0x68,
- DateTimeN: 0x6F,
- DecimalN: 0x6A,
- FloatN: 0x6D,
- IntN: 0x26,
- MoneyN: 0x6E,
- NumericN: 0x6C
+function isEmpty(obj)
+{
+ var key;
+ for (key in obj)
+ return (false);
+ return (true);
}
-const getTediousType = function (type) {
- switch (type) {
- case TYPES.VarChar: return tds.TYPES.VarChar
- case TYPES.NVarChar: return tds.TYPES.NVarChar
- case TYPES.Text: return tds.TYPES.Text
- case TYPES.Int: return tds.TYPES.Int
- case TYPES.BigInt: return tds.TYPES.BigInt
- case TYPES.TinyInt: return tds.TYPES.TinyInt
- case TYPES.SmallInt: return tds.TYPES.SmallInt
- case TYPES.Bit: return tds.TYPES.Bit
- case TYPES.Float: return tds.TYPES.Float
- case TYPES.Decimal: return tds.TYPES.Decimal
- case TYPES.Numeric: return tds.TYPES.Numeric
- case TYPES.Real: return tds.TYPES.Real
- case TYPES.Money: return tds.TYPES.Money
- case TYPES.SmallMoney: return tds.TYPES.SmallMoney
- case TYPES.Time: return tds.TYPES.Time
- case TYPES.Date: return tds.TYPES.Date
- case TYPES.DateTime: return tds.TYPES.DateTime
- case TYPES.DateTime2: return tds.TYPES.DateTime2
- case TYPES.DateTimeOffset: return tds.TYPES.DateTimeOffset
- case TYPES.SmallDateTime: return tds.TYPES.SmallDateTime
- case TYPES.UniqueIdentifier: return tds.TYPES.UniqueIdentifier
- case TYPES.Xml: return tds.TYPES.NVarChar
- case TYPES.Char: return tds.TYPES.Char
- case TYPES.NChar: return tds.TYPES.NChar
- case TYPES.NText: return tds.TYPES.NVarChar
- case TYPES.Image: return tds.TYPES.Image
- case TYPES.Binary: return tds.TYPES.Binary
- case TYPES.VarBinary: return tds.TYPES.VarBinary
- case TYPES.UDT: case TYPES.Geography: case TYPES.Geometry: return tds.TYPES.UDT
- case TYPES.TVP: return tds.TYPES.TVP
- case TYPES.Variant: return tds.TYPES.Variant
- default: return type
- }
+function hasKey(obj, key)
+{
+ mod_assert.equal(typeof (key), 'string');
+ return (Object.prototype.hasOwnProperty.call(obj, key));
}
-const getMssqlType = function (type, length) {
- if (typeof type !== 'object') return undefined
+function forEachKey(obj, callback)
+{
+ for (var key in obj) {
+ if (hasKey(obj, key)) {
+ callback(key, obj[key]);
+ }
+ }
+}
- switch (type) {
- case tds.TYPES.Char: return TYPES.Char
- case tds.TYPES.NChar: return TYPES.NChar
- case tds.TYPES.VarChar: return TYPES.VarChar
- case tds.TYPES.NVarChar: return TYPES.NVarChar
- case tds.TYPES.Text: return TYPES.Text
- case tds.TYPES.NText: return TYPES.NText
- case tds.TYPES.Int: return TYPES.Int
- case tds.TYPES.BigInt: return TYPES.BigInt
- case tds.TYPES.TinyInt: return TYPES.TinyInt
- case tds.TYPES.SmallInt: return TYPES.SmallInt
- case tds.TYPES.Bit: return TYPES.Bit
- case tds.TYPES.Float: return TYPES.Float
- case tds.TYPES.Real: return TYPES.Real
- case tds.TYPES.Money: return TYPES.Money
- case tds.TYPES.SmallMoney: return TYPES.SmallMoney
- case tds.TYPES.Numeric: return TYPES.Numeric
- case tds.TYPES.Decimal: return TYPES.Decimal
- case tds.TYPES.DateTime: return TYPES.DateTime
- case tds.TYPES.Time: return TYPES.Time
- case tds.TYPES.Date: return TYPES.Date
- case tds.TYPES.DateTime2: return TYPES.DateTime2
- case tds.TYPES.DateTimeOffset: return TYPES.DateTimeOffset
- case tds.TYPES.SmallDateTime: return TYPES.SmallDateTime
- case tds.TYPES.UniqueIdentifier: return TYPES.UniqueIdentifier
- case tds.TYPES.Image: return TYPES.Image
- case tds.TYPES.Binary: return TYPES.Binary
- case tds.TYPES.VarBinary: return TYPES.VarBinary
- case tds.TYPES.Xml: return TYPES.Xml
- case tds.TYPES.UDT: return TYPES.UDT
- case tds.TYPES.TVP: return TYPES.TVP
- case tds.TYPES.Variant: return TYPES.Variant
- default:
- switch (type.id) {
- case N_TYPES.BitN: return TYPES.Bit
- case N_TYPES.NumericN: return TYPES.Numeric
- case N_TYPES.DecimalN: return TYPES.Decimal
- case N_TYPES.IntN:
- if (length === 8) return TYPES.BigInt
- if (length === 4) return TYPES.Int
- if (length === 2) return TYPES.SmallInt
- return TYPES.TinyInt
- case N_TYPES.FloatN:
- if (length === 8) return TYPES.Float
- return TYPES.Real
- case N_TYPES.MoneyN:
- if (length === 8) return TYPES.Money
- return TYPES.SmallMoney
- case N_TYPES.DateTimeN:
- if (length === 8) return TYPES.DateTime
- return TYPES.SmallDateTime
- }
- }
+function pluck(obj, key)
+{
+ mod_assert.equal(typeof (key), 'string');
+ return (pluckv(obj, key));
}
-const createColumns = function (metadata, arrayRowMode) {
- let out = {}
- if (arrayRowMode) out = []
- for (let index = 0, length = metadata.length; index < length; index++) {
- const column = metadata[index]
- const outColumn = {
- index,
- name: column.colName,
- length: column.dataLength,
- type: getMssqlType(column.type, column.dataLength),
- scale: column.scale,
- precision: column.precision,
- nullable: !!(column.flags & 0x01),
- caseSensitive: !!(column.flags & 0x02),
- identity: !!(column.flags & 0x10),
- readOnly: !(column.flags & 0x0C)
- }
+function pluckv(obj, key)
+{
+ if (obj === null || typeof (obj) !== 'object')
+ return (undefined);
- if (column.udtInfo) {
- outColumn.udt = {
- name: column.udtInfo.typeName,
- database: column.udtInfo.dbname,
- schema: column.udtInfo.owningSchema,
- assembly: column.udtInfo.assemblyName
- }
+ if (obj.hasOwnProperty(key))
+ return (obj[key]);
- if (DECLARATIONS[column.udtInfo.typeName]) {
- outColumn.type = DECLARATIONS[column.udtInfo.typeName]
- }
- }
+ var i = key.indexOf('.');
+ if (i == -1)
+ return (undefined);
- if (arrayRowMode) {
- out.push(outColumn)
- } else {
- out[column.colName] = outColumn
- }
- }
+ var key1 = key.substr(0, i);
+ if (!obj.hasOwnProperty(key1))
+ return (undefined);
- return out
+ return (pluckv(obj[key1], key.substr(i + 1)));
}
-const valueCorrection = function (value, metadata) {
- if ((metadata.type === tds.TYPES.UDT) && (value != null)) {
- if (UDT[metadata.udtInfo.typeName]) {
- return UDT[metadata.udtInfo.typeName](value)
- } else {
- return value
- }
- } else {
- return value
- }
+/*
+ * Invoke callback(row) for each entry in the array that would be returned by
+ * flattenObject(data, depth). This is just like flattenObject(data,
+ * depth).forEach(callback), except that the intermediate array is never
+ * created.
+ */
+function flattenIter(data, depth, callback)
+{
+ doFlattenIter(data, depth, [], callback);
}
-const parameterCorrection = function (value) {
- if (value instanceof Table) {
- const tvp = {
- name: value.name,
- schema: value.schema,
- columns: [],
- rows: value.rows
- }
-
- for (const col of value.columns) {
- tvp.columns.push({
- name: col.name,
- type: getTediousType(col.type),
- length: col.length,
- scale: col.scale,
- precision: col.precision
- })
- }
+function doFlattenIter(data, depth, accum, callback)
+{
+ var each;
+ var key;
- return tvp
- } else {
- return value
- }
-}
+ if (depth === 0) {
+ each = accum.slice(0);
+ each.push(data);
+ callback(each);
+ return;
+ }
-class Request extends BaseRequest {
- /*
- Execute specified sql batch.
- */
+ mod_assert.ok(data !== null);
+ mod_assert.equal(typeof (data), 'object');
+ mod_assert.equal(typeof (depth), 'number');
+ mod_assert.ok(depth >= 0);
- _batch (batch, callback) {
- this._isBatch = true
- this._query(batch, callback)
- }
+ for (key in data) {
+ each = accum.slice(0);
+ each.push(key);
+ doFlattenIter(data[key], depth - 1, each, callback);
+ }
+}
- /*
- Bulk load.
- */
+function flattenObject(data, depth)
+{
+ if (depth === 0)
+ return ([ data ]);
- _bulk (table, options, callback) {
- super._bulk(table, options, err => {
- if (err) return callback(err)
+ mod_assert.ok(data !== null);
+ mod_assert.equal(typeof (data), 'object');
+ mod_assert.equal(typeof (depth), 'number');
+ mod_assert.ok(depth >= 0);
- table._makeBulk()
+ var rv = [];
+ var key;
- if (!table.name) {
- return callback(new RequestError('Table name must be specified for bulk insert.', 'ENAME'))
- }
+ for (key in data) {
+ flattenObject(data[key], depth - 1).forEach(function (p) {
+ rv.push([ key ].concat(p));
+ });
+ }
- if (table.name.charAt(0) === '@') {
- return callback(new RequestError("You can't use table variables for bulk insert.", 'ENAME'))
- }
+ return (rv);
+}
- const errors = []
- const errorHandlers = {}
- let hasReturned = false
+function startsWith(str, prefix)
+{
+ return (str.substr(0, prefix.length) == prefix);
+}
- const handleError = (doReturn, connection, info) => {
- let err = new Error(info.message)
- err.info = info
- err = new RequestError(err, 'EREQUEST')
+function endsWith(str, suffix)
+{
+ return (str.substr(
+ str.length - suffix.length, suffix.length) == suffix);
+}
- if (this.stream) {
- this.emit('error', err)
- } else {
- if (doReturn && !hasReturned) {
- if (connection) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+function iso8601(d)
+{
+ if (typeof (d) == 'number')
+ d = new Date(d);
+ mod_assert.ok(d.constructor === Date);
+ return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',
+ d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
+ d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
+ d.getUTCMilliseconds()));
+}
- this.parent.release(connection)
- }
+var RFC1123_MONTHS = [
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+var RFC1123_DAYS = [
+ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
- hasReturned = true
- callback(err)
- }
- }
+function rfc1123(date) {
+ return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',
+ RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),
+ RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),
+ date.getUTCHours(), date.getUTCMinutes(),
+ date.getUTCSeconds()));
+}
- // we must collect errors even in stream mode
- errors.push(err)
- }
+/*
+ * Parses a date expressed as a string, as either a number of milliseconds since
+ * the epoch or any string format that Date accepts, giving preference to the
+ * former where these two sets overlap (e.g., small numbers).
+ */
+function parseDateTime(str)
+{
+ /*
+ * This is irritatingly implicit, but significantly more concise than
+ * alternatives. The "+str" will convert a string containing only a
+ * number directly to a Number, or NaN for other strings. Thus, if the
+ * conversion succeeds, we use it (this is the milliseconds-since-epoch
+ * case). Otherwise, we pass the string directly to the Date
+ * constructor to parse.
+ */
+ var numeric = +str;
+ if (!isNaN(numeric)) {
+ return (new Date(numeric));
+ } else {
+ return (new Date(str));
+ }
+}
- const handleInfo = msg => {
- this.emit('info', {
- message: msg.message,
- number: msg.number,
- state: msg.state,
- class: msg.class,
- lineNumber: msg.lineNumber,
- serverName: msg.serverName,
- procName: msg.procName
- })
- }
- this.parent.acquire(this, (err, connection) => {
- if (err) return callback(err)
+/*
+ * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode
+ * the ES6 definitions here, while allowing for them to someday be higher.
+ */
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
+var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
- debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
- if (this.canceled) {
- debug('request(%d): canceled', IDS.get(this))
- this.parent.release(connection)
- return callback(new RequestError('Canceled.', 'ECANCEL'))
- }
+/*
+ * Default options for parseInteger().
+ */
+var PI_DEFAULTS = {
+ base: 10,
+ allowSign: true,
+ allowPrefix: false,
+ allowTrailing: false,
+ allowImprecise: false,
+ trimWhitespace: false,
+ leadingZeroIsOctal: false
+};
- this._cancel = () => {
- debug('request(%d): cancel', IDS.get(this))
- connection.cancel()
- }
+var CP_0 = 0x30;
+var CP_9 = 0x39;
- // attach handler to handle multiple error messages
- connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
- connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
- connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
+var CP_A = 0x41;
+var CP_B = 0x42;
+var CP_O = 0x4f;
+var CP_T = 0x54;
+var CP_X = 0x58;
+var CP_Z = 0x5a;
- const done = (err, rowCount) => {
- // to make sure we handle no-sql errors as well
- if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
- err = new RequestError(err, 'EREQUEST')
- if (this.stream) this.emit('error', err)
- errors.push(err)
- }
+var CP_a = 0x61;
+var CP_b = 0x62;
+var CP_o = 0x6f;
+var CP_t = 0x74;
+var CP_x = 0x78;
+var CP_z = 0x7a;
- delete this._cancel
+var PI_CONV_DEC = 0x30;
+var PI_CONV_UC = 0x37;
+var PI_CONV_LC = 0x57;
- let error
- if (errors.length && !this.stream) {
- error = errors.pop()
- error.precedingErrors = errors
- }
- if (!hasReturned) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+/*
+ * A stricter version of parseInt() that provides options for changing what
+ * is an acceptable string (for example, disallowing trailing characters).
+ */
+function parseInteger(str, uopts)
+{
+ mod_assert.string(str, 'str');
+ mod_assert.optionalObject(uopts, 'options');
- this.parent.release(connection)
- hasReturned = true
+ var baseOverride = false;
+ var options = PI_DEFAULTS;
- if (this.stream) {
- callback(null, rowCount)
- } else {
- callback(error, rowCount)
- }
- }
- }
+ if (uopts) {
+ baseOverride = hasKey(uopts, 'base');
+ options = mergeObjects(options, uopts);
+ mod_assert.number(options.base, 'options.base');
+ mod_assert.ok(options.base >= 2, 'options.base >= 2');
+ mod_assert.ok(options.base <= 36, 'options.base <= 36');
+ mod_assert.bool(options.allowSign, 'options.allowSign');
+ mod_assert.bool(options.allowPrefix, 'options.allowPrefix');
+ mod_assert.bool(options.allowTrailing,
+ 'options.allowTrailing');
+ mod_assert.bool(options.allowImprecise,
+ 'options.allowImprecise');
+ mod_assert.bool(options.trimWhitespace,
+ 'options.trimWhitespace');
+ mod_assert.bool(options.leadingZeroIsOctal,
+ 'options.leadingZeroIsOctal');
- const bulk = connection.newBulkLoad(table.path, options, done)
+ if (options.leadingZeroIsOctal) {
+ mod_assert.ok(!baseOverride,
+ '"base" and "leadingZeroIsOctal" are ' +
+ 'mutually exclusive');
+ }
+ }
- for (const col of table.columns) {
- bulk.addColumn(col.name, getTediousType(col.type), { nullable: col.nullable, length: col.length, scale: col.scale, precision: col.precision })
- }
+ var c;
+ var pbase = -1;
+ var base = options.base;
+ var start;
+ var mult = 1;
+ var value = 0;
+ var idx = 0;
+ var len = str.length;
- for (const row of table.rows) {
- bulk.addRow(row)
- }
+ /* Trim any whitespace on the left side. */
+ if (options.trimWhitespace) {
+ while (idx < len && isSpace(str.charCodeAt(idx))) {
+ ++idx;
+ }
+ }
- if (table.create) {
- const objectid = table.temporary ? `tempdb..[${table.name}]` : table.path
- const req = new tds.Request(`if object_id('${objectid.replace(/'/g, '\'\'')}') is null ${table.declare()}`, err => {
- if (err) return done(err)
+ /* Check the number for a leading sign. */
+ if (options.allowSign) {
+ if (str[idx] === '-') {
+ idx += 1;
+ mult = -1;
+ } else if (str[idx] === '+') {
+ idx += 1;
+ }
+ }
- connection.execBulkLoad(bulk)
- })
- this._setCurrentRequest(req)
+ /* Parse the base-indicating prefix if there is one. */
+ if (str[idx] === '0') {
+ if (options.allowPrefix) {
+ pbase = prefixToBase(str.charCodeAt(idx + 1));
+ if (pbase !== -1 && (!baseOverride || pbase === base)) {
+ base = pbase;
+ idx += 2;
+ }
+ }
- connection.execSqlBatch(req)
- } else {
- connection.execBulkLoad(bulk)
- }
- })
- })
- }
+ if (pbase === -1 && options.leadingZeroIsOctal) {
+ base = 8;
+ }
+ }
- /*
- Execute specified sql command.
- */
+ /* Parse the actual digits. */
+ for (start = idx; idx < len; ++idx) {
+ c = translateDigit(str.charCodeAt(idx));
+ if (c !== -1 && c < base) {
+ value *= base;
+ value += c;
+ } else {
+ break;
+ }
+ }
- _query (command, callback) {
- super._query(command, err => {
- if (err) return callback(err)
+ /* If we didn't parse any digits, we have an invalid number. */
+ if (start === idx) {
+ return (new Error('invalid number: ' + JSON.stringify(str)));
+ }
- const recordsets = []
- const recordsetcolumns = []
- const errors = []
- const errorHandlers = {}
- const output = {}
- const rowsAffected = []
+ /* Trim any whitespace on the right side. */
+ if (options.trimWhitespace) {
+ while (idx < len && isSpace(str.charCodeAt(idx))) {
+ ++idx;
+ }
+ }
- let columns = {}
- let recordset = []
- let batchLastRow = null
- let batchHasOutput = false
- let isChunkedRecordset = false
- let chunksBuffer = null
- let hasReturned = false
+ /* Check for trailing characters. */
+ if (idx < len && !options.allowTrailing) {
+ return (new Error('trailing characters after number: ' +
+ JSON.stringify(str.slice(idx))));
+ }
- const handleError = (doReturn, connection, info) => {
- let err = new Error(info.message)
- err.info = info
- err = new RequestError(err, 'EREQUEST')
+ /* If our value is 0, we return now, to avoid returning -0. */
+ if (value === 0) {
+ return (0);
+ }
- if (this.stream) {
- this.emit('error', err)
- } else {
- if (doReturn && !hasReturned) {
- if (connection) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+ /* Calculate our final value. */
+ var result = value * mult;
- this.parent.release(connection)
- }
+ /*
+ * If the string represents a value that cannot be precisely represented
+ * by JavaScript, then we want to check that:
+ *
+ * - We never increased the value past MAX_SAFE_INTEGER
+ * - We don't make the result negative and below MIN_SAFE_INTEGER
+ *
+ * Because we only ever increment the value during parsing, there's no
+ * chance of moving past MAX_SAFE_INTEGER and then dropping below it
+ * again, losing precision in the process. This means that we only need
+ * to do our checks here, at the end.
+ */
+ if (!options.allowImprecise &&
+ (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {
+ return (new Error('number is outside of the supported range: ' +
+ JSON.stringify(str.slice(start, idx))));
+ }
- hasReturned = true
- callback(err)
- }
- }
+ return (result);
+}
- // we must collect errors even in stream mode
- errors.push(err)
- }
- const handleInfo = msg => {
- this.emit('info', {
- message: msg.message,
- number: msg.number,
- state: msg.state,
- class: msg.class,
- lineNumber: msg.lineNumber,
- serverName: msg.serverName,
- procName: msg.procName
- })
- }
+/*
+ * Interpret a character code as a base-36 digit.
+ */
+function translateDigit(d)
+{
+ if (d >= CP_0 && d <= CP_9) {
+ /* '0' to '9' -> 0 to 9 */
+ return (d - PI_CONV_DEC);
+ } else if (d >= CP_A && d <= CP_Z) {
+ /* 'A' - 'Z' -> 10 to 35 */
+ return (d - PI_CONV_UC);
+ } else if (d >= CP_a && d <= CP_z) {
+ /* 'a' - 'z' -> 10 to 35 */
+ return (d - PI_CONV_LC);
+ } else {
+ /* Invalid character code */
+ return (-1);
+ }
+}
- this.parent.acquire(this, (err, connection, config) => {
- if (err) return callback(err)
- debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
+/*
+ * Test if a value matches the ECMAScript definition of trimmable whitespace.
+ */
+function isSpace(c)
+{
+ return (c === 0x20) ||
+ (c >= 0x0009 && c <= 0x000d) ||
+ (c === 0x00a0) ||
+ (c === 0x1680) ||
+ (c === 0x180e) ||
+ (c >= 0x2000 && c <= 0x200a) ||
+ (c === 0x2028) ||
+ (c === 0x2029) ||
+ (c === 0x202f) ||
+ (c === 0x205f) ||
+ (c === 0x3000) ||
+ (c === 0xfeff);
+}
- let row
- if (this.canceled) {
- debug('request(%d): canceled', IDS.get(this))
- this.parent.release(connection)
- return callback(new RequestError('Canceled.', 'ECANCEL'))
- }
+/*
+ * Determine which base a character indicates (e.g., 'x' indicates hex).
+ */
+function prefixToBase(c)
+{
+ if (c === CP_b || c === CP_B) {
+ /* 0b/0B (binary) */
+ return (2);
+ } else if (c === CP_o || c === CP_O) {
+ /* 0o/0O (octal) */
+ return (8);
+ } else if (c === CP_t || c === CP_T) {
+ /* 0t/0T (decimal) */
+ return (10);
+ } else if (c === CP_x || c === CP_X) {
+ /* 0x/0X (hexadecimal) */
+ return (16);
+ } else {
+ /* Not a meaningful character */
+ return (-1);
+ }
+}
- this._cancel = () => {
- debug('request(%d): cancel', IDS.get(this))
- connection.cancel()
- }
- // attach handler to handle multiple error messages
- connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
- connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
- connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
+function validateJsonObjectJS(schema, input)
+{
+ var report = mod_jsonschema.validate(input, schema);
- debug('request(%d): query', IDS.get(this), command)
+ if (report.errors.length === 0)
+ return (null);
- const req = new tds.Request(command, err => {
- // to make sure we handle no-sql errors as well
- if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
- err = new RequestError(err, 'EREQUEST')
- if (this.stream) this.emit('error', err)
- errors.push(err)
- }
+ /* Currently, we only do anything useful with the first error. */
+ var error = report.errors[0];
- // process batch outputs
- if (batchHasOutput) {
- if (!this.stream) batchLastRow = recordsets.pop()[0]
+ /* The failed property is given by a URI with an irrelevant prefix. */
+ var propname = error['property'];
+ var reason = error['message'].toLowerCase();
+ var i, j;
- for (const name in batchLastRow) {
- const value = batchLastRow[name]
- if (name !== '___return___') {
- output[name] = value
- }
- }
- }
+ /*
+ * There's at least one case where the property error message is
+ * confusing at best. We work around this here.
+ */
+ if ((i = reason.indexOf('the property ')) != -1 &&
+ (j = reason.indexOf(' is not defined in the schema and the ' +
+ 'schema does not allow additional properties')) != -1) {
+ i += 'the property '.length;
+ if (propname === '')
+ propname = reason.substr(i, j - i);
+ else
+ propname = propname + '.' + reason.substr(i, j - i);
- delete this._cancel
+ reason = 'unsupported property';
+ }
- let error
- if (errors.length && !this.stream) {
- error = errors.pop()
- error.precedingErrors = errors
- }
+ var rv = new mod_verror.VError('property "%s": %s', propname, reason);
+ rv.jsv_details = error;
+ return (rv);
+}
- if (!hasReturned) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+function randElt(arr)
+{
+ mod_assert.ok(Array.isArray(arr) && arr.length > 0,
+ 'randElt argument must be a non-empty array');
- this.parent.release(connection)
- hasReturned = true
+ return (arr[Math.floor(Math.random() * arr.length)]);
+}
- if (error) {
- debug('request(%d): failed', IDS.get(this), error)
- } else {
- debug('request(%d): completed', IDS.get(this))
- }
+function assertHrtime(a)
+{
+ mod_assert.ok(a[0] >= 0 && a[1] >= 0,
+ 'negative numbers not allowed in hrtimes');
+ mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');
+}
- if (this.stream) {
- callback(null, null, output, rowsAffected, recordsetcolumns)
- } else {
- callback(error, recordsets, output, rowsAffected, recordsetcolumns)
- }
- }
- })
+/*
+ * Compute the time elapsed between hrtime readings A and B, where A is later
+ * than B. hrtime readings come from Node's process.hrtime(). There is no
+ * defined way to represent negative deltas, so it's illegal to diff B from A
+ * where the time denoted by B is later than the time denoted by A. If this
+ * becomes valuable, we can define a representation and extend the
+ * implementation to support it.
+ */
+function hrtimeDiff(a, b)
+{
+ assertHrtime(a);
+ assertHrtime(b);
+ mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),
+ 'negative differences not allowed');
- this._setCurrentRequest(req)
+ var rv = [ a[0] - b[0], 0 ];
- req.on('columnMetadata', metadata => {
- columns = createColumns(metadata, this.arrayRowMode)
+ if (a[1] >= b[1]) {
+ rv[1] = a[1] - b[1];
+ } else {
+ rv[0]--;
+ rv[1] = 1e9 - (b[1] - a[1]);
+ }
- isChunkedRecordset = false
- if (metadata.length === 1 && (metadata[0].colName === JSON_COLUMN_ID || metadata[0].colName === XML_COLUMN_ID)) {
- isChunkedRecordset = true
- chunksBuffer = []
- }
+ return (rv);
+}
- if (this.stream) {
- if (this._isBatch) {
- // don't stream recordset with output values in batches
- if (!columns.___return___) {
- this.emit('recordset', columns)
- }
- } else {
- this.emit('recordset', columns)
- }
- }
- if (this.arrayRowMode) recordsetcolumns.push(columns)
- })
+/*
+ * Convert a hrtime reading from the array format returned by Node's
+ * process.hrtime() into a scalar number of nanoseconds.
+ */
+function hrtimeNanosec(a)
+{
+ assertHrtime(a);
- const doneHandler = (rowCount, more) => {
- if (rowCount != null) rowsAffected.push(rowCount)
- // this function is called even when select only set variables so we should skip adding a new recordset
- if (Object.keys(columns).length === 0) return
+ return (Math.floor(a[0] * 1e9 + a[1]));
+}
- if (isChunkedRecordset) {
- const concatenatedChunks = chunksBuffer.join('')
- if (columns[JSON_COLUMN_ID] && config.parseJSON === true) {
- try {
- if (concatenatedChunks === '') {
- row = null
- } else {
- row = JSON.parse(concatenatedChunks)
- }
- } catch (ex) {
- row = null
- const ex2 = new RequestError(new Error(`Failed to parse incoming JSON. ${ex.message}`), 'EJSON')
+/*
+ * Convert a hrtime reading from the array format returned by Node's
+ * process.hrtime() into a scalar number of microseconds.
+ */
+function hrtimeMicrosec(a)
+{
+ assertHrtime(a);
- if (this.stream) this.emit('error', ex2)
+ return (Math.floor(a[0] * 1e6 + a[1] / 1e3));
+}
- // we must collect errors even in stream mode
- errors.push(ex2)
- }
- } else {
- row = {}
- row[Object.keys(columns)[0]] = concatenatedChunks
- }
+/*
+ * Convert a hrtime reading from the array format returned by Node's
+ * process.hrtime() into a scalar number of milliseconds.
+ */
+function hrtimeMillisec(a)
+{
+ assertHrtime(a);
- chunksBuffer = null
+ return (Math.floor(a[0] * 1e3 + a[1] / 1e6));
+}
- if (this.stream) {
- this.emit('row', row)
- } else {
- recordset.push(row)
- }
- }
+/*
+ * Add two hrtime readings A and B, overwriting A with the result of the
+ * addition. This function is useful for accumulating several hrtime intervals
+ * into a counter. Returns A.
+ */
+function hrtimeAccum(a, b)
+{
+ assertHrtime(a);
+ assertHrtime(b);
- if (!this.stream) {
- // all rows of current recordset loaded
- Object.defineProperty(recordset, 'columns', {
- enumerable: false,
- configurable: true,
- value: columns
- })
+ /*
+ * Accumulate the nanosecond component.
+ */
+ a[1] += b[1];
+ if (a[1] >= 1e9) {
+ /*
+ * The nanosecond component overflowed, so carry to the seconds
+ * field.
+ */
+ a[0]++;
+ a[1] -= 1e9;
+ }
- Object.defineProperty(recordset, 'toTable', {
- enumerable: false,
- configurable: true,
- value (name) { return Table.fromRecordset(this, name) }
- })
+ /*
+ * Accumulate the seconds component.
+ */
+ a[0] += b[0];
- recordsets.push(recordset)
- }
+ return (a);
+}
- recordset = []
- columns = {}
- }
+/*
+ * Add two hrtime readings A and B, returning the result as a new hrtime array.
+ * Does not modify either input argument.
+ */
+function hrtimeAdd(a, b)
+{
+ assertHrtime(a);
- req.on('doneInProc', doneHandler) // doneInProc handlers are used in both queries and batches
- req.on('done', doneHandler) // done handlers are used in batches
+ var rv = [ a[0], a[1] ];
- req.on('returnValue', (parameterName, value, metadata) => {
- output[parameterName] = value
- })
+ return (hrtimeAccum(rv, b));
+}
- req.on('row', columns => {
- if (!recordset) recordset = []
- if (isChunkedRecordset) {
- return chunksBuffer.push(columns[0].value)
- }
+/*
+ * Check an object for unexpected properties. Accepts the object to check, and
+ * an array of allowed property names (strings). Returns an array of key names
+ * that were found on the object, but did not appear in the list of allowed
+ * properties. If no properties were found, the returned array will be of
+ * zero length.
+ */
+function extraProperties(obj, allowed)
+{
+ mod_assert.ok(typeof (obj) === 'object' && obj !== null,
+ 'obj argument must be a non-null object');
+ mod_assert.ok(Array.isArray(allowed),
+ 'allowed argument must be an array of strings');
+ for (var i = 0; i < allowed.length; i++) {
+ mod_assert.ok(typeof (allowed[i]) === 'string',
+ 'allowed argument must be an array of strings');
+ }
- if (this.arrayRowMode) {
- row = []
- } else {
- row = {}
- }
- for (const col of columns) {
- col.value = valueCorrection(col.value, col.metadata)
+ return (Object.keys(obj).filter(function (key) {
+ return (allowed.indexOf(key) === -1);
+ }));
+}
- if (this.arrayRowMode) {
- row.push(col.value)
- } else {
- const exi = row[col.metadata.colName]
- if (exi != null) {
- if (exi instanceof Array) {
- exi.push(col.value)
- } else {
- row[col.metadata.colName] = [exi, col.value]
- }
- } else {
- row[col.metadata.colName] = col.value
- }
- }
- }
+/*
+ * Given three sets of properties "provided" (may be undefined), "overrides"
+ * (required), and "defaults" (may be undefined), construct an object containing
+ * the union of these sets with "overrides" overriding "provided", and
+ * "provided" overriding "defaults". None of the input objects are modified.
+ */
+function mergeObjects(provided, overrides, defaults)
+{
+ var rv, k;
- if (this.stream) {
- if (this._isBatch) {
- // dont stream recordset with output values in batches
- if (row.___return___) {
- batchLastRow = row
- } else {
- this.emit('row', row)
- }
- } else {
- this.emit('row', row)
- }
- } else {
- recordset.push(row)
- }
- })
+ rv = {};
+ if (defaults) {
+ for (k in defaults)
+ rv[k] = defaults[k];
+ }
- if (this._isBatch) {
- if (Object.keys(this.parameters).length) {
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- let value = getTediousType(param.type).validate(param.value)
+ if (provided) {
+ for (k in provided)
+ rv[k] = provided[k];
+ }
- if (value instanceof TypeError) {
- value = new RequestError(`Validation failed for parameter '${name}'. ${value.message}`, 'EPARAM')
+ if (overrides) {
+ for (k in overrides)
+ rv[k] = overrides[k];
+ }
- this.parent.release(connection)
- return callback(value)
- }
+ return (rv);
+}
- param.value = value
- }
- const declarations = []
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- declarations.push(`@${name} ${declare(param.type, param)}`)
- }
+/***/ }),
- const assigns = []
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- assigns.push(`@${name} = ${cast(param.value, param.type, param)}`)
- }
+/***/ 96010:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- const selects = []
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- if (param.io === 2) {
- selects.push(`@${name} as [${name}]`)
- }
- }
+var bufferEqual = __nccwpck_require__(9239);
+var Buffer = __nccwpck_require__(21867).Buffer;
+var crypto = __nccwpck_require__(76417);
+var formatEcdsa = __nccwpck_require__(11728);
+var util = __nccwpck_require__(31669);
- batchHasOutput = selects.length > 0
+var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".'
+var MSG_INVALID_SECRET = 'secret must be a string or buffer';
+var MSG_INVALID_VERIFIER_KEY = 'key must be a string or a buffer';
+var MSG_INVALID_SIGNER_KEY = 'key must be a string, a buffer or an object';
- req.sqlTextOrProcedure = `declare ${declarations.join(', ')};select ${assigns.join(', ')};${req.sqlTextOrProcedure};${batchHasOutput ? (`select 1 as [___return___], ${selects.join(', ')}`) : ''}`
- }
- } else {
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- if (param.io === 1) {
- req.addParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
- } else {
- req.addOutputParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
- }
- }
- }
+var supportsKeyObjects = typeof crypto.createPublicKey === 'function';
+if (supportsKeyObjects) {
+ MSG_INVALID_VERIFIER_KEY += ' or a KeyObject';
+ MSG_INVALID_SECRET += 'or a KeyObject';
+}
- try {
- connection[this._isBatch ? 'execSqlBatch' : 'execSql'](req)
- } catch (error) {
- handleError(true, connection, error)
- }
- })
- })
+function checkIsPublicKey(key) {
+ if (Buffer.isBuffer(key)) {
+ return;
}
- /*
- Execute stored procedure with specified parameters.
- */
-
- _execute (procedure, callback) {
- super._execute(procedure, err => {
- if (err) return callback(err)
+ if (typeof key === 'string') {
+ return;
+ }
- const recordsets = []
- const recordsetcolumns = []
- const errors = []
- const errorHandlers = {}
- const output = {}
- const rowsAffected = []
+ if (!supportsKeyObjects) {
+ throw typeError(MSG_INVALID_VERIFIER_KEY);
+ }
- let columns = {}
- let recordset = []
- let returnValue = 0
- let isChunkedRecordset = false
- let chunksBuffer = null
- let hasReturned = false
+ if (typeof key !== 'object') {
+ throw typeError(MSG_INVALID_VERIFIER_KEY);
+ }
- const handleError = (doReturn, connection, info) => {
- let err = new Error(info.message)
- err.info = info
- err = new RequestError(err, 'EREQUEST')
+ if (typeof key.type !== 'string') {
+ throw typeError(MSG_INVALID_VERIFIER_KEY);
+ }
- if (this.stream) {
- this.emit('error', err)
- } else {
- if (doReturn && !hasReturned) {
- if (connection) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+ if (typeof key.asymmetricKeyType !== 'string') {
+ throw typeError(MSG_INVALID_VERIFIER_KEY);
+ }
- this.parent.release(connection)
- }
+ if (typeof key.export !== 'function') {
+ throw typeError(MSG_INVALID_VERIFIER_KEY);
+ }
+};
- hasReturned = true
- callback(err)
- }
- }
+function checkIsPrivateKey(key) {
+ if (Buffer.isBuffer(key)) {
+ return;
+ }
- // we must collect errors even in stream mode
- errors.push(err)
- }
+ if (typeof key === 'string') {
+ return;
+ }
- const handleInfo = msg => {
- this.emit('info', {
- message: msg.message,
- number: msg.number,
- state: msg.state,
- class: msg.class,
- lineNumber: msg.lineNumber,
- serverName: msg.serverName,
- procName: msg.procName
- })
- }
+ if (typeof key === 'object') {
+ return;
+ }
- this.parent.acquire(this, (err, connection, config) => {
- if (err) return callback(err)
+ throw typeError(MSG_INVALID_SIGNER_KEY);
+};
- debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
+function checkIsSecretKey(key) {
+ if (Buffer.isBuffer(key)) {
+ return;
+ }
- let row
+ if (typeof key === 'string') {
+ return key;
+ }
- if (this.canceled) {
- debug('request(%d): canceled', IDS.get(this))
- this.parent.release(connection)
- return callback(new RequestError('Canceled.', 'ECANCEL'))
- }
+ if (!supportsKeyObjects) {
+ throw typeError(MSG_INVALID_SECRET);
+ }
- this._cancel = () => {
- debug('request(%d): cancel', IDS.get(this))
- connection.cancel()
- }
+ if (typeof key !== 'object') {
+ throw typeError(MSG_INVALID_SECRET);
+ }
- // attach handler to handle multiple error messages
- connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
- connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
- connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
+ if (key.type !== 'secret') {
+ throw typeError(MSG_INVALID_SECRET);
+ }
- if (debug.enabled) {
- // log stored procedure executions and provided parameters
- const params = Object.keys(this.parameters).map(k => this.parameters[k])
- // cut long string parameters short to keep log somewhat clean
- const logValue = s => typeof s === 'string' && s.length > 50 ? s.substring(0, 47) + '...' : s
- // format parameter names as 'my_parameter [sql.Int]'
- const logName = param => param.name + ' [sql.' + param.type.name + ']'
- const logParams = {}
- params.forEach(p => { logParams[logName(p)] = logValue(p.value) })
- debug('request(%d): execute %s %O', IDS.get(this), procedure, logParams)
- }
+ if (typeof key.export !== 'function') {
+ throw typeError(MSG_INVALID_SECRET);
+ }
+}
- const req = new tds.Request(procedure, err => {
- // to make sure we handle no-sql errors as well
- if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
- err = new RequestError(err, 'EREQUEST')
- if (this.stream) this.emit('error', err)
- errors.push(err)
- }
+function fromBase64(base64) {
+ return base64
+ .replace(/=/g, '')
+ .replace(/\+/g, '-')
+ .replace(/\//g, '_');
+}
- delete this._cancel
+function toBase64(base64url) {
+ base64url = base64url.toString();
- let error
- if (errors.length && !this.stream) {
- error = errors.pop()
- error.precedingErrors = errors
- }
+ var padding = 4 - base64url.length % 4;
+ if (padding !== 4) {
+ for (var i = 0; i < padding; ++i) {
+ base64url += '=';
+ }
+ }
- if (!hasReturned) {
- for (const event in errorHandlers) {
- connection.removeListener(event, errorHandlers[event])
- }
+ return base64url
+ .replace(/\-/g, '+')
+ .replace(/_/g, '/');
+}
- this.parent.release(connection)
- hasReturned = true
+function typeError(template) {
+ var args = [].slice.call(arguments, 1);
+ var errMsg = util.format.bind(util, template).apply(null, args);
+ return new TypeError(errMsg);
+}
- if (error) {
- debug('request(%d): failed', IDS.get(this), error)
- } else {
- debug('request(%d): complete', IDS.get(this))
- }
+function bufferOrString(obj) {
+ return Buffer.isBuffer(obj) || typeof obj === 'string';
+}
- if (this.stream) {
- callback(null, null, output, returnValue, rowsAffected, recordsetcolumns)
- } else {
- callback(error, recordsets, output, returnValue, rowsAffected, recordsetcolumns)
- }
- }
- })
+function normalizeInput(thing) {
+ if (!bufferOrString(thing))
+ thing = JSON.stringify(thing);
+ return thing;
+}
- this._setCurrentRequest(req)
+function createHmacSigner(bits) {
+ return function sign(thing, secret) {
+ checkIsSecretKey(secret);
+ thing = normalizeInput(thing);
+ var hmac = crypto.createHmac('sha' + bits, secret);
+ var sig = (hmac.update(thing), hmac.digest('base64'))
+ return fromBase64(sig);
+ }
+}
- req.on('columnMetadata', metadata => {
- columns = createColumns(metadata, this.arrayRowMode)
+function createHmacVerifier(bits) {
+ return function verify(thing, signature, secret) {
+ var computedSig = createHmacSigner(bits)(thing, secret);
+ return bufferEqual(Buffer.from(signature), Buffer.from(computedSig));
+ }
+}
- isChunkedRecordset = false
- if ((metadata.length === 1) && (metadata[0].colName === JSON_COLUMN_ID || metadata[0].colName === XML_COLUMN_ID)) {
- isChunkedRecordset = true
- chunksBuffer = []
- }
+function createKeySigner(bits) {
+ return function sign(thing, privateKey) {
+ checkIsPrivateKey(privateKey);
+ thing = normalizeInput(thing);
+ // Even though we are specifying "RSA" here, this works with ECDSA
+ // keys as well.
+ var signer = crypto.createSign('RSA-SHA' + bits);
+ var sig = (signer.update(thing), signer.sign(privateKey, 'base64'));
+ return fromBase64(sig);
+ }
+}
- if (this.stream) this.emit('recordset', columns)
- if (this.arrayRowMode) recordsetcolumns.push(columns)
- })
+function createKeyVerifier(bits) {
+ return function verify(thing, signature, publicKey) {
+ checkIsPublicKey(publicKey);
+ thing = normalizeInput(thing);
+ signature = toBase64(signature);
+ var verifier = crypto.createVerify('RSA-SHA' + bits);
+ verifier.update(thing);
+ return verifier.verify(publicKey, signature, 'base64');
+ }
+}
- req.on('row', columns => {
- if (!recordset) recordset = []
+function createPSSKeySigner(bits) {
+ return function sign(thing, privateKey) {
+ checkIsPrivateKey(privateKey);
+ thing = normalizeInput(thing);
+ var signer = crypto.createSign('RSA-SHA' + bits);
+ var sig = (signer.update(thing), signer.sign({
+ key: privateKey,
+ padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
+ saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
+ }, 'base64'));
+ return fromBase64(sig);
+ }
+}
- if (isChunkedRecordset) {
- return chunksBuffer.push(columns[0].value)
- }
+function createPSSKeyVerifier(bits) {
+ return function verify(thing, signature, publicKey) {
+ checkIsPublicKey(publicKey);
+ thing = normalizeInput(thing);
+ signature = toBase64(signature);
+ var verifier = crypto.createVerify('RSA-SHA' + bits);
+ verifier.update(thing);
+ return verifier.verify({
+ key: publicKey,
+ padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
+ saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST
+ }, signature, 'base64');
+ }
+}
- if (this.arrayRowMode) {
- row = []
- } else {
- row = {}
- }
- for (const col of columns) {
- col.value = valueCorrection(col.value, col.metadata)
+function createECDSASigner(bits) {
+ var inner = createKeySigner(bits);
+ return function sign() {
+ var signature = inner.apply(null, arguments);
+ signature = formatEcdsa.derToJose(signature, 'ES' + bits);
+ return signature;
+ };
+}
- if (this.arrayRowMode) {
- row.push(col.value)
- } else {
- const exi = row[col.metadata.colName]
- if (exi != null) {
- if (exi instanceof Array) {
- exi.push(col.value)
- } else {
- row[col.metadata.colName] = [exi, col.value]
- }
- } else {
- row[col.metadata.colName] = col.value
- }
- }
- }
+function createECDSAVerifer(bits) {
+ var inner = createKeyVerifier(bits);
+ return function verify(thing, signature, publicKey) {
+ signature = formatEcdsa.joseToDer(signature, 'ES' + bits).toString('base64');
+ var result = inner(thing, signature, publicKey);
+ return result;
+ };
+}
- if (this.stream) {
- this.emit('row', row)
- } else {
- recordset.push(row)
- }
- })
+function createNoneSigner() {
+ return function sign() {
+ return '';
+ }
+}
- req.on('doneInProc', (rowCount, more) => {
- if (rowCount != null) rowsAffected.push(rowCount)
+function createNoneVerifier() {
+ return function verify(thing, signature) {
+ return signature === '';
+ }
+}
- // filter empty recordsets when NOCOUNT is OFF
- if (Object.keys(columns).length === 0) return
+module.exports = function jwa(algorithm) {
+ var signerFactories = {
+ hs: createHmacSigner,
+ rs: createKeySigner,
+ ps: createPSSKeySigner,
+ es: createECDSASigner,
+ none: createNoneSigner,
+ }
+ var verifierFactories = {
+ hs: createHmacVerifier,
+ rs: createKeyVerifier,
+ ps: createPSSKeyVerifier,
+ es: createECDSAVerifer,
+ none: createNoneVerifier,
+ }
+ var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);
+ if (!match)
+ throw typeError(MSG_INVALID_ALGORITHM, algorithm);
+ var algo = (match[1] || match[3]).toLowerCase();
+ var bits = match[2];
- if (isChunkedRecordset) {
- if (columns[JSON_COLUMN_ID] && config.parseJSON === true) {
- try {
- if (chunksBuffer.length === 0) {
- row = null
- } else {
- row = JSON.parse(chunksBuffer.join(''))
- }
- } catch (ex) {
- row = null
- const ex2 = new RequestError(new Error(`Failed to parse incoming JSON. ${ex.message}`), 'EJSON')
+ return {
+ sign: signerFactories[algo](bits),
+ verify: verifierFactories[algo](bits),
+ }
+};
- if (this.stream) this.emit('error', ex2)
- // we must collect errors even in stream mode
- errors.push(ex2)
- }
- } else {
- row = {}
- row[Object.keys(columns)[0]] = chunksBuffer.join('')
- }
+/***/ }),
- chunksBuffer = null
+/***/ 4636:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
- if (this.stream) {
- this.emit('row', row)
- } else {
- recordset.push(row)
- }
- }
+/*global exports*/
+var SignStream = __nccwpck_require__(73334);
+var VerifyStream = __nccwpck_require__(5522);
- if (!this.stream) {
- // all rows of current recordset loaded
- Object.defineProperty(recordset, 'columns', {
- enumerable: false,
- configurable: true,
- value: columns
- })
+var ALGORITHMS = [
+ 'HS256', 'HS384', 'HS512',
+ 'RS256', 'RS384', 'RS512',
+ 'PS256', 'PS384', 'PS512',
+ 'ES256', 'ES384', 'ES512'
+];
- Object.defineProperty(recordset, 'toTable', {
- enumerable: false,
- configurable: true,
- value (name) { return Table.fromRecordset(this, name) }
- })
+exports.ALGORITHMS = ALGORITHMS;
+exports.sign = SignStream.sign;
+exports.verify = VerifyStream.verify;
+exports.decode = VerifyStream.decode;
+exports.isValid = VerifyStream.isValid;
+exports.createSign = function createSign(opts) {
+ return new SignStream(opts);
+};
+exports.createVerify = function createVerify(opts) {
+ return new VerifyStream(opts);
+};
- recordsets.push(recordset)
- }
- recordset = []
- columns = {}
- })
+/***/ }),
- req.on('doneProc', (rowCount, more, returnStatus) => {
- returnValue = returnStatus
- })
+/***/ 61868:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- req.on('returnValue', (parameterName, value, metadata) => {
- output[parameterName] = value
- })
+/*global module, process*/
+var Buffer = __nccwpck_require__(21867).Buffer;
+var Stream = __nccwpck_require__(92413);
+var util = __nccwpck_require__(31669);
- for (const name in this.parameters) {
- if (!objectHasProperty(this.parameters, name)) {
- continue
- }
- const param = this.parameters[name]
- if (param.io === 1) {
- req.addParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
- } else {
- req.addOutputParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
- }
- }
+function DataStream(data) {
+ this.buffer = null;
+ this.writable = true;
+ this.readable = true;
- connection.callProcedure(req)
- })
- })
+ // No input
+ if (!data) {
+ this.buffer = Buffer.alloc(0);
+ return this;
}
- _pause () {
- super._pause()
- if (this._currentRequest) {
- this._currentRequest.pause()
- }
+ // Stream
+ if (typeof data.pipe === 'function') {
+ this.buffer = Buffer.alloc(0);
+ data.pipe(this);
+ return this;
}
- _resume () {
- super._resume()
- if (this._currentRequest) {
- this._currentRequest.resume()
- }
+ // Buffer or String
+ // or Object (assumedly a passworded key)
+ if (data.length || typeof data === 'object') {
+ this.buffer = data;
+ this.writable = false;
+ process.nextTick(function () {
+ this.emit('end', data);
+ this.readable = false;
+ this.emit('close');
+ }.bind(this));
+ return this;
}
+
+ throw new TypeError('Unexpected data type ('+ typeof data + ')');
}
+util.inherits(DataStream, Stream);
-module.exports = Request
+DataStream.prototype.write = function write(data) {
+ this.buffer = Buffer.concat([this.buffer, Buffer.from(data)]);
+ this.emit('data', data);
+};
+
+DataStream.prototype.end = function end(data) {
+ if (data)
+ this.write(data);
+ this.emit('end', data);
+ this.emit('close');
+ this.writable = false;
+ this.readable = false;
+};
+
+module.exports = DataStream;
/***/ }),
-/***/ 41670:
+/***/ 73334:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+/*global module*/
+var Buffer = __nccwpck_require__(21867).Buffer;
+var DataStream = __nccwpck_require__(61868);
+var jwa = __nccwpck_require__(96010);
+var Stream = __nccwpck_require__(92413);
+var toString = __nccwpck_require__(65292);
+var util = __nccwpck_require__(31669);
+function base64url(string, encoding) {
+ return Buffer
+ .from(string, encoding)
+ .toString('base64')
+ .replace(/=/g, '')
+ .replace(/\+/g, '-')
+ .replace(/\//g, '_');
+}
-const debug = __nccwpck_require__(38237)('mssql:tedi')
-const BaseTransaction = __nccwpck_require__(2555)
-const { IDS } = __nccwpck_require__(14178)
-const TransactionError = __nccwpck_require__(70274)
+function jwsSecuredInput(header, payload, encoding) {
+ encoding = encoding || 'utf8';
+ var encodedHeader = base64url(toString(header), 'binary');
+ var encodedPayload = base64url(toString(payload), encoding);
+ return util.format('%s.%s', encodedHeader, encodedPayload);
+}
-class Transaction extends BaseTransaction {
- constructor (parent) {
- super(parent)
+function jwsSign(opts) {
+ var header = opts.header;
+ var payload = opts.payload;
+ var secretOrKey = opts.secret || opts.privateKey;
+ var encoding = opts.encoding;
+ var algo = jwa(header.alg);
+ var securedInput = jwsSecuredInput(header, payload, encoding);
+ var signature = algo.sign(securedInput, secretOrKey);
+ return util.format('%s.%s', securedInput, signature);
+}
- this._abort = () => {
- if (!this._rollbackRequested) {
- // transaction interrupted because of XACT_ABORT
+function SignStream(opts) {
+ var secret = opts.secret||opts.privateKey||opts.key;
+ var secretStream = new DataStream(secret);
+ this.readable = true;
+ this.header = opts.header;
+ this.encoding = opts.encoding;
+ this.secret = this.privateKey = this.key = secretStream;
+ this.payload = new DataStream(opts.payload);
+ this.secret.once('close', function () {
+ if (!this.payload.writable && this.readable)
+ this.sign();
+ }.bind(this));
- const pc = this._acquiredConnection
+ this.payload.once('close', function () {
+ if (!this.secret.writable && this.readable)
+ this.sign();
+ }.bind(this));
+}
+util.inherits(SignStream, Stream);
- // defer releasing so connection can switch from SentClientRequest to LoggedIn state
- setImmediate(this.parent.release.bind(this.parent), pc)
+SignStream.prototype.sign = function sign() {
+ try {
+ var signature = jwsSign({
+ header: this.header,
+ payload: this.payload.buffer,
+ secret: this.secret.buffer,
+ encoding: this.encoding
+ });
+ this.emit('done', signature);
+ this.emit('data', signature);
+ this.emit('end');
+ this.readable = false;
+ return signature;
+ } catch (e) {
+ this.readable = false;
+ this.emit('error', e);
+ this.emit('close');
+ }
+};
- this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
- this._acquiredConnection = null
- this._acquiredConfig = null
- this._aborted = true
+SignStream.sign = jwsSign;
- this.emit('rollback', true)
- }
- }
- }
+module.exports = SignStream;
- _begin (isolationLevel, callback) {
- super._begin(isolationLevel, err => {
- if (err) return callback(err)
- debug('transaction(%d): begin', IDS.get(this))
+/***/ }),
- this.parent.acquire(this, (err, connection, config) => {
- if (err) return callback(err)
+/***/ 65292:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- this._acquiredConnection = connection
- this._acquiredConnection.on('rollbackTransaction', this._abort)
- this._acquiredConfig = config
+/*global module*/
+var Buffer = __nccwpck_require__(64293).Buffer;
- connection.beginTransaction(err => {
- if (err) err = new TransactionError(err)
+module.exports = function toString(obj) {
+ if (typeof obj === 'string')
+ return obj;
+ if (typeof obj === 'number' || Buffer.isBuffer(obj))
+ return obj.toString();
+ return JSON.stringify(obj);
+};
- debug('transaction(%d): begun', IDS.get(this))
- callback(err)
- }, this.name, this.isolationLevel)
- })
- })
- }
+/***/ }),
- _commit (callback) {
- super._commit(err => {
- if (err) return callback(err)
+/***/ 5522:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- debug('transaction(%d): commit', IDS.get(this))
+/*global module*/
+var Buffer = __nccwpck_require__(21867).Buffer;
+var DataStream = __nccwpck_require__(61868);
+var jwa = __nccwpck_require__(96010);
+var Stream = __nccwpck_require__(92413);
+var toString = __nccwpck_require__(65292);
+var util = __nccwpck_require__(31669);
+var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;
- this._acquiredConnection.commitTransaction(err => {
- if (err) err = new TransactionError(err)
+function isObject(thing) {
+ return Object.prototype.toString.call(thing) === '[object Object]';
+}
- this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
- this.parent.release(this._acquiredConnection)
- this._acquiredConnection = null
- this._acquiredConfig = null
+function safeJsonParse(thing) {
+ if (isObject(thing))
+ return thing;
+ try { return JSON.parse(thing); }
+ catch (e) { return undefined; }
+}
- if (!err) debug('transaction(%d): commited', IDS.get(this))
+function headerFromJWS(jwsSig) {
+ var encodedHeader = jwsSig.split('.', 1)[0];
+ return safeJsonParse(Buffer.from(encodedHeader, 'base64').toString('binary'));
+}
- callback(err)
- })
- })
+function securedInputFromJWS(jwsSig) {
+ return jwsSig.split('.', 2).join('.');
+}
+
+function signatureFromJWS(jwsSig) {
+ return jwsSig.split('.')[2];
+}
+
+function payloadFromJWS(jwsSig, encoding) {
+ encoding = encoding || 'utf8';
+ var payload = jwsSig.split('.')[1];
+ return Buffer.from(payload, 'base64').toString(encoding);
+}
+
+function isValidJws(string) {
+ return JWS_REGEX.test(string) && !!headerFromJWS(string);
+}
+
+function jwsVerify(jwsSig, algorithm, secretOrKey) {
+ if (!algorithm) {
+ var err = new Error("Missing algorithm parameter for jws.verify");
+ err.code = "MISSING_ALGORITHM";
+ throw err;
}
+ jwsSig = toString(jwsSig);
+ var signature = signatureFromJWS(jwsSig);
+ var securedInput = securedInputFromJWS(jwsSig);
+ var algo = jwa(algorithm);
+ return algo.verify(securedInput, signature, secretOrKey);
+}
- _rollback (callback) {
- super._rollback(err => {
- if (err) return callback(err)
+function jwsDecode(jwsSig, opts) {
+ opts = opts || {};
+ jwsSig = toString(jwsSig);
- debug('transaction(%d): rollback', IDS.get(this))
+ if (!isValidJws(jwsSig))
+ return null;
- this._acquiredConnection.rollbackTransaction(err => {
- if (err) err = new TransactionError(err)
+ var header = headerFromJWS(jwsSig);
- this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
- this.parent.release(this._acquiredConnection)
- this._acquiredConnection = null
- this._acquiredConfig = null
+ if (!header)
+ return null;
- if (!err) debug('transaction(%d): rolled back', IDS.get(this))
+ var payload = payloadFromJWS(jwsSig);
+ if (header.typ === 'JWT' || opts.json)
+ payload = JSON.parse(payload, opts.encoding);
- callback(err)
- })
- })
- }
+ return {
+ header: header,
+ payload: payload,
+ signature: signatureFromJWS(jwsSig)
+ };
}
-module.exports = Transaction
+function VerifyStream(opts) {
+ opts = opts || {};
+ var secretOrKey = opts.secret||opts.publicKey||opts.key;
+ var secretStream = new DataStream(secretOrKey);
+ this.readable = true;
+ this.algorithm = opts.algorithm;
+ this.encoding = opts.encoding;
+ this.secret = this.publicKey = this.key = secretStream;
+ this.signature = new DataStream(opts.signature);
+ this.secret.once('close', function () {
+ if (!this.signature.writable && this.readable)
+ this.verify();
+ }.bind(this));
+
+ this.signature.once('close', function () {
+ if (!this.secret.writable && this.readable)
+ this.verify();
+ }.bind(this));
+}
+util.inherits(VerifyStream, Stream);
+VerifyStream.prototype.verify = function verify() {
+ try {
+ var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer);
+ var obj = jwsDecode(this.signature.buffer, this.encoding);
+ this.emit('done', valid, obj);
+ this.emit('data', valid);
+ this.emit('end');
+ this.readable = false;
+ return valid;
+ } catch (e) {
+ this.readable = false;
+ this.emit('error', e);
+ this.emit('close');
+ }
+};
+
+VerifyStream.decode = jwsDecode;
+VerifyStream.isValid = isValidJws;
+VerifyStream.verify = jwsVerify;
+
+module.exports = VerifyStream;
/***/ }),
-/***/ 33199:
-/***/ ((module) => {
+/***/ 47426:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = __nccwpck_require__(73313)
+
+
+/***/ }),
+
+/***/ 43583:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
-/* const FIGURE = {
- INTERIOR_RING: 0x00,
- STROKE: 0x01,
- EXTERIOR_RING: 0x02
-};
-const FIGURE_V2 = {
- POINT: 0x00,
- LINE: 0x01,
- ARC: 0x02,
- COMPOSITE_CURVE: 0x03
-};
+/**
+ * Module dependencies.
+ * @private
+ */
-const SHAPE = {
- POINT: 0x01,
- LINESTRING: 0x02,
- POLYGON: 0x03,
- MULTIPOINT: 0x04,
- MULTILINESTRING: 0x05,
- MULTIPOLYGON: 0x06,
- GEOMETRY_COLLECTION: 0x07
-};
+var db = __nccwpck_require__(47426)
+var extname = __nccwpck_require__(85622).extname
-const SHAPE_V2 = {
- POINT: 0x01,
- LINESTRING: 0x02,
- POLYGON: 0x03,
- MULTIPOINT: 0x04,
- MULTILINESTRING: 0x05,
- MULTIPOLYGON: 0x06,
- GEOMETRY_COLLECTION: 0x07,
- CIRCULAR_STRING: 0x08,
- COMPOUND_CURVE: 0x09,
- CURVE_POLYGON: 0x0A,
- FULL_GLOBE: 0x0B
-};
+/**
+ * Module variables.
+ * @private
+ */
-const SEGMENT = {
- LINE: 0x00,
- ARC: 0x01,
- FIRST_LINE: 0x02,
- FIRST_ARC: 0x03
-}; */
+var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
+var TEXT_TYPE_REGEXP = /^text\//i
-class Point {
- constructor () {
- this.x = 0
- this.y = 0
- this.z = null
- this.m = null
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset (type) {
+ if (!type || typeof type !== 'string') {
+ return false
}
-}
-const parsePoints = (buffer, count) => {
- // s2.1.5 + s2.1.6
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
- const points = []
- if (count < 1) {
- return points
+ if (mime && mime.charset) {
+ return mime.charset
}
- for (let i = 1; i <= count; i++) {
- const point = new Point()
- points.push(point)
- point.x = buffer.readDoubleLE(buffer.position)
- point.y = buffer.readDoubleLE(buffer.position + 8)
- buffer.position += 16
+ // default text/* to utf-8
+ if (match && TEXT_TYPE_REGEXP.test(match[1])) {
+ return 'UTF-8'
}
- return points
+ return false
}
-const parseZ = (buffer, points) => {
- // s2.1.1 + s.2.1.2
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
- if (points < 1) {
- return
+function contentType (str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
}
- points.forEach(point => {
- point.z = buffer.readDoubleLE(buffer.position)
- buffer.position += 8
- })
-}
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
-const parseM = (buffer, points) => {
- // s2.1.1 + s.2.1.2
+ if (!mime) {
+ return false
+ }
- if (points < 1) {
- return
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
}
- points.forEach(point => {
- point.m = buffer.readDoubleLE(buffer.position)
- buffer.position += 8
- })
+ return mime
}
-const parseFigures = (buffer, count, properties) => {
- // s2.1.3
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
- const figures = []
- if (count < 1) {
- return figures
+function extension (type) {
+ if (!type || typeof type !== 'string') {
+ return false
}
- if (properties.P) {
- figures.push({
- attribute: 0x01,
- pointOffset: 0
- })
- } else if (properties.L) {
- figures.push({
- attribute: 0x01,
- pointOffset: 0
- })
- } else {
- for (let i = 1; i <= count; i++) {
- figures.push({
- attribute: buffer.readUInt8(buffer.position),
- pointOffset: buffer.readInt32LE(buffer.position + 1)
- })
+ // TODO: use media-typer
+ var match = EXTRACT_TYPE_REGEXP.exec(type)
- buffer.position += 5
- }
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
}
- return figures
+ return exts[0]
}
-const parseShapes = (buffer, count, properties) => {
- // s2.1.4
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
- const shapes = []
- if (count < 1) {
- return shapes
+function lookup (path) {
+ if (!path || typeof path !== 'string') {
+ return false
}
- if (properties.P) {
- shapes.push({
- parentOffset: -1,
- figureOffset: 0,
- type: 0x01
- })
- } else if (properties.L) {
- shapes.push({
- parentOffset: -1,
- figureOffset: 0,
- type: 0x02
- })
- } else {
- for (let i = 1; i <= count; i++) {
- shapes.push({
- parentOffset: buffer.readInt32LE(buffer.position),
- figureOffset: buffer.readInt32LE(buffer.position + 4),
- type: buffer.readUInt8(buffer.position + 8)
- })
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
- buffer.position += 9
- }
+ if (!extension) {
+ return false
}
- return shapes
+ return exports.types[extension] || false
}
-const parseSegments = (buffer, count) => {
- // s2.1.7
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
- const segments = []
- if (count < 1) {
- return segments
- }
+function populateMaps (extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
- for (let i = 1; i <= count; i++) {
- segments.push({ type: buffer.readUInt8(buffer.position) })
+ Object.keys(db).forEach(function forEachMimeType (type) {
+ var mime = db[type]
+ var exts = mime.extensions
- buffer.position++
- }
+ if (!exts || !exts.length) {
+ return
+ }
- return segments
-}
+ // mime -> extensions
+ extensions[type] = exts
-const parseGeography = buffer => {
- // s2.1.1 + s.2.1.2
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
- const srid = buffer.readInt32LE(0)
- if (srid === -1) {
- return null
- }
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
- const value = {
- srid,
- version: buffer.readUInt8(4)
- }
+ if (types[extension] !== 'application/octet-stream' &&
+ (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
+ // skip the remapping
+ continue
+ }
+ }
- const flags = buffer.readUInt8(5)
- buffer.position = 6
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
- // console.log("srid", srid)
- // console.log("version", version)
- const properties = {
- Z: (flags & (1 << 0)) > 0,
- M: (flags & (1 << 1)) > 0,
- V: (flags & (1 << 2)) > 0,
- P: (flags & (1 << 3)) > 0,
- L: (flags & (1 << 4)) > 0
- }
+/***/ }),
- if (value.version === 2) {
- properties.H = (flags & (1 << 3)) > 0
- }
+/***/ 83973:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // console.log("properties", properties);
+module.exports = minimatch
+minimatch.Minimatch = Minimatch
- let numberOfPoints
- if (properties.P) {
- numberOfPoints = 1
- } else if (properties.L) {
- numberOfPoints = 2
- } else {
- numberOfPoints = buffer.readUInt32LE(buffer.position)
- buffer.position += 4
- }
+var path = { sep: '/' }
+try {
+ path = __nccwpck_require__(85622)
+} catch (er) {}
- // console.log("numberOfPoints", numberOfPoints)
+var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+var expand = __nccwpck_require__(33717)
- value.points = parsePoints(buffer, numberOfPoints)
+var plTypes = {
+ '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+ '?': { open: '(?:', close: ')?' },
+ '+': { open: '(?:', close: ')+' },
+ '*': { open: '(?:', close: ')*' },
+ '@': { open: '(?:', close: ')' }
+}
- if (properties.Z) {
- parseZ(buffer, value.points)
- }
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+var qmark = '[^/]'
- if (properties.M) {
- parseM(buffer, value.points)
- }
+// * => any number of characters
+var star = qmark + '*?'
- // console.log("points", points)
+// ** when dots are allowed. Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
- let numberOfFigures
- if (properties.P) {
- numberOfFigures = 1
- } else if (properties.L) {
- numberOfFigures = 1
- } else {
- numberOfFigures = buffer.readUInt32LE(buffer.position)
- buffer.position += 4
- }
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
- // console.log("numberOfFigures", numberOfFigures)
+// characters that need to be escaped in RegExp.
+var reSpecials = charSet('().*{}+?[]^$\\!')
- value.figures = parseFigures(buffer, numberOfFigures, properties)
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+ return s.split('').reduce(function (set, c) {
+ set[c] = true
+ return set
+ }, {})
+}
- // console.log("figures", figures)
+// normalizes slashes.
+var slashSplit = /\/+/
- let numberOfShapes
- if (properties.P) {
- numberOfShapes = 1
- } else if (properties.L) {
- numberOfShapes = 1
- } else {
- numberOfShapes = buffer.readUInt32LE(buffer.position)
- buffer.position += 4
+minimatch.filter = filter
+function filter (pattern, options) {
+ options = options || {}
+ return function (p, i, list) {
+ return minimatch(p, pattern, options)
}
+}
- // console.log("numberOfShapes", numberOfShapes)
-
- value.shapes = parseShapes(buffer, numberOfShapes, properties)
-
- // console.log( "shapes", shapes)
+function ext (a, b) {
+ a = a || {}
+ b = b || {}
+ var t = {}
+ Object.keys(b).forEach(function (k) {
+ t[k] = b[k]
+ })
+ Object.keys(a).forEach(function (k) {
+ t[k] = a[k]
+ })
+ return t
+}
- if (value.version === 2 && buffer.position < buffer.length) {
- const numberOfSegments = buffer.readUInt32LE(buffer.position)
- buffer.position += 4
+minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return minimatch
- // console.log("numberOfSegments", numberOfSegments)
+ var orig = minimatch
- value.segments = parseSegments(buffer, numberOfSegments)
+ var m = function minimatch (p, pattern, options) {
+ return orig.minimatch(p, pattern, ext(def, options))
+ }
- // console.log("segments", segments)
- } else {
- value.segments = []
+ m.Minimatch = function Minimatch (pattern, options) {
+ return new orig.Minimatch(pattern, ext(def, options))
}
- return value
+ return m
}
-module.exports.PARSERS = {
- geography (buffer) {
- return parseGeography(buffer)
- },
+Minimatch.defaults = function (def) {
+ if (!def || !Object.keys(def).length) return Minimatch
+ return minimatch.defaults(def).Minimatch
+}
- geometry (buffer) {
- return parseGeography(buffer)
+function minimatch (p, pattern, options) {
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
}
-}
+ if (!options) options = {}
-/***/ }),
+ // shortcut: comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ return false
+ }
-/***/ 14178:
-/***/ ((module) => {
+ // "" only matches ""
+ if (pattern.trim() === '') return p === ''
-const IDS = new WeakMap()
-const INCREMENT = {
- Connection: 1,
- ConnectionPool: 1,
- Request: 1,
- Transaction: 1,
- PreparedStatement: 1
+ return new Minimatch(pattern, options).match(p)
}
-module.exports = {
- objectHasProperty: (object, property) => Object.prototype.hasOwnProperty.call(object, property),
- INCREMENT: INCREMENT,
- IDS: {
- get: IDS.get.bind(IDS),
- add: (object, type, id) => {
- if (id) return IDS.set(object, id)
- IDS.set(object, INCREMENT[type]++)
- }
+function Minimatch (pattern, options) {
+ if (!(this instanceof Minimatch)) {
+ return new Minimatch(pattern, options)
}
-}
+ if (typeof pattern !== 'string') {
+ throw new TypeError('glob pattern string required')
+ }
-/***/ }),
+ if (!options) options = {}
+ pattern = pattern.trim()
-/***/ 73667:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ // windows support: need to use /, not \
+ if (path.sep !== '/') {
+ pattern = pattern.split(path.sep).join('/')
+ }
-var Classes = Object.create(null);
+ this.options = options
+ this.set = []
+ this.pattern = pattern
+ this.regexp = null
+ this.negate = false
+ this.comment = false
+ this.empty = false
-/**
- * Create a new Connection instance.
- * @param {object|string} config Configuration or connection string for new MySQL connection
- * @return {Connection} A new MySQL connection
- * @public
- */
-exports.createConnection = function createConnection(config) {
- var Connection = loadClass('Connection');
- var ConnectionConfig = loadClass('ConnectionConfig');
+ // make the set of regexps etc.
+ this.make()
+}
- return new Connection({config: new ConnectionConfig(config)});
-};
+Minimatch.prototype.debug = function () {}
-/**
- * Create a new Pool instance.
- * @param {object|string} config Configuration or connection string for new MySQL connections
- * @return {Pool} A new MySQL pool
- * @public
- */
-exports.createPool = function createPool(config) {
- var Pool = loadClass('Pool');
- var PoolConfig = loadClass('PoolConfig');
+Minimatch.prototype.make = make
+function make () {
+ // don't do it more than once.
+ if (this._made) return
- return new Pool({config: new PoolConfig(config)});
-};
+ var pattern = this.pattern
+ var options = this.options
-/**
- * Create a new PoolCluster instance.
- * @param {object} [config] Configuration for pool cluster
- * @return {PoolCluster} New MySQL pool cluster
- * @public
- */
-exports.createPoolCluster = function createPoolCluster(config) {
- var PoolCluster = loadClass('PoolCluster');
+ // empty patterns and comments match nothing.
+ if (!options.nocomment && pattern.charAt(0) === '#') {
+ this.comment = true
+ return
+ }
+ if (!pattern) {
+ this.empty = true
+ return
+ }
- return new PoolCluster(config);
-};
+ // step 1: figure out negation, etc.
+ this.parseNegate()
-/**
- * Create a new Query instance.
- * @param {string} sql The SQL for the query
- * @param {array} [values] Any values to insert into placeholders in sql
- * @param {function} [callback] The callback to use when query is complete
- * @return {Query} New query object
- * @public
- */
-exports.createQuery = function createQuery(sql, values, callback) {
- var Connection = loadClass('Connection');
+ // step 2: expand braces
+ var set = this.globSet = this.braceExpand()
- return Connection.createQuery(sql, values, callback);
-};
+ if (options.debug) this.debug = console.error
-/**
- * Escape a value for SQL.
- * @param {*} value The value to escape
- * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified
- * @param {string} [timeZone=local] Setting for time zone to use for Date conversion
- * @return {string} Escaped string value
- * @public
- */
-exports.escape = function escape(value, stringifyObjects, timeZone) {
- var SqlString = loadClass('SqlString');
+ this.debug(this.pattern, set)
- return SqlString.escape(value, stringifyObjects, timeZone);
-};
+ // step 3: now we have a set, so turn each one into a series of path-portion
+ // matching patterns.
+ // These will be regexps, except in the case of "**", which is
+ // set to the GLOBSTAR object for globstar behavior,
+ // and will not contain any / characters
+ set = this.globParts = set.map(function (s) {
+ return s.split(slashSplit)
+ })
-/**
- * Escape an identifier for SQL.
- * @param {*} value The value to escape
- * @param {boolean} [forbidQualified=false] Setting to treat '.' as part of identifier
- * @return {string} Escaped string value
- * @public
- */
-exports.escapeId = function escapeId(value, forbidQualified) {
- var SqlString = loadClass('SqlString');
+ this.debug(this.pattern, set)
- return SqlString.escapeId(value, forbidQualified);
-};
+ // glob --> regexps
+ set = set.map(function (s, si, set) {
+ return s.map(this.parse, this)
+ }, this)
-/**
- * Format SQL and replacement values into a SQL string.
- * @param {string} sql The SQL for the query
- * @param {array} [values] Any values to insert into placeholders in sql
- * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified
- * @param {string} [timeZone=local] Setting for time zone to use for Date conversion
- * @return {string} Formatted SQL string
- * @public
- */
-exports.format = function format(sql, values, stringifyObjects, timeZone) {
- var SqlString = loadClass('SqlString');
-
- return SqlString.format(sql, values, stringifyObjects, timeZone);
-};
+ this.debug(this.pattern, set)
-/**
- * Wrap raw SQL strings from escape overriding.
- * @param {string} sql The raw SQL
- * @return {object} Wrapped object
- * @public
- */
-exports.raw = function raw(sql) {
- var SqlString = loadClass('SqlString');
+ // filter out everything that didn't compile properly.
+ set = set.filter(function (s) {
+ return s.indexOf(false) === -1
+ })
- return SqlString.raw(sql);
-};
+ this.debug(this.pattern, set)
-/**
- * The type constants.
- * @public
- */
-Object.defineProperty(exports, "Types", ({
- get: loadClass.bind(null, 'Types')
-}));
+ this.set = set
+}
-/**
- * Load the given class.
- * @param {string} className Name of class to default
- * @return {function|object} Class constructor or exports
- * @private
- */
-function loadClass(className) {
- var Class = Classes[className];
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+ var pattern = this.pattern
+ var negate = false
+ var options = this.options
+ var negateOffset = 0
- if (Class !== undefined) {
- return Class;
- }
+ if (options.nonegate) return
- // This uses a switch for static require analysis
- switch (className) {
- case 'Connection':
- Class = __nccwpck_require__(76742);
- break;
- case 'ConnectionConfig':
- Class = __nccwpck_require__(35551);
- break;
- case 'Pool':
- Class = __nccwpck_require__(65942);
- break;
- case 'PoolCluster':
- Class = __nccwpck_require__(90678);
- break;
- case 'PoolConfig':
- Class = __nccwpck_require__(30002);
- break;
- case 'SqlString':
- Class = __nccwpck_require__(27522);
- break;
- case 'Types':
- Class = __nccwpck_require__(81699);
- break;
- default:
- throw new Error('Cannot find class \'' + className + '\'');
+ for (var i = 0, l = pattern.length
+ ; i < l && pattern.charAt(i) === '!'
+ ; i++) {
+ negate = !negate
+ negateOffset++
}
- // Store to prevent invoking require()
- Classes[className] = Class;
-
- return Class;
+ if (negateOffset) this.pattern = pattern.substr(negateOffset)
+ this.negate = negate
}
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+ return braceExpand(pattern, options)
+}
-/***/ }),
+Minimatch.prototype.braceExpand = braceExpand
-/***/ 76742:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+function braceExpand (pattern, options) {
+ if (!options) {
+ if (this instanceof Minimatch) {
+ options = this.options
+ } else {
+ options = {}
+ }
+ }
-var Crypto = __nccwpck_require__(76417);
-var Events = __nccwpck_require__(28614);
-var Net = __nccwpck_require__(11631);
-var tls = __nccwpck_require__(4016);
-var ConnectionConfig = __nccwpck_require__(35551);
-var Protocol = __nccwpck_require__(23714);
-var SqlString = __nccwpck_require__(27522);
-var Query = __nccwpck_require__(1352);
-var Util = __nccwpck_require__(31669);
+ pattern = typeof pattern === 'undefined'
+ ? this.pattern : pattern
-module.exports = Connection;
-Util.inherits(Connection, Events.EventEmitter);
-function Connection(options) {
- Events.EventEmitter.call(this);
+ if (typeof pattern === 'undefined') {
+ throw new TypeError('undefined pattern')
+ }
- this.config = options.config;
+ if (options.nobrace ||
+ !pattern.match(/\{.*\}/)) {
+ // shortcut. no need to expand.
+ return [pattern]
+ }
- this._socket = options.socket;
- this._protocol = new Protocol({config: this.config, connection: this});
- this._connectCalled = false;
- this.state = 'disconnected';
- this.threadId = null;
+ return expand(pattern)
}
-Connection.createQuery = function createQuery(sql, values, callback) {
- if (sql instanceof Query) {
- return sql;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion. Otherwise, any series
+// of * is equivalent to a single *. Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+ if (pattern.length > 1024 * 64) {
+ throw new TypeError('pattern is too long')
}
- var cb = callback;
- var options = {};
+ var options = this.options
- if (typeof sql === 'function') {
- cb = sql;
- } else if (typeof sql === 'object') {
- options = Object.create(sql);
+ // shortcuts
+ if (!options.noglobstar && pattern === '**') return GLOBSTAR
+ if (pattern === '') return ''
- if (typeof values === 'function') {
- cb = values;
- } else if (values !== undefined) {
- Object.defineProperty(options, 'values', { value: values });
- }
- } else {
- options.sql = sql;
+ var re = ''
+ var hasMagic = !!options.nocase
+ var escaping = false
+ // ? => one single character
+ var patternListStack = []
+ var negativeLists = []
+ var stateChar
+ var inClass = false
+ var reClassStart = -1
+ var classStart = -1
+ // . and .. never match anything that doesn't start with .,
+ // even when options.dot is set.
+ var patternStart = pattern.charAt(0) === '.' ? '' // anything
+ // not (start or / followed by . or .. followed by / or end)
+ : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
+ : '(?!\\.)'
+ var self = this
- if (typeof values === 'function') {
- cb = values;
- } else if (values !== undefined) {
- options.values = values;
+ function clearStateChar () {
+ if (stateChar) {
+ // we had some state-tracking character
+ // that wasn't consumed by this pass.
+ switch (stateChar) {
+ case '*':
+ re += star
+ hasMagic = true
+ break
+ case '?':
+ re += qmark
+ hasMagic = true
+ break
+ default:
+ re += '\\' + stateChar
+ break
+ }
+ self.debug('clearStateChar %j %j', stateChar, re)
+ stateChar = false
}
}
- if (cb !== undefined) {
- cb = wrapCallbackInDomain(null, cb);
+ for (var i = 0, len = pattern.length, c
+ ; (i < len) && (c = pattern.charAt(i))
+ ; i++) {
+ this.debug('%s\t%s %s %j', pattern, i, re, c)
- if (cb === undefined) {
- throw new TypeError('argument callback must be a function when provided');
+ // skip over any that are escaped.
+ if (escaping && reSpecials[c]) {
+ re += '\\' + c
+ escaping = false
+ continue
}
- }
- return new Query(options, cb);
-};
+ switch (c) {
+ case '/':
+ // completely not allowed, even escaped.
+ // Should already be path-split by now.
+ return false
-Connection.prototype.connect = function connect(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
+ case '\\':
+ clearStateChar()
+ escaping = true
+ continue
- if (!this._connectCalled) {
- this._connectCalled = true;
+ // the various stateChar values
+ // for the "extglob" stuff.
+ case '?':
+ case '*':
+ case '+':
+ case '@':
+ case '!':
+ this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
- // Connect either via a UNIX domain socket or a TCP socket.
- this._socket = (this.config.socketPath)
- ? Net.createConnection(this.config.socketPath)
- : Net.createConnection(this.config.port, this.config.host);
+ // all of those are literals inside a class, except that
+ // the glob [!a] means [^a] in regexp
+ if (inClass) {
+ this.debug(' in class')
+ if (c === '!' && i === classStart + 1) c = '^'
+ re += c
+ continue
+ }
- // Connect socket to connection domain
- if (Events.usingDomains) {
- this._socket.domain = this.domain;
- }
+ // if we already have a stateChar, then it means
+ // that there was something like ** or +? in there.
+ // Handle the stateChar, then proceed with this one.
+ self.debug('call clearStateChar %j', stateChar)
+ clearStateChar()
+ stateChar = c
+ // if extglob is disabled, then +(asdf|foo) isn't a thing.
+ // just clear the statechar *now*, rather than even diving into
+ // the patternList stuff.
+ if (options.noext) clearStateChar()
+ continue
- var connection = this;
- this._protocol.on('data', function(data) {
- connection._socket.write(data);
- });
- this._socket.on('data', wrapToDomain(connection, function (data) {
- connection._protocol.write(data);
- }));
- this._protocol.on('end', function() {
- connection._socket.end();
- });
- this._socket.on('end', wrapToDomain(connection, function () {
- connection._protocol.end();
- }));
+ case '(':
+ if (inClass) {
+ re += '('
+ continue
+ }
- this._socket.on('error', this._handleNetworkError.bind(this));
- this._socket.on('connect', this._handleProtocolConnect.bind(this));
- this._protocol.on('handshake', this._handleProtocolHandshake.bind(this));
- this._protocol.on('initialize', this._handleProtocolInitialize.bind(this));
- this._protocol.on('unhandledError', this._handleProtocolError.bind(this));
- this._protocol.on('drain', this._handleProtocolDrain.bind(this));
- this._protocol.on('end', this._handleProtocolEnd.bind(this));
- this._protocol.on('enqueue', this._handleProtocolEnqueue.bind(this));
+ if (!stateChar) {
+ re += '\\('
+ continue
+ }
- if (this.config.connectTimeout) {
- var handleConnectTimeout = this._handleConnectTimeout.bind(this);
+ patternListStack.push({
+ type: stateChar,
+ start: i - 1,
+ reStart: re.length,
+ open: plTypes[stateChar].open,
+ close: plTypes[stateChar].close
+ })
+ // negation is (?:(?!js)[^/]*)
+ re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
+ this.debug('plType %j %j', stateChar, re)
+ stateChar = false
+ continue
- this._socket.setTimeout(this.config.connectTimeout, handleConnectTimeout);
- this._socket.once('connect', function() {
- this.setTimeout(0, handleConnectTimeout);
- });
- }
- }
+ case ')':
+ if (inClass || !patternListStack.length) {
+ re += '\\)'
+ continue
+ }
- this._protocol.handshake(options, wrapCallbackInDomain(this, callback));
-};
+ clearStateChar()
+ hasMagic = true
+ var pl = patternListStack.pop()
+ // negation is (?:(?!js)[^/]*)
+ // The others are (?:)
+ re += pl.close
+ if (pl.type === '!') {
+ negativeLists.push(pl)
+ }
+ pl.reEnd = re.length
+ continue
-Connection.prototype.changeUser = function changeUser(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
+ case '|':
+ if (inClass || !patternListStack.length || escaping) {
+ re += '\\|'
+ escaping = false
+ continue
+ }
- this._implyConnect();
+ clearStateChar()
+ re += '|'
+ continue
- var charsetNumber = (options.charset)
- ? ConnectionConfig.getCharsetNumber(options.charset)
- : this.config.charsetNumber;
+ // these are mostly the same in regexp and glob
+ case '[':
+ // swallow any state-tracking char before the [
+ clearStateChar()
- return this._protocol.changeUser({
- user : options.user || this.config.user,
- password : options.password || this.config.password,
- database : options.database || this.config.database,
- timeout : options.timeout,
- charsetNumber : charsetNumber,
- currentConfig : this.config
- }, wrapCallbackInDomain(this, callback));
-};
+ if (inClass) {
+ re += '\\' + c
+ continue
+ }
-Connection.prototype.beginTransaction = function beginTransaction(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
+ inClass = true
+ classStart = i
+ reClassStart = re.length
+ re += c
+ continue
- options = options || {};
- options.sql = 'START TRANSACTION';
- options.values = null;
+ case ']':
+ // a right bracket shall lose its special
+ // meaning and represent itself in
+ // a bracket expression if it occurs
+ // first in the list. -- POSIX.2 2.8.3.2
+ if (i === classStart + 1 || !inClass) {
+ re += '\\' + c
+ escaping = false
+ continue
+ }
- return this.query(options, callback);
-};
+ // handle the case where we left a class open.
+ // "[z-a]" is valid, equivalent to "\[z-a\]"
+ if (inClass) {
+ // split where the last [ was, make sure we don't have
+ // an invalid re. if so, re-walk the contents of the
+ // would-be class to re-translate any characters that
+ // were passed through as-is
+ // TODO: It would probably be faster to determine this
+ // without a try/catch and a new RegExp, but it's tricky
+ // to do safely. For now, this is safe and works.
+ var cs = pattern.substring(classStart + 1, i)
+ try {
+ RegExp('[' + cs + ']')
+ } catch (er) {
+ // not a valid class!
+ var sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
+ hasMagic = hasMagic || sp[1]
+ inClass = false
+ continue
+ }
+ }
-Connection.prototype.commit = function commit(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
+ // finish up the class.
+ hasMagic = true
+ inClass = false
+ re += c
+ continue
- options = options || {};
- options.sql = 'COMMIT';
- options.values = null;
+ default:
+ // swallow any state char that wasn't consumed
+ clearStateChar()
- return this.query(options, callback);
-};
+ if (escaping) {
+ // no need
+ escaping = false
+ } else if (reSpecials[c]
+ && !(c === '^' && inClass)) {
+ re += '\\'
+ }
-Connection.prototype.rollback = function rollback(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
+ re += c
+
+ } // switch
+ } // for
+
+ // handle the case where we left a class open.
+ // "[abc" is valid, equivalent to "\[abc"
+ if (inClass) {
+ // split where the last [ was, and escape it
+ // this is a huge pita. We now have to re-walk
+ // the contents of the would-be class to re-translate
+ // any characters that were passed through as-is
+ cs = pattern.substr(classStart + 1)
+ sp = this.parse(cs, SUBPARSE)
+ re = re.substr(0, reClassStart) + '\\[' + sp[0]
+ hasMagic = hasMagic || sp[1]
}
- options = options || {};
- options.sql = 'ROLLBACK';
- options.values = null;
+ // handle the case where we had a +( thing at the *end*
+ // of the pattern.
+ // each pattern list stack adds 3 chars, and we need to go through
+ // and escape any | chars that were passed through as-is for the regexp.
+ // Go through and escape them, taking care not to double-escape any
+ // | chars that were already escaped.
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
+ var tail = re.slice(pl.reStart + pl.open.length)
+ this.debug('setting tail', re, pl)
+ // maybe some even number of \, then maybe 1 \, followed by a |
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
+ if (!$2) {
+ // the | isn't already escaped, so escape it.
+ $2 = '\\'
+ }
- return this.query(options, callback);
-};
+ // need to escape all those slashes *again*, without escaping the
+ // one that we need for escaping the | character. As it works out,
+ // escaping an even number of slashes can be done by simply repeating
+ // it exactly after itself. That's why this trick works.
+ //
+ // I am sorry that you have to see this.
+ return $1 + $1 + $2 + '|'
+ })
-Connection.prototype.query = function query(sql, values, cb) {
- var query = Connection.createQuery(sql, values, cb);
- query._connection = this;
+ this.debug('tail=%j\n %s', tail, tail, pl, re)
+ var t = pl.type === '*' ? star
+ : pl.type === '?' ? qmark
+ : '\\' + pl.type
- if (!(typeof sql === 'object' && 'typeCast' in sql)) {
- query.typeCast = this.config.typeCast;
+ hasMagic = true
+ re = re.slice(0, pl.reStart) + t + '\\(' + tail
}
- if (query.sql) {
- query.sql = this.format(query.sql, query.values);
+ // handle trailing things that only matter at the very end.
+ clearStateChar()
+ if (escaping) {
+ // trailing \\
+ re += '\\\\'
}
- if (query._callback) {
- query._callback = wrapCallbackInDomain(this, query._callback);
+ // only need to apply the nodot start if the re starts with
+ // something that could conceivably capture a dot
+ var addPatternStart = false
+ switch (re.charAt(0)) {
+ case '.':
+ case '[':
+ case '(': addPatternStart = true
}
- this._implyConnect();
+ // Hack to work around lack of negative lookbehind in JS
+ // A pattern like: *.!(x).!(y|z) needs to ensure that a name
+ // like 'a.xyz.yz' doesn't match. So, the first negative
+ // lookahead, has to look ALL the way ahead, to the end of
+ // the pattern.
+ for (var n = negativeLists.length - 1; n > -1; n--) {
+ var nl = negativeLists[n]
- return this._protocol._enqueue(query);
-};
+ var nlBefore = re.slice(0, nl.reStart)
+ var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
+ var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
+ var nlAfter = re.slice(nl.reEnd)
-Connection.prototype.ping = function ping(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
+ nlLast += nlAfter
- this._implyConnect();
- this._protocol.ping(options, wrapCallbackInDomain(this, callback));
-};
+ // Handle nested stuff like *(*.js|!(*.json)), where open parens
+ // mean that we should *not* include the ) in the bit that is considered
+ // "after" the negated section.
+ var openParensBefore = nlBefore.split('(').length - 1
+ var cleanAfter = nlAfter
+ for (i = 0; i < openParensBefore; i++) {
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
+ }
+ nlAfter = cleanAfter
-Connection.prototype.statistics = function statistics(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
+ var dollar = ''
+ if (nlAfter === '' && isSub !== SUBPARSE) {
+ dollar = '$'
+ }
+ var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
+ re = newRe
}
- this._implyConnect();
- this._protocol.stats(options, wrapCallbackInDomain(this, callback));
-};
-
-Connection.prototype.end = function end(options, callback) {
- var cb = callback;
- var opts = options;
+ // if the re is not "" at this point, then we need to make sure
+ // it doesn't match against an empty path part.
+ // Otherwise a/* will match a/, which it should not.
+ if (re !== '' && hasMagic) {
+ re = '(?=.)' + re
+ }
- if (!callback && typeof options === 'function') {
- cb = options;
- opts = null;
+ if (addPatternStart) {
+ re = patternStart + re
}
- // create custom options reference
- opts = Object.create(opts || null);
+ // parsing just a piece of a larger pattern.
+ if (isSub === SUBPARSE) {
+ return [re, hasMagic]
+ }
- if (opts.timeout === undefined) {
- // default timeout of 30 seconds
- opts.timeout = 30000;
+ // skip the regexp for non-magical patterns
+ // unescape anything in it, though, so that it'll be
+ // an exact match against a file etc.
+ if (!hasMagic) {
+ return globUnescape(pattern)
}
- this._implyConnect();
- this._protocol.quit(opts, wrapCallbackInDomain(this, cb));
-};
+ var flags = options.nocase ? 'i' : ''
+ try {
+ var regExp = new RegExp('^' + re + '$', flags)
+ } catch (er) {
+ // If it was an invalid regular expression, then it can't match
+ // anything. This trick looks for a character after the end of
+ // the string, which is of course impossible, except in multi-line
+ // mode, but it's not a /m regex.
+ return new RegExp('$.')
+ }
-Connection.prototype.destroy = function() {
- this.state = 'disconnected';
- this._implyConnect();
- this._socket.destroy();
- this._protocol.destroy();
-};
+ regExp._glob = pattern
+ regExp._src = re
-Connection.prototype.pause = function() {
- this._socket.pause();
- this._protocol.pause();
-};
+ return regExp
+}
-Connection.prototype.resume = function() {
- this._socket.resume();
- this._protocol.resume();
-};
+minimatch.makeRe = function (pattern, options) {
+ return new Minimatch(pattern, options || {}).makeRe()
+}
-Connection.prototype.escape = function(value) {
- return SqlString.escape(value, false, this.config.timezone);
-};
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+ if (this.regexp || this.regexp === false) return this.regexp
-Connection.prototype.escapeId = function escapeId(value) {
- return SqlString.escapeId(value, false);
-};
+ // at this point, this.set is a 2d array of partial
+ // pattern strings, or "**".
+ //
+ // It's better to use .match(). This function shouldn't
+ // be used, really, but it's pretty convenient sometimes,
+ // when you just want to work with a regex.
+ var set = this.set
-Connection.prototype.format = function(sql, values) {
- if (typeof this.config.queryFormat === 'function') {
- return this.config.queryFormat.call(this, sql, values, this.config.timezone);
+ if (!set.length) {
+ this.regexp = false
+ return this.regexp
}
- return SqlString.format(sql, values, this.config.stringifyObjects, this.config.timezone);
-};
-
-if (tls.TLSSocket) {
- // 0.11+ environment
- Connection.prototype._startTLS = function _startTLS(onSecure) {
- var connection = this;
-
- createSecureContext(this.config, function (err, secureContext) {
- if (err) {
- onSecure(err);
- return;
- }
-
- // "unpipe"
- connection._socket.removeAllListeners('data');
- connection._protocol.removeAllListeners('data');
+ var options = this.options
- // socket <-> encrypted
- var rejectUnauthorized = connection.config.ssl.rejectUnauthorized;
- var secureEstablished = false;
- var secureSocket = new tls.TLSSocket(connection._socket, {
- rejectUnauthorized : rejectUnauthorized,
- requestCert : true,
- secureContext : secureContext,
- isServer : false
- });
+ var twoStar = options.noglobstar ? star
+ : options.dot ? twoStarDot
+ : twoStarNoDot
+ var flags = options.nocase ? 'i' : ''
- // error handler for secure socket
- secureSocket.on('_tlsError', function(err) {
- if (secureEstablished) {
- connection._handleNetworkError(err);
- } else {
- onSecure(err);
- }
- });
+ var re = set.map(function (pattern) {
+ return pattern.map(function (p) {
+ return (p === GLOBSTAR) ? twoStar
+ : (typeof p === 'string') ? regExpEscape(p)
+ : p._src
+ }).join('\\\/')
+ }).join('|')
- // cleartext <-> protocol
- secureSocket.pipe(connection._protocol);
- connection._protocol.on('data', function(data) {
- secureSocket.write(data);
- });
+ // must match entire pattern
+ // ending in a * or ** will make it less strict.
+ re = '^(?:' + re + ')$'
- secureSocket.on('secure', function() {
- secureEstablished = true;
+ // can match anything, as long as it's not this.
+ if (this.negate) re = '^(?!' + re + ').*$'
- onSecure(rejectUnauthorized ? this.ssl.verifyError() : null);
- });
+ try {
+ this.regexp = new RegExp(re, flags)
+ } catch (ex) {
+ this.regexp = false
+ }
+ return this.regexp
+}
- // start TLS communications
- secureSocket._start();
- });
- };
-} else {
- // pre-0.11 environment
- Connection.prototype._startTLS = function _startTLS(onSecure) {
- // before TLS:
- // _socket <-> _protocol
- // after:
- // _socket <-> securePair.encrypted <-> securePair.cleartext <-> _protocol
+minimatch.match = function (list, pattern, options) {
+ options = options || {}
+ var mm = new Minimatch(pattern, options)
+ list = list.filter(function (f) {
+ return mm.match(f)
+ })
+ if (mm.options.nonull && !list.length) {
+ list.push(pattern)
+ }
+ return list
+}
- var connection = this;
- var credentials = Crypto.createCredentials({
- ca : this.config.ssl.ca,
- cert : this.config.ssl.cert,
- ciphers : this.config.ssl.ciphers,
- key : this.config.ssl.key,
- passphrase : this.config.ssl.passphrase
- });
+Minimatch.prototype.match = match
+function match (f, partial) {
+ this.debug('match', f, this.pattern)
+ // short-circuit in the case of busted things.
+ // comments, etc.
+ if (this.comment) return false
+ if (this.empty) return f === ''
- var rejectUnauthorized = this.config.ssl.rejectUnauthorized;
- var secureEstablished = false;
- var securePair = tls.createSecurePair(credentials, false, true, rejectUnauthorized);
+ if (f === '/' && partial) return true
- // error handler for secure pair
- securePair.on('error', function(err) {
- if (secureEstablished) {
- connection._handleNetworkError(err);
- } else {
- onSecure(err);
- }
- });
+ var options = this.options
- // "unpipe"
- this._socket.removeAllListeners('data');
- this._protocol.removeAllListeners('data');
+ // windows: need to use /, not \
+ if (path.sep !== '/') {
+ f = f.split(path.sep).join('/')
+ }
- // socket <-> encrypted
- securePair.encrypted.pipe(this._socket);
- this._socket.on('data', function(data) {
- securePair.encrypted.write(data);
- });
+ // treat the test path as a set of pathparts.
+ f = f.split(slashSplit)
+ this.debug(this.pattern, 'split', f)
- // cleartext <-> protocol
- securePair.cleartext.pipe(this._protocol);
- this._protocol.on('data', function(data) {
- securePair.cleartext.write(data);
- });
+ // just ONE of the pattern sets in this.set needs to match
+ // in order for it to be valid. If negating, then just one
+ // match means that we have failed.
+ // Either way, return on the first hit.
- // secure established
- securePair.on('secure', function() {
- secureEstablished = true;
+ var set = this.set
+ this.debug(this.pattern, 'set', set)
- if (!rejectUnauthorized) {
- onSecure();
- return;
- }
+ // Find the basename of the path by looking for the last non-empty segment
+ var filename
+ var i
+ for (i = f.length - 1; i >= 0; i--) {
+ filename = f[i]
+ if (filename) break
+ }
- var verifyError = this.ssl.verifyError();
- var err = verifyError;
+ for (i = 0; i < set.length; i++) {
+ var pattern = set[i]
+ var file = f
+ if (options.matchBase && pattern.length === 1) {
+ file = [filename]
+ }
+ var hit = this.matchOne(file, pattern, partial)
+ if (hit) {
+ if (options.flipNegate) return true
+ return !this.negate
+ }
+ }
- // node.js 0.6 support
- if (typeof err === 'string') {
- err = new Error(verifyError);
- err.code = verifyError;
- }
+ // didn't get any hits. this is success if it's a negative
+ // pattern, failure otherwise.
+ if (options.flipNegate) return false
+ return this.negate
+}
- onSecure(err);
- });
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+ var options = this.options
- // node.js 0.8 bug
- securePair._cycle = securePair.cycle;
- securePair.cycle = function cycle() {
- if (this.ssl && this.ssl.error) {
- this.error();
- }
+ this.debug('matchOne',
+ { 'this': this, file: file, pattern: pattern })
- return this._cycle.apply(this, arguments);
- };
- };
-}
+ this.debug('matchOne', file.length, pattern.length)
-Connection.prototype._handleConnectTimeout = function() {
- if (this._socket) {
- this._socket.setTimeout(0);
- this._socket.destroy();
- }
+ for (var fi = 0,
+ pi = 0,
+ fl = file.length,
+ pl = pattern.length
+ ; (fi < fl) && (pi < pl)
+ ; fi++, pi++) {
+ this.debug('matchOne loop')
+ var p = pattern[pi]
+ var f = file[fi]
- var err = new Error('connect ETIMEDOUT');
- err.errorno = 'ETIMEDOUT';
- err.code = 'ETIMEDOUT';
- err.syscall = 'connect';
+ this.debug(pattern, p, f)
- this._handleNetworkError(err);
-};
+ // should be impossible.
+ // some invalid regexp stuff in the set.
+ if (p === false) return false
-Connection.prototype._handleNetworkError = function(err) {
- this._protocol.handleNetworkError(err);
-};
+ if (p === GLOBSTAR) {
+ this.debug('GLOBSTAR', [pattern, p, f])
-Connection.prototype._handleProtocolError = function(err) {
- this.state = 'protocol_error';
- this.emit('error', err);
-};
+ // "**"
+ // a/**/b/**/c would match the following:
+ // a/b/x/y/z/c
+ // a/x/y/z/b/c
+ // a/b/x/b/x/c
+ // a/b/c
+ // To do this, take the rest of the pattern after
+ // the **, and see if it would match the file remainder.
+ // If so, return success.
+ // If not, the ** "swallows" a segment, and try again.
+ // This is recursively awful.
+ //
+ // a/**/b/**/c matching a/b/x/y/z/c
+ // - a matches a
+ // - doublestar
+ // - matchOne(b/x/y/z/c, b/**/c)
+ // - b matches b
+ // - doublestar
+ // - matchOne(x/y/z/c, c) -> no
+ // - matchOne(y/z/c, c) -> no
+ // - matchOne(z/c, c) -> no
+ // - matchOne(c, c) yes, hit
+ var fr = fi
+ var pr = pi + 1
+ if (pr === pl) {
+ this.debug('** at the end')
+ // a ** at the end will just swallow the rest.
+ // We have found a match.
+ // however, it will not swallow /.x, unless
+ // options.dot is set.
+ // . and .. are *never* matched by **, for explosively
+ // exponential reasons.
+ for (; fi < fl; fi++) {
+ if (file[fi] === '.' || file[fi] === '..' ||
+ (!options.dot && file[fi].charAt(0) === '.')) return false
+ }
+ return true
+ }
-Connection.prototype._handleProtocolDrain = function() {
- this.emit('drain');
-};
+ // ok, let's see if we can swallow whatever we can.
+ while (fr < fl) {
+ var swallowee = file[fr]
-Connection.prototype._handleProtocolConnect = function() {
- this.state = 'connected';
- this.emit('connect');
-};
+ this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
-Connection.prototype._handleProtocolHandshake = function _handleProtocolHandshake() {
- this.state = 'authenticated';
-};
+ // XXX remove this slice. Just pass the start index.
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+ this.debug('globstar found match!', fr, fl, swallowee)
+ // found a match.
+ return true
+ } else {
+ // can't swallow "." or ".." ever.
+ // can only swallow ".foo" when explicitly asked.
+ if (swallowee === '.' || swallowee === '..' ||
+ (!options.dot && swallowee.charAt(0) === '.')) {
+ this.debug('dot detected!', file, fr, pattern, pr)
+ break
+ }
-Connection.prototype._handleProtocolInitialize = function _handleProtocolInitialize(packet) {
- this.threadId = packet.threadId;
-};
+ // ** swallows a segment, and continue.
+ this.debug('globstar swallow a segment, and continue')
+ fr++
+ }
+ }
-Connection.prototype._handleProtocolEnd = function(err) {
- this.state = 'disconnected';
- this.emit('end', err);
-};
+ // no match was found.
+ // However, in partial mode, we can't say this is necessarily over.
+ // If there's more *pattern* left, then
+ if (partial) {
+ // ran out of file
+ this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
+ if (fr === fl) return true
+ }
+ return false
+ }
-Connection.prototype._handleProtocolEnqueue = function _handleProtocolEnqueue(sequence) {
- this.emit('enqueue', sequence);
-};
+ // something other than **
+ // non-magic patterns just have to match exactly
+ // patterns with magic have been turned into regexps.
+ var hit
+ if (typeof p === 'string') {
+ if (options.nocase) {
+ hit = f.toLowerCase() === p.toLowerCase()
+ } else {
+ hit = f === p
+ }
+ this.debug('string match', p, f, hit)
+ } else {
+ hit = f.match(p)
+ this.debug('pattern match', p, f, hit)
+ }
-Connection.prototype._implyConnect = function() {
- if (!this._connectCalled) {
- this.connect();
+ if (!hit) return false
}
-};
-
-function createSecureContext (config, cb) {
- var context = null;
- var error = null;
- try {
- context = tls.createSecureContext({
- ca : config.ssl.ca,
- cert : config.ssl.cert,
- ciphers : config.ssl.ciphers,
- key : config.ssl.key,
- passphrase : config.ssl.passphrase
- });
- } catch (err) {
- error = err;
- }
-
- cb(error, context);
-}
-
-function unwrapFromDomain(fn) {
- return function () {
- var domains = [];
- var ret;
-
- while (process.domain) {
- domains.shift(process.domain);
- process.domain.exit();
- }
-
- try {
- ret = fn.apply(this, arguments);
- } finally {
- for (var i = 0; i < domains.length; i++) {
- domains[i].enter();
- }
- }
-
- return ret;
- };
-}
-
-function wrapCallbackInDomain(ee, fn) {
- if (typeof fn !== 'function') {
- return undefined;
- }
+ // Note: ending in / means that we'll get a final ""
+ // at the end of the pattern. This can only match a
+ // corresponding "" at the end of the file.
+ // If the file ends in /, then it can only match a
+ // a pattern that ends in /, unless the pattern just
+ // doesn't have any more for it. But, a/b/ should *not*
+ // match "a/b/*", even though "" matches against the
+ // [^/]*? pattern, except in partial mode, where it might
+ // simply not be reached yet.
+ // However, a/b/ should still satisfy a/*
- if (fn.domain) {
- return fn;
+ // now either we fell off the end of the pattern, or we're done.
+ if (fi === fl && pi === pl) {
+ // ran out of pattern and filename at the same time.
+ // an exact hit!
+ return true
+ } else if (fi === fl) {
+ // ran out of file, but still had pattern left.
+ // this is ok if we're doing the match as part of
+ // a glob fs traversal.
+ return partial
+ } else if (pi === pl) {
+ // ran out of pattern, still have file left.
+ // this is only acceptable if we're on the very last
+ // empty segment of a file with a trailing slash.
+ // a/* should match a/b/
+ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
+ return emptyFileEnd
}
- var domain = process.domain;
+ // should be unreachable.
+ throw new Error('wtf?')
+}
- if (domain) {
- return domain.bind(fn);
- } else if (ee) {
- return unwrapFromDomain(wrapToDomain(ee, fn));
- } else {
- return fn;
- }
+// replace stuff like \* with *
+function globUnescape (s) {
+ return s.replace(/\\(.)/g, '$1')
}
-function wrapToDomain(ee, fn) {
- return function () {
- if (Events.usingDomains && ee.domain) {
- ee.domain.enter();
- fn.apply(this, arguments);
- ee.domain.exit();
- } else {
- fn.apply(this, arguments);
- }
- };
+function regExpEscape (s) {
+ return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
}
/***/ }),
-/***/ 35551:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var urlParse = __nccwpck_require__(78835).parse;
-var ClientConstants = __nccwpck_require__(5427);
-var Charsets = __nccwpck_require__(30124);
-var SSLProfiles = null;
+/***/ 80900:
+/***/ ((module) => {
-module.exports = ConnectionConfig;
-function ConnectionConfig(options) {
- if (typeof options === 'string') {
- options = ConnectionConfig.parseUrl(options);
- }
+/**
+ * Helpers.
+ */
- this.host = options.host || 'localhost';
- this.port = options.port || 3306;
- this.localAddress = options.localAddress;
- this.socketPath = options.socketPath;
- this.user = options.user || undefined;
- this.password = options.password || undefined;
- this.database = options.database;
- this.connectTimeout = (options.connectTimeout === undefined)
- ? (10 * 1000)
- : options.connectTimeout;
- this.insecureAuth = options.insecureAuth || false;
- this.supportBigNumbers = options.supportBigNumbers || false;
- this.bigNumberStrings = options.bigNumberStrings || false;
- this.dateStrings = options.dateStrings || false;
- this.debug = options.debug;
- this.trace = options.trace !== false;
- this.stringifyObjects = options.stringifyObjects || false;
- this.timezone = options.timezone || 'local';
- this.flags = options.flags || '';
- this.queryFormat = options.queryFormat;
- this.pool = options.pool || undefined;
- this.ssl = (typeof options.ssl === 'string')
- ? ConnectionConfig.getSSLProfile(options.ssl)
- : (options.ssl || false);
- this.localInfile = (options.localInfile === undefined)
- ? true
- : options.localInfile;
- this.multipleStatements = options.multipleStatements || false;
- this.typeCast = (options.typeCast === undefined)
- ? true
- : options.typeCast;
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
- if (this.timezone[0] === ' ') {
- // "+" is a url encoded char for space so it
- // gets translated to space when giving a
- // connection string..
- this.timezone = '+' + this.timezone.substr(1);
- }
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
- if (this.ssl) {
- // Default rejectUnauthorized to true
- this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false;
+module.exports = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isFinite(val)) {
+ return options.long ? fmtLong(val) : fmtShort(val);
}
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
- this.maxPacketSize = 0;
- this.charsetNumber = (options.charset)
- ? ConnectionConfig.getCharsetNumber(options.charset)
- : options.charsetNumber || Charsets.UTF8_GENERAL_CI;
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
- // Set the client flags
- var defaultFlags = ConnectionConfig.getDefaultFlags(options);
- this.clientFlags = ConnectionConfig.mergeFlags(defaultFlags, options.flags);
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'weeks':
+ case 'week':
+ case 'w':
+ return n * w;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
}
-ConnectionConfig.mergeFlags = function mergeFlags(defaultFlags, userFlags) {
- var allFlags = ConnectionConfig.parseFlagList(defaultFlags);
- var newFlags = ConnectionConfig.parseFlagList(userFlags);
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
- // Merge the new flags
- for (var flag in newFlags) {
- if (allFlags[flag] !== false) {
- allFlags[flag] = newFlags[flag];
- }
+function fmtShort(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return Math.round(ms / d) + 'd';
}
-
- // Build flags
- var flags = 0x0;
- for (var flag in allFlags) {
- if (allFlags[flag]) {
- // TODO: Throw here on some future release
- flags |= ClientConstants['CLIENT_' + flag] || 0x0;
- }
+ if (msAbs >= h) {
+ return Math.round(ms / h) + 'h';
}
-
- return flags;
-};
-
-ConnectionConfig.getCharsetNumber = function getCharsetNumber(charset) {
- var num = Charsets[charset.toUpperCase()];
-
- if (num === undefined) {
- throw new TypeError('Unknown charset \'' + charset + '\'');
+ if (msAbs >= m) {
+ return Math.round(ms / m) + 'm';
}
+ if (msAbs >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
- return num;
-};
-
-ConnectionConfig.getDefaultFlags = function getDefaultFlags(options) {
- var defaultFlags = [
- '-COMPRESS', // Compression protocol *NOT* supported
- '-CONNECT_ATTRS', // Does *NOT* send connection attributes in Protocol::HandshakeResponse41
- '+CONNECT_WITH_DB', // One can specify db on connect in Handshake Response Packet
- '+FOUND_ROWS', // Send found rows instead of affected rows
- '+IGNORE_SIGPIPE', // Don't issue SIGPIPE if network failures
- '+IGNORE_SPACE', // Let the parser ignore spaces before '('
- '+LOCAL_FILES', // Can use LOAD DATA LOCAL
- '+LONG_FLAG', // Longer flags in Protocol::ColumnDefinition320
- '+LONG_PASSWORD', // Use the improved version of Old Password Authentication
- '+MULTI_RESULTS', // Can handle multiple resultsets for COM_QUERY
- '+ODBC', // Special handling of ODBC behaviour
- '-PLUGIN_AUTH', // Does *NOT* support auth plugins
- '+PROTOCOL_41', // Uses the 4.1 protocol
- '+PS_MULTI_RESULTS', // Can handle multiple resultsets for COM_STMT_EXECUTE
- '+RESERVED', // Unused
- '+SECURE_CONNECTION', // Supports Authentication::Native41
- '+TRANSACTIONS' // Expects status flags
- ];
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
- if (options && options.localInfile !== undefined && !options.localInfile) {
- // Disable LOCAL modifier for LOAD DATA INFILE
- defaultFlags.push('-LOCAL_FILES');
+function fmtLong(ms) {
+ var msAbs = Math.abs(ms);
+ if (msAbs >= d) {
+ return plural(ms, msAbs, d, 'day');
}
-
- if (options && options.multipleStatements) {
- // May send multiple statements per COM_QUERY and COM_STMT_PREPARE
- defaultFlags.push('+MULTI_STATEMENTS');
+ if (msAbs >= h) {
+ return plural(ms, msAbs, h, 'hour');
}
-
- return defaultFlags;
-};
-
-ConnectionConfig.getSSLProfile = function getSSLProfile(name) {
- if (!SSLProfiles) {
- SSLProfiles = __nccwpck_require__(3061);
+ if (msAbs >= m) {
+ return plural(ms, msAbs, m, 'minute');
}
-
- var ssl = SSLProfiles[name];
-
- if (ssl === undefined) {
- throw new TypeError('Unknown SSL profile \'' + name + '\'');
+ if (msAbs >= s) {
+ return plural(ms, msAbs, s, 'second');
}
+ return ms + ' ms';
+}
- return ssl;
-};
-
-ConnectionConfig.parseFlagList = function parseFlagList(flagList) {
- var allFlags = Object.create(null);
-
- if (!flagList) {
- return allFlags;
- }
+/**
+ * Pluralization helper.
+ */
- var flags = !Array.isArray(flagList)
- ? String(flagList || '').toUpperCase().split(/\s*,+\s*/)
- : flagList;
+function plural(ms, msAbs, n, name) {
+ var isPlural = msAbs >= n * 1.5;
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
- for (var i = 0; i < flags.length; i++) {
- var flag = flags[i];
- var offset = 1;
- var state = flag[0];
- if (state === undefined) {
- // TODO: throw here on some future release
- continue;
- }
+/***/ }),
- if (state !== '-' && state !== '+') {
- offset = 0;
- state = '+';
- }
+/***/ 25018:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- allFlags[flag.substr(offset)] = state === '+';
- }
+module.exports = __nccwpck_require__(37197)
- return allFlags;
-};
-ConnectionConfig.parseUrl = function(url) {
- url = urlParse(url, true);
+/***/ }),
- var options = {
- host : url.hostname,
- port : url.port,
- database : url.pathname.substr(1)
- };
+/***/ 85558:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (url.auth) {
- var auth = url.auth.split(':');
- options.user = auth.shift();
- options.password = auth.join(':');
- }
+"use strict";
- if (url.query) {
- for (var key in url.query) {
- var value = url.query[key];
- try {
- // Try to parse this as a JSON expression first
- options[key] = JSON.parse(value);
- } catch (err) {
- // Otherwise assume it is a plain string
- options[key] = value;
- }
- }
- }
+const { EventEmitter } = __nccwpck_require__(28614)
+const debug = __nccwpck_require__(38237)('mssql:base')
+const tarn = __nccwpck_require__(61616)
+const { IDS } = __nccwpck_require__(14178)
+const ConnectionString = __nccwpck_require__(33560)
+const ConnectionError = __nccwpck_require__(86485)
+const shared = __nccwpck_require__(67636)
- return options;
-};
+/**
+ * Class ConnectionPool.
+ *
+ * Internally, each `Connection` instance is a separate pool of TDS connections. Once you create a new `Request`/`Transaction`/`Prepared Statement`, a new TDS connection is acquired from the pool and reserved for desired action. Once the action is complete, connection is released back to the pool.
+ *
+ * @property {Boolean} connected If true, connection is established.
+ * @property {Boolean} connecting If true, connection is being established.
+ *
+ * @fires ConnectionPool#connect
+ * @fires ConnectionPool#close
+ */
+class ConnectionPool extends EventEmitter {
+ /**
+ * Create new Connection.
+ *
+ * @param {Object|String} config Connection configuration object or connection string.
+ * @param {basicCallback} [callback] A callback which is called after connection has established, or an error has occurred.
+ */
-/***/ }),
+ constructor (config, callback) {
+ super()
-/***/ 65942:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ IDS.add(this, 'ConnectionPool')
+ debug('pool(%d): created', IDS.get(this))
-var mysql = __nccwpck_require__(73667);
-var Connection = __nccwpck_require__(76742);
-var EventEmitter = __nccwpck_require__(28614).EventEmitter;
-var Util = __nccwpck_require__(31669);
-var PoolConnection = __nccwpck_require__(10378);
+ this._connectStack = []
+ this._closeStack = []
-module.exports = Pool;
+ this._connected = false
+ this._connecting = false
+ this._healthy = false
-Util.inherits(Pool, EventEmitter);
-function Pool(options) {
- EventEmitter.call(this);
- this.config = options.config;
- this.config.connectionConfig.pool = this;
+ if (typeof config === 'string') {
+ try {
+ this.config = ConnectionString.resolve(config, shared.driver.name)
+ } catch (ex) {
+ if (typeof callback === 'function') {
+ return setImmediate(callback, ex)
+ }
+ throw ex
+ }
+ } else {
+ this.config = Object.assign({}, config)
+ }
- this._acquiringConnections = [];
- this._allConnections = [];
- this._freeConnections = [];
- this._connectionQueue = [];
- this._closed = false;
-}
+ // set defaults
+ this.config.port = this.config.port || 1433
+ this.config.options = this.config.options || {}
+ this.config.stream = this.config.stream || false
+ this.config.parseJSON = this.config.parseJSON || false
+ this.config.arrayRowMode = this.config.arrayRowMode || false
-Pool.prototype.getConnection = function (cb) {
+ if (/^(.*)\\(.*)$/.exec(this.config.server)) {
+ this.config.server = RegExp.$1
+ this.config.options.instanceName = RegExp.$2
+ }
- if (this._closed) {
- var err = new Error('Pool is closed.');
- err.code = 'POOL_CLOSED';
- process.nextTick(function () {
- cb(err);
- });
- return;
+ if (typeof callback === 'function') {
+ this.connect(callback)
+ }
}
- var connection;
- var pool = this;
-
- if (this._freeConnections.length > 0) {
- connection = this._freeConnections.shift();
- this.acquireConnection(connection, cb);
- return;
+ get connected () {
+ return this._connected
}
- if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) {
- connection = new PoolConnection(this, { config: this.config.newConnectionConfig() });
-
- this._acquiringConnections.push(connection);
- this._allConnections.push(connection);
-
- connection.connect({timeout: this.config.acquireTimeout}, function onConnect(err) {
- spliceConnection(pool._acquiringConnections, connection);
+ get connecting () {
+ return this._connecting
+ }
- if (pool._closed) {
- err = new Error('Pool is closed.');
- err.code = 'POOL_CLOSED';
- }
+ get healthy () {
+ return this._healthy
+ }
- if (err) {
- pool._purgeConnection(connection);
- cb(err);
- return;
- }
+ /**
+ * Acquire connection from this connection pool.
+ *
+ * @param {ConnectionPool|Transaction|PreparedStatement} requester Requester.
+ * @param {acquireCallback} [callback] A callback which is called after connection has been acquired, or an error has occurred. If omited, method returns Promise.
+ * @return {ConnectionPool|Promise}
+ */
- pool.emit('connection', connection);
- pool.emit('acquire', connection);
- cb(null, connection);
- });
- return;
- }
+ acquire (requester, callback) {
+ const acquirePromise = shared.Promise.resolve(this._acquire().promise).catch(err => {
+ this.emit('error', err)
+ throw err
+ })
+ if (typeof callback === 'function') {
+ acquirePromise.then(connection => callback(null, connection, this.config)).catch(callback)
+ return this
+ }
- if (!this.config.waitForConnections) {
- process.nextTick(function(){
- var err = new Error('No connections available.');
- err.code = 'POOL_CONNLIMIT';
- cb(err);
- });
- return;
+ return acquirePromise
}
- this._enqueueCallback(cb);
-};
+ _acquire () {
+ if (!this.pool) {
+ return shared.Promise.reject(new ConnectionError('Connection not yet open.', 'ENOTOPEN'))
+ } else if (this.pool.destroyed) {
+ return shared.Promise.reject(new ConnectionError('Connection is closing', 'ENOTOPEN'))
+ }
-Pool.prototype.acquireConnection = function acquireConnection(connection, cb) {
- if (connection._pool !== this) {
- throw new Error('Connection acquired from wrong pool.');
+ return this.pool.acquire()
}
- var changeUser = this._needsChangeUser(connection);
- var pool = this;
-
- this._acquiringConnections.push(connection);
+ /**
+ * Release connection back to the pool.
+ *
+ * @param {Connection} connection Previously acquired connection.
+ * @return {ConnectionPool}
+ */
- function onOperationComplete(err) {
- spliceConnection(pool._acquiringConnections, connection);
+ release (connection) {
+ debug('connection(%d): released', IDS.get(connection))
- if (pool._closed) {
- err = new Error('Pool is closed.');
- err.code = 'POOL_CLOSED';
+ if (this.pool) {
+ this.pool.release(connection)
}
+ return this
+ }
- if (err) {
- pool._connectionQueue.unshift(cb);
- pool._purgeConnection(connection);
- return;
- }
+ /**
+ * Creates a new connection pool with one active connection. This one initial connection serves as a probe to find out whether the configuration is valid.
+ *
+ * @param {basicCallback} [callback] A callback which is called after connection has established, or an error has occurred. If omited, method returns Promise.
+ * @return {ConnectionPool|Promise}
+ */
- if (changeUser) {
- pool.emit('connection', connection);
+ connect (callback) {
+ if (typeof callback === 'function') {
+ this._connect(callback)
+ return this
}
- pool.emit('acquire', connection);
- cb(null, connection);
+ return new shared.Promise((resolve, reject) => {
+ return this._connect(err => {
+ if (err) return reject(err)
+ resolve(this)
+ })
+ })
}
- if (changeUser) {
- // restore user back to pool configuration
- connection.config = this.config.newConnectionConfig();
- connection.changeUser({timeout: this.config.acquireTimeout}, onOperationComplete);
- } else {
- // ping connection
- connection.ping({timeout: this.config.acquireTimeout}, onOperationComplete);
- }
-};
+ /**
+ * @private
+ * @param {basicCallback} callback
+ */
-Pool.prototype.releaseConnection = function releaseConnection(connection) {
+ _connect (callback) {
+ if (this._connected) {
+ debug('pool(%d): already connected, executing connect callback immediately', IDS.get(this))
+ return setImmediate(callback, null, this)
+ }
- if (this._acquiringConnections.indexOf(connection) !== -1) {
- // connection is being acquired
- return;
- }
+ this._connectStack.push(callback)
- if (connection._pool) {
- if (connection._pool !== this) {
- throw new Error('Connection released to wrong pool');
+ if (this._connecting) {
+ return
}
- if (this._freeConnections.indexOf(connection) !== -1) {
- // connection already in free connection pool
- // this won't catch all double-release cases
- throw new Error('Connection already released');
- } else {
- // add connection to end of free queue
- this._freeConnections.push(connection);
- this.emit('release', connection);
- }
- }
+ this._connecting = true
+ debug('pool(%d): connecting', IDS.get(this))
- if (this._closed) {
- // empty the connection queue
- this._connectionQueue.splice(0).forEach(function (cb) {
- var err = new Error('Pool is closed.');
- err.code = 'POOL_CLOSED';
- process.nextTick(function () {
- cb(err);
- });
- });
- } else if (this._connectionQueue.length) {
- // get connection with next waiting callback
- this.getConnection(this._connectionQueue.shift());
- }
-};
+ // create one test connection to check if everything is ok
+ this._poolCreate().then((connection) => {
+ debug('pool(%d): connected', IDS.get(this))
+ this._healthy = true
-Pool.prototype.end = function (cb) {
- this._closed = true;
+ return this._poolDestroy(connection).then(() => {
+ // prepare pool
+ this.pool = new tarn.Pool(
+ Object.assign({
+ create: () => this._poolCreate()
+ .then(connection => {
+ this._healthy = true
+ return connection
+ })
+ .catch(err => {
+ if (this.pool.numUsed() + this.pool.numFree() <= 0) {
+ this._healthy = false
+ }
+ throw err
+ }),
+ validate: this._poolValidate.bind(this),
+ destroy: this._poolDestroy.bind(this),
+ max: 10,
+ min: 0,
+ idleTimeoutMillis: 30000,
+ propagateCreateError: true
+ }, this.config.pool)
+ )
+ const self = this
+ Object.defineProperties(this.pool, {
+ size: {
+ get: () => {
+ const message = 'the `size` property on pool is deprecated, access it directly on the `ConnectionPool`'
+ self.emit('debug', message)
+ process.emitWarning(message)
+ return self.size
+ }
+ },
+ available: {
+ get: () => {
+ const message = 'the `available` property on pool is deprecated, access it directly on the `ConnectionPool`'
+ self.emit('debug', message)
+ process.emitWarning(message)
+ return self.available
+ }
+ },
+ pending: {
+ get: () => {
+ const message = 'the `pending` property on pool is deprecate, access it directly on the `ConnectionPool`'
+ self.emit('debug', message)
+ process.emitWarning(message)
+ return self.pending
+ }
+ },
+ borrowed: {
+ get: () => {
+ const message = 'the `borrowed` property on pool is deprecated, access it directly on the `ConnectionPool`'
+ self.emit('debug', message)
+ process.emitWarning(message)
+ return self.borrowed
+ }
+ }
+ })
- if (typeof cb !== 'function') {
- cb = function (err) {
- if (err) throw err;
- };
+ this._connecting = false
+ this._connected = true
+ })
+ }).then(() => {
+ this._connectStack.forEach((cb) => {
+ setImmediate(cb, null, this)
+ })
+ }).catch(err => {
+ this._connecting = false
+ this._connectStack.forEach((cb) => {
+ setImmediate(cb, err)
+ })
+ }).then(() => {
+ this._connectStack = []
+ })
}
- var calledBack = false;
- var waitingClose = 0;
+ get size () {
+ return this.pool.numFree() + this.pool.numUsed() + this.pool.numPendingCreates()
+ }
- function onEnd(err) {
- if (!calledBack && (err || --waitingClose <= 0)) {
- calledBack = true;
- cb(err);
- }
+ get available () {
+ return this.pool.numFree()
}
- while (this._allConnections.length !== 0) {
- waitingClose++;
- this._purgeConnection(this._allConnections[0], onEnd);
+ get pending () {
+ return this.pool.numPendingAcquires()
}
- if (waitingClose === 0) {
- process.nextTick(onEnd);
+ get borrowed () {
+ return this.pool.numUsed()
}
-};
-Pool.prototype.query = function (sql, values, cb) {
- var query = Connection.createQuery(sql, values, cb);
+ /**
+ * Close all active connections in the pool.
+ *
+ * @param {basicCallback} [callback] A callback which is called after connection has closed, or an error has occurred. If omited, method returns Promise.
+ * @return {ConnectionPool|Promise}
+ */
- if (!(typeof sql === 'object' && 'typeCast' in sql)) {
- query.typeCast = this.config.connectionConfig.typeCast;
- }
+ close (callback) {
+ if (typeof callback === 'function') {
+ this._close(callback)
+ return this
+ }
- if (this.config.connectionConfig.trace) {
- // Long stack trace support
- query._callSite = new Error();
+ return new shared.Promise((resolve, reject) => {
+ this._close(err => {
+ if (err) return reject(err)
+ resolve(this)
+ })
+ })
}
- this.getConnection(function (err, conn) {
- if (err) {
- query.on('error', function () {});
- query.end(err);
- return;
+ /**
+ * @private
+ * @param {basicCallback} callback
+ */
+
+ _close (callback) {
+ // we don't allow pools in a connecting state to be closed because it means there are far too many
+ // edge cases to deal with
+ if (this._connecting) {
+ debug('pool(%d): close called while connecting', IDS.get(this))
+ setImmediate(callback, new ConnectionError('Cannot close a pool while it is connecting'))
}
- // Release connection based off event
- query.once('end', function() {
- conn.release();
- });
+ if (!this.pool) {
+ debug('pool(%d): already closed, executing close callback immediately', IDS.get(this))
+ return setImmediate(callback, null)
+ }
- conn.query(query);
- });
+ this._closeStack.push(callback)
- return query;
-};
+ if (this.pool.destroyed) return
-Pool.prototype._enqueueCallback = function _enqueueCallback(callback) {
+ this._connecting = this._connected = this._healthy = false
- if (this.config.queueLimit && this._connectionQueue.length >= this.config.queueLimit) {
- process.nextTick(function () {
- var err = new Error('Queue limit reached.');
- err.code = 'POOL_ENQUEUELIMIT';
- callback(err);
- });
- return;
+ this.pool.destroy().then(() => {
+ debug('pool(%d): pool closed, removing pool reference and executing close callbacks', IDS.get(this))
+ this.pool = null
+ this._closeStack.forEach(cb => {
+ setImmediate(cb, null)
+ })
+ }).catch(err => {
+ this.pool = null
+ this._closeStack.forEach(cb => {
+ setImmediate(cb, err)
+ })
+ }).then(() => {
+ this._closeStack = []
+ })
}
- // Bind to domain, as dequeue will likely occur in a different domain
- var cb = process.domain
- ? process.domain.bind(callback)
- : callback;
-
- this._connectionQueue.push(cb);
- this.emit('enqueue');
-};
-
-Pool.prototype._needsChangeUser = function _needsChangeUser(connection) {
- var connConfig = connection.config;
- var poolConfig = this.config.connectionConfig;
+ /**
+ * Returns new request using this connection.
+ *
+ * @return {Request}
+ */
- // check if changeUser values are different
- return connConfig.user !== poolConfig.user
- || connConfig.database !== poolConfig.database
- || connConfig.password !== poolConfig.password
- || connConfig.charsetNumber !== poolConfig.charsetNumber;
-};
+ request () {
+ return new shared.driver.Request(this)
+ }
-Pool.prototype._purgeConnection = function _purgeConnection(connection, callback) {
- var cb = callback || function () {};
+ /**
+ * Returns new transaction using this connection.
+ *
+ * @return {Transaction}
+ */
- if (connection.state === 'disconnected') {
- connection.destroy();
+ transaction () {
+ return new shared.driver.Transaction(this)
}
- this._removeConnection(connection);
+ /**
+ * Creates a new query using this connection from a tagged template string.
+ *
+ * @variation 1
+ * @param {Array} strings Array of string literals.
+ * @param {...*} keys Values.
+ * @return {Request}
+ */
- if (connection.state !== 'disconnected' && !connection._protocol._quitSequence) {
- connection._realEnd(cb);
- return;
- }
+ /**
+ * Execute the SQL command.
+ *
+ * @variation 2
+ * @param {String} command T-SQL command to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
- process.nextTick(cb);
-};
+ query () {
+ if (typeof arguments[0] === 'string') { return new shared.driver.Request(this).query(arguments[0], arguments[1]) }
-Pool.prototype._removeConnection = function(connection) {
- connection._pool = null;
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
- // Remove connection from all connections
- spliceConnection(this._allConnections, connection);
+ return new shared.driver.Request(this)._template(strings, values, 'query')
+ }
- // Remove connection from free connections
- spliceConnection(this._freeConnections, connection);
+ /**
+ * Creates a new batch using this connection from a tagged template string.
+ *
+ * @variation 1
+ * @param {Array} strings Array of string literals.
+ * @param {...*} keys Values.
+ * @return {Request}
+ */
- this.releaseConnection(connection);
-};
+ /**
+ * Execute the SQL command.
+ *
+ * @variation 2
+ * @param {String} command T-SQL command to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
-Pool.prototype.escape = function(value) {
- return mysql.escape(value, this.config.connectionConfig.stringifyObjects, this.config.connectionConfig.timezone);
-};
+ batch () {
+ if (typeof arguments[0] === 'string') { return new shared.driver.Request(this).batch(arguments[0], arguments[1]) }
-Pool.prototype.escapeId = function escapeId(value) {
- return mysql.escapeId(value, false);
-};
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
-function spliceConnection(array, connection) {
- var index;
- if ((index = array.indexOf(connection)) !== -1) {
- // Remove connection from all connections
- array.splice(index, 1);
+ return new shared.driver.Request(this)._template(strings, values, 'batch')
}
}
+module.exports = ConnectionPool
+
/***/ }),
-/***/ 90678:
+/***/ 26042:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var Pool = __nccwpck_require__(65942);
-var PoolConfig = __nccwpck_require__(30002);
-var PoolNamespace = __nccwpck_require__(64313);
-var PoolSelector = __nccwpck_require__(64849);
-var Util = __nccwpck_require__(31669);
-var EventEmitter = __nccwpck_require__(28614).EventEmitter;
-
-module.exports = PoolCluster;
-
-/**
- * PoolCluster
- * @constructor
- * @param {object} [config] The pool cluster configuration
- * @public
- */
-function PoolCluster(config) {
- EventEmitter.call(this);
-
- config = config || {};
- this._canRetry = typeof config.canRetry === 'undefined' ? true : config.canRetry;
- this._defaultSelector = config.defaultSelector || 'RR';
- this._removeNodeErrorCount = config.removeNodeErrorCount || 5;
- this._restoreNodeTimeout = config.restoreNodeTimeout || 0;
+"use strict";
- this._closed = false;
- this._findCaches = Object.create(null);
- this._lastId = 0;
- this._namespaces = Object.create(null);
- this._nodes = Object.create(null);
-}
-Util.inherits(PoolCluster, EventEmitter);
+const ConnectionPool = __nccwpck_require__(85558)
+const PreparedStatement = __nccwpck_require__(72919)
+const Request = __nccwpck_require__(65225)
+const Transaction = __nccwpck_require__(2555)
+const { ConnectionError, TransactionError, RequestError, PreparedStatementError, MSSQLError } = __nccwpck_require__(25903)
+const shared = __nccwpck_require__(67636)
+const Table = __nccwpck_require__(67417)
+const ISOLATION_LEVEL = __nccwpck_require__(62202)
+const { TYPES } = __nccwpck_require__(62388)
+const { connect, close, on, off, removeListener, query, batch } = __nccwpck_require__(89105)
-PoolCluster.prototype.add = function add(id, config) {
- if (this._closed) {
- throw new Error('PoolCluster is closed.');
+module.exports = {
+ ConnectionPool,
+ Transaction,
+ Request,
+ PreparedStatement,
+ ConnectionError,
+ TransactionError,
+ RequestError,
+ PreparedStatementError,
+ MSSQLError,
+ driver: shared.driver,
+ exports: {
+ ConnectionError,
+ TransactionError,
+ RequestError,
+ PreparedStatementError,
+ MSSQLError,
+ Table,
+ ISOLATION_LEVEL,
+ TYPES,
+ MAX: 65535, // (1 << 16) - 1
+ map: shared.map,
+ getTypeByValue: shared.getTypeByValue,
+ connect,
+ close,
+ on,
+ removeListener,
+ off,
+ query,
+ batch
}
+}
- var nodeId = typeof id === 'object'
- ? 'CLUSTER::' + (++this._lastId)
- : String(id);
-
- if (this._nodes[nodeId] !== undefined) {
- throw new Error('Node ID "' + nodeId + '" is already defined in PoolCluster.');
+Object.defineProperty(module.exports, "Promise", ({
+ enumerable: true,
+ get: () => {
+ return shared.Promise
+ },
+ set: (value) => {
+ shared.Promise = value
}
+}))
- var poolConfig = typeof id !== 'object'
- ? new PoolConfig(config)
- : new PoolConfig(id);
-
- this._nodes[nodeId] = {
- id : nodeId,
- errorCount : 0,
- pool : new Pool({config: poolConfig}),
- _offlineUntil : 0
- };
+for (const key in TYPES) {
+ const value = TYPES[key]
+ module.exports.exports[key] = value
+ module.exports.exports[key.toUpperCase()] = value
+}
- this._clearFindCaches();
-};
+/**
+ * @callback Request~requestCallback
+ * @param {Error} err Error on error, otherwise null.
+ * @param {Object} [result] Request result.
+ */
-PoolCluster.prototype.end = function end(callback) {
- var cb = callback !== undefined
- ? callback
- : _cb;
+/**
+ * @callback Request~bulkCallback
+ * @param {Error} err Error on error, otherwise null.
+ * @param {Number} [rowsAffected] Number of affected rows.
+ */
- if (typeof cb !== 'function') {
- throw TypeError('callback argument must be a function');
- }
+/**
+ * @callback basicCallback
+ * @param {Error} err Error on error, otherwise null.
+ * @param {Connection} [connection] Acquired connection.
+ */
- if (this._closed) {
- process.nextTick(cb);
- return;
- }
+/**
+ * @callback acquireCallback
+ * @param {Error} err Error on error, otherwise null.
+ * @param {Connection} [connection] Acquired connection.
+ * @param {Object} [config] Connection config
+ */
- this._closed = true;
+/**
+ * Dispatched after connection has established.
+ * @event ConnectionPool#connect
+ */
- var calledBack = false;
- var nodeIds = Object.keys(this._nodes);
- var waitingClose = 0;
+/**
+ * Dispatched after connection has closed a pool (by calling close).
+ * @event ConnectionPool#close
+ */
- function onEnd(err) {
- if (!calledBack && (err || --waitingClose <= 0)) {
- calledBack = true;
- cb(err);
- }
- }
+/**
+ * Dispatched when transaction begin.
+ * @event Transaction#begin
+ */
- for (var i = 0; i < nodeIds.length; i++) {
- var nodeId = nodeIds[i];
- var node = this._nodes[nodeId];
+/**
+ * Dispatched on successful commit.
+ * @event Transaction#commit
+ */
- waitingClose++;
- node.pool.end(onEnd);
- }
+/**
+ * Dispatched on successful rollback.
+ * @event Transaction#rollback
+ */
- if (waitingClose === 0) {
- process.nextTick(onEnd);
- }
-};
+/**
+ * Dispatched when metadata for new recordset are parsed.
+ * @event Request#recordset
+ */
-PoolCluster.prototype.of = function(pattern, selector) {
- pattern = pattern || '*';
+/**
+ * Dispatched when new row is parsed.
+ * @event Request#row
+ */
- selector = selector || this._defaultSelector;
- selector = selector.toUpperCase();
- if (typeof PoolSelector[selector] === 'undefined') {
- selector = this._defaultSelector;
- }
+/**
+ * Dispatched when request is complete.
+ * @event Request#done
+ */
- var key = pattern + selector;
+/**
+ * Dispatched on error.
+ * @event Request#error
+ */
- if (typeof this._namespaces[key] === 'undefined') {
- this._namespaces[key] = new PoolNamespace(this, pattern, selector);
- }
- return this._namespaces[key];
-};
+/***/ }),
-PoolCluster.prototype.remove = function remove(pattern) {
- var foundNodeIds = this._findNodeIds(pattern, true);
+/***/ 72919:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- for (var i = 0; i < foundNodeIds.length; i++) {
- var node = this._getNode(foundNodeIds[i]);
+"use strict";
- if (node) {
- this._removeNode(node);
- }
- }
-};
-PoolCluster.prototype.getConnection = function(pattern, selector, cb) {
- var namespace;
- if (typeof pattern === 'function') {
- cb = pattern;
- namespace = this.of();
- } else {
- if (typeof selector === 'function') {
- cb = selector;
- selector = this._defaultSelector;
- }
+const debug = __nccwpck_require__(38237)('mssql:base')
+const { EventEmitter } = __nccwpck_require__(28614)
+const { IDS, objectHasProperty } = __nccwpck_require__(14178)
+const globalConnection = __nccwpck_require__(89105)
+const { TransactionError, PreparedStatementError } = __nccwpck_require__(25903)
+const shared = __nccwpck_require__(67636)
+const { TYPES, declare } = __nccwpck_require__(62388)
- namespace = this.of(pattern, selector);
- }
+/**
+ * Class PreparedStatement.
+ *
+ * IMPORTANT: Rememeber that each prepared statement means one reserved connection from the pool. Don't forget to unprepare a prepared statement!
+ *
+ * @property {String} statement Prepared SQL statement.
+ */
- namespace.getConnection(cb);
-};
+class PreparedStatement extends EventEmitter {
+ /**
+ * Creates a new Prepared Statement.
+ *
+ * @param {ConnectionPool|Transaction} [holder]
+ */
-PoolCluster.prototype._clearFindCaches = function _clearFindCaches() {
- this._findCaches = Object.create(null);
-};
+ constructor (parent) {
+ super()
-PoolCluster.prototype._decreaseErrorCount = function _decreaseErrorCount(node) {
- var errorCount = node.errorCount;
+ IDS.add(this, 'PreparedStatement')
+ debug('ps(%d): created', IDS.get(this))
- if (errorCount > this._removeNodeErrorCount) {
- errorCount = this._removeNodeErrorCount;
+ this.parent = parent || globalConnection.pool
+ this._handle = 0
+ this.prepared = false
+ this.parameters = {}
}
- if (errorCount < 1) {
- errorCount = 1;
+ get connected () {
+ return this.parent.connected
}
- node.errorCount = errorCount - 1;
+ /**
+ * Acquire connection from connection pool.
+ *
+ * @param {Request} request Request.
+ * @param {ConnectionPool~acquireCallback} [callback] A callback which is called after connection has established, or an error has occurred. If omited, method returns Promise.
+ * @return {PreparedStatement|Promise}
+ */
- if (node._offlineUntil) {
- node._offlineUntil = 0;
- this.emit('online', node.id);
- }
-};
+ acquire (request, callback) {
+ if (!this._acquiredConnection) {
+ setImmediate(callback, new PreparedStatementError('Statement is not prepared. Call prepare() first.', 'ENOTPREPARED'))
+ return this
+ }
-PoolCluster.prototype._findNodeIds = function _findNodeIds(pattern, includeOffline) {
- var currentTime = 0;
- var foundNodeIds = this._findCaches[pattern];
+ if (this._activeRequest) {
+ setImmediate(callback, new TransactionError("Can't acquire connection for the request. There is another request in progress.", 'EREQINPROG'))
+ return this
+ }
- if (foundNodeIds === undefined) {
- var expression = patternRegExp(pattern);
- var nodeIds = Object.keys(this._nodes);
+ this._activeRequest = request
+ setImmediate(callback, null, this._acquiredConnection, this._acquiredConfig)
+ return this
+ }
- foundNodeIds = nodeIds.filter(function (id) {
- return id.match(expression);
- });
+ /**
+ * Release connection back to the pool.
+ *
+ * @param {Connection} connection Previously acquired connection.
+ * @return {PreparedStatement}
+ */
- this._findCaches[pattern] = foundNodeIds;
- }
+ release (connection) {
+ if (connection === this._acquiredConnection) {
+ this._activeRequest = null
+ }
- if (includeOffline) {
- return foundNodeIds;
+ return this
}
- return foundNodeIds.filter(function (nodeId) {
- var node = this._getNode(nodeId);
+ /**
+ * Add an input parameter to the prepared statement.
+ *
+ * @param {String} name Name of the input parameter without @ char.
+ * @param {*} type SQL data type of input parameter.
+ * @return {PreparedStatement}
+ */
- if (!node._offlineUntil) {
- return true;
+ input (name, type) {
+ if ((/(--| |\/\*|\*\/|')/).test(name)) {
+ throw new PreparedStatementError(`SQL injection warning for param '${name}'`, 'EINJECT')
}
- if (!currentTime) {
- currentTime = getMonotonicMilliseconds();
+ if (arguments.length < 2) {
+ throw new PreparedStatementError('Invalid number of arguments. 2 arguments expected.', 'EARGS')
}
- return node._offlineUntil <= currentTime;
- }, this);
-};
+ if (type instanceof Function) {
+ type = type()
+ }
-PoolCluster.prototype._getNode = function _getNode(id) {
- return this._nodes[id] || null;
-};
+ if (objectHasProperty(this.parameters, name)) {
+ throw new PreparedStatementError(`The parameter name ${name} has already been declared. Parameter names must be unique`, 'EDUPEPARAM')
+ }
-PoolCluster.prototype._increaseErrorCount = function _increaseErrorCount(node) {
- var errorCount = ++node.errorCount;
+ this.parameters[name] = {
+ name,
+ type: type.type,
+ io: 1,
+ length: type.length,
+ scale: type.scale,
+ precision: type.precision,
+ tvpType: type.tvpType
+ }
- if (this._removeNodeErrorCount > errorCount) {
- return;
+ return this
}
- if (this._restoreNodeTimeout > 0) {
- node._offlineUntil = getMonotonicMilliseconds() + this._restoreNodeTimeout;
- this.emit('offline', node.id);
- return;
+ /**
+ * Replace an input parameter on the request.
+ *
+ * @param {String} name Name of the input parameter without @ char.
+ * @param {*} [type] SQL data type of input parameter. If you omit type, module automaticaly decide which SQL data type should be used based on JS data type.
+ * @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values.
+ * @return {Request}
+ */
+
+ replaceInput (name, type, value) {
+ delete this.parameters[name]
+
+ return this.input(name, type, value)
}
- this._removeNode(node);
- this.emit('remove', node.id);
-};
+ /**
+ * Add an output parameter to the prepared statement.
+ *
+ * @param {String} name Name of the output parameter without @ char.
+ * @param {*} type SQL data type of output parameter.
+ * @return {PreparedStatement}
+ */
-PoolCluster.prototype._getConnection = function(node, cb) {
- var self = this;
+ output (name, type) {
+ if (/(--| |\/\*|\*\/|')/.test(name)) {
+ throw new PreparedStatementError(`SQL injection warning for param '${name}'`, 'EINJECT')
+ }
- node.pool.getConnection(function (err, connection) {
- if (err) {
- self._increaseErrorCount(node);
- cb(err);
- return;
- } else {
- self._decreaseErrorCount(node);
+ if (arguments.length < 2) {
+ throw new PreparedStatementError('Invalid number of arguments. 2 arguments expected.', 'EARGS')
}
- connection._clusterId = node.id;
+ if (type instanceof Function) type = type()
- cb(null, connection);
- });
-};
+ if (objectHasProperty(this.parameters, name)) {
+ throw new PreparedStatementError(`The parameter name ${name} has already been declared. Parameter names must be unique`, 'EDUPEPARAM')
+ }
-PoolCluster.prototype._removeNode = function _removeNode(node) {
- delete this._nodes[node.id];
+ this.parameters[name] = {
+ name,
+ type: type.type,
+ io: 2,
+ length: type.length,
+ scale: type.scale,
+ precision: type.precision
+ }
- this._clearFindCaches();
+ return this
+ }
- node.pool.end(_noop);
-};
+ /**
+ * Replace an output parameter on the request.
+ *
+ * @param {String} name Name of the output parameter without @ char.
+ * @param {*} type SQL data type of output parameter.
+ * @return {PreparedStatement}
+ */
-function getMonotonicMilliseconds() {
- var ms;
+ replaceOutput (name, type) {
+ delete this.parameters[name]
- if (typeof process.hrtime === 'function') {
- ms = process.hrtime();
- ms = ms[0] * 1e3 + ms[1] * 1e-6;
- } else {
- ms = process.uptime() * 1000;
+ return this.output(name, type)
}
- return Math.floor(ms);
-}
+ /**
+ * Prepare a statement.
+ *
+ * @param {String} statement SQL statement to prepare.
+ * @param {basicCallback} [callback] A callback which is called after preparation has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {PreparedStatement|Promise}
+ */
-function isRegExp(val) {
- return typeof val === 'object'
- && Object.prototype.toString.call(val) === '[object RegExp]';
-}
+ prepare (statement, callback) {
+ if (typeof callback === 'function') {
+ this._prepare(statement, callback)
+ return this
+ }
-function patternRegExp(pattern) {
- if (isRegExp(pattern)) {
- return pattern;
+ return new shared.Promise((resolve, reject) => {
+ this._prepare(statement, err => {
+ if (err) return reject(err)
+ resolve(this)
+ })
+ })
}
- var source = pattern
- .replace(/([.+?^=!:${}()|\[\]\/\\])/g, '\\$1')
- .replace(/\*/g, '.*');
+ /**
+ * @private
+ * @param {String} statement
+ * @param {basicCallback} callback
+ */
- return new RegExp('^' + source + '$');
-}
+ _prepare (statement, callback) {
+ debug('ps(%d): prepare', IDS.get(this))
-function _cb(err) {
- if (err) {
- throw err;
- }
-}
+ if (typeof statement === 'function') {
+ callback = statement
+ statement = undefined
+ }
-function _noop() {}
+ if (this.prepared) {
+ return setImmediate(callback, new PreparedStatementError('Statement is already prepared.', 'EALREADYPREPARED'))
+ }
+ this.statement = statement || this.statement
-/***/ }),
+ this.parent.acquire(this, (err, connection, config) => {
+ if (err) return callback(err)
-/***/ 30002:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ this._acquiredConnection = connection
+ this._acquiredConfig = config
+ const req = new shared.driver.Request(this)
+ req.stream = false
+ req.output('handle', TYPES.Int)
+ req.input('params', TYPES.NVarChar, ((() => {
+ const result = []
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ result.push(`@${name} ${declare(param.type, param)}${param.io === 2 ? ' output' : ''}`)
+ }
+ return result
+ })()).join(','))
+ req.input('stmt', TYPES.NVarChar, this.statement)
+ req.execute('sp_prepare', (err, result) => {
+ if (err) {
+ this.parent.release(this._acquiredConnection)
+ this._acquiredConnection = null
+ this._acquiredConfig = null
-var ConnectionConfig = __nccwpck_require__(35551);
+ return callback(err)
+ }
-module.exports = PoolConfig;
-function PoolConfig(options) {
- if (typeof options === 'string') {
- options = ConnectionConfig.parseUrl(options);
- }
+ debug('ps(%d): prepared', IDS.get(this))
- this.acquireTimeout = (options.acquireTimeout === undefined)
- ? 10 * 1000
- : Number(options.acquireTimeout);
- this.connectionConfig = new ConnectionConfig(options);
- this.waitForConnections = (options.waitForConnections === undefined)
- ? true
- : Boolean(options.waitForConnections);
- this.connectionLimit = (options.connectionLimit === undefined)
- ? 10
- : Number(options.connectionLimit);
- this.queueLimit = (options.queueLimit === undefined)
- ? 0
- : Number(options.queueLimit);
-}
+ this._handle = result.output.handle
+ this.prepared = true
-PoolConfig.prototype.newConnectionConfig = function newConnectionConfig() {
- var connectionConfig = new ConnectionConfig(this.connectionConfig);
+ callback(null)
+ })
+ })
+ }
- connectionConfig.clientFlags = this.connectionConfig.clientFlags;
- connectionConfig.maxPacketSize = this.connectionConfig.maxPacketSize;
+ /**
+ * Execute a prepared statement.
+ *
+ * @param {Object} values An object whose names correspond to the names of parameters that were added to the prepared statement before it was prepared.
+ * @param {basicCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
- return connectionConfig;
-};
+ execute (values, callback) {
+ if (this.stream || (typeof callback === 'function')) {
+ return this._execute(values, callback)
+ }
+ return new shared.Promise((resolve, reject) => {
+ this._execute(values, (err, recordset) => {
+ if (err) return reject(err)
+ resolve(recordset)
+ })
+ })
+ }
-/***/ }),
+ /**
+ * @private
+ * @param {Object} values
+ * @param {basicCallback} callback
+ */
-/***/ 10378:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ _execute (values, callback) {
+ const req = new shared.driver.Request(this)
+ req.stream = this.stream
+ req.arrayRowMode = this.arrayRowMode
+ req.input('handle', TYPES.Int, this._handle)
-var inherits = __nccwpck_require__(31669).inherits;
-var Connection = __nccwpck_require__(76742);
-var Events = __nccwpck_require__(28614);
+ // copy parameters with new values
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ req.parameters[name] = {
+ name,
+ type: param.type,
+ io: param.io,
+ value: values[name],
+ length: param.length,
+ scale: param.scale,
+ precision: param.precision
+ }
+ }
-module.exports = PoolConnection;
-inherits(PoolConnection, Connection);
+ req.execute('sp_execute', (err, result) => {
+ if (err) return callback(err)
-function PoolConnection(pool, options) {
- Connection.call(this, options);
- this._pool = pool;
+ callback(null, result)
+ })
- // Bind connection to pool domain
- if (Events.usingDomains) {
- this.domain = pool.domain;
+ return req
}
- // When a fatal error occurs the connection's protocol ends, which will cause
- // the connection to end as well, thus we only need to watch for the end event
- // and we will be notified of disconnects.
- this.on('end', this._removeFromPool);
- this.on('error', function (err) {
- if (err.fatal) {
- this._removeFromPool();
- }
- });
-}
+ /**
+ * Unprepare a prepared statement.
+ *
+ * @param {basicCallback} [callback] A callback which is called after unpreparation has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {PreparedStatement|Promise}
+ */
-PoolConnection.prototype.release = function release() {
- var pool = this._pool;
+ unprepare (callback) {
+ if (typeof callback === 'function') {
+ this._unprepare(callback)
+ return this
+ }
- if (!pool || pool._closed) {
- return undefined;
+ return new shared.Promise((resolve, reject) => {
+ this._unprepare(err => {
+ if (err) return reject(err)
+ resolve()
+ })
+ })
}
- return pool.releaseConnection(this);
-};
+ /**
+ * @private
+ * @param {basicCallback} callback
+ */
-// TODO: Remove this when we are removing PoolConnection#end
-PoolConnection.prototype._realEnd = Connection.prototype.end;
+ _unprepare (callback) {
+ debug('ps(%d): unprepare', IDS.get(this))
-PoolConnection.prototype.end = function () {
- console.warn(
- 'Calling conn.end() to release a pooled connection is ' +
- 'deprecated. In next version calling conn.end() will be ' +
- 'restored to default conn.end() behavior. Use ' +
- 'conn.release() instead.'
- );
- this.release();
-};
+ if (!this.prepared) {
+ return setImmediate(callback, new PreparedStatementError('Statement is not prepared. Call prepare() first.', 'ENOTPREPARED'))
+ }
-PoolConnection.prototype.destroy = function () {
- Connection.prototype.destroy.apply(this, arguments);
- this._removeFromPool(this);
-};
+ if (this._activeRequest) {
+ return setImmediate(callback, new TransactionError("Can't unprepare the statement. There is a request in progress.", 'EREQINPROG'))
+ }
-PoolConnection.prototype._removeFromPool = function _removeFromPool() {
- if (!this._pool || this._pool._closed) {
- return;
- }
+ const req = new shared.driver.Request(this)
+ req.stream = false
+ req.input('handle', TYPES.Int, this._handle)
+ req.execute('sp_unprepare', err => {
+ if (err) return callback(err)
- var pool = this._pool;
- this._pool = null;
+ this.parent.release(this._acquiredConnection)
+ this._acquiredConnection = null
+ this._acquiredConfig = null
+ this._handle = 0
+ this.prepared = false
- pool._purgeConnection(this);
-};
+ debug('ps(%d): unprepared', IDS.get(this))
+
+ return callback(null)
+ })
+ }
+}
+
+module.exports = PreparedStatement
/***/ }),
-/***/ 64313:
+/***/ 65225:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var Connection = __nccwpck_require__(76742);
-var PoolSelector = __nccwpck_require__(64849);
+"use strict";
-module.exports = PoolNamespace;
+
+const debug = __nccwpck_require__(38237)('mssql:base')
+const { EventEmitter } = __nccwpck_require__(28614)
+const { IDS, objectHasProperty } = __nccwpck_require__(14178)
+const globalConnection = __nccwpck_require__(89105)
+const { RequestError, ConnectionError } = __nccwpck_require__(25903)
+const { TYPES } = __nccwpck_require__(62388)
+const shared = __nccwpck_require__(67636)
/**
- * PoolNamespace
- * @constructor
- * @param {PoolCluster} cluster The parent cluster for the namespace
- * @param {string} pattern The selection pattern to use
- * @param {string} selector The selector name to use
- * @public
+ * Class Request.
+ *
+ * @property {Transaction} transaction Reference to transaction when request was created in transaction.
+ * @property {*} parameters Collection of input and output parameters.
+ * @property {Boolean} canceled `true` if request was canceled.
+ *
+ * @fires Request#recordset
+ * @fires Request#row
+ * @fires Request#done
+ * @fires Request#error
*/
-function PoolNamespace(cluster, pattern, selector) {
- this._cluster = cluster;
- this._pattern = pattern;
- this._selector = new PoolSelector[selector]();
-}
-PoolNamespace.prototype.getConnection = function(cb) {
- var clusterNode = this._getClusterNode();
- var cluster = this._cluster;
- var namespace = this;
+class Request extends EventEmitter {
+ /**
+ * Create new Request.
+ *
+ * @param {Connection|ConnectionPool|Transaction|PreparedStatement} parent If ommited, global connection is used instead.
+ */
- if (clusterNode === null) {
- var err = null;
+ constructor (parent) {
+ super()
- if (this._cluster._findNodeIds(this._pattern, true).length !== 0) {
- err = new Error('Pool does not have online node.');
- err.code = 'POOL_NONEONLINE';
- } else {
- err = new Error('Pool does not exist.');
- err.code = 'POOL_NOEXIST';
- }
+ IDS.add(this, 'Request')
+ debug('request(%d): created', IDS.get(this))
- cb(err);
- return;
+ this.canceled = false
+ this._paused = false
+ this.parent = parent || globalConnection.pool
+ this.parameters = {}
}
- cluster._getConnection(clusterNode, function(err, connection) {
- var retry = err && cluster._canRetry
- && cluster._findNodeIds(namespace._pattern).length !== 0;
-
- if (retry) {
- namespace.getConnection(cb);
- return;
- }
+ get paused () {
+ return this._paused
+ }
- if (err) {
- cb(err);
- return;
- }
+ /**
+ * Generate sql string and set imput parameters from tagged template string.
+ *
+ * @param {Template literal} template
+ * @return {String}
+ */
+ template () {
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
+ return this._template(strings, values)
+ }
- cb(null, connection);
- });
-};
+ /**
+ * Fetch request from tagged template string.
+ *
+ * @private
+ * @param {Array} strings
+ * @param {Array} values
+ * @param {String} [method] If provided, method is automatically called with serialized command on this object.
+ * @return {Request}
+ */
-PoolNamespace.prototype.query = function (sql, values, cb) {
- var cluster = this._cluster;
- var clusterNode = this._getClusterNode();
- var query = Connection.createQuery(sql, values, cb);
- var namespace = this;
+ _template (strings, values, method) {
+ const command = [strings[0]]
- if (clusterNode === null) {
- var err = null;
+ for (let index = 0; index < values.length; index++) {
+ const value = values[index]
+ // if value is an array, prepare each items as it's own comma separated parameter
+ if (Array.isArray(value)) {
+ for (let parameterIndex = 0; parameterIndex < value.length; parameterIndex++) {
+ this.input(`param${index + 1}_${parameterIndex}`, value[parameterIndex])
+ command.push(`@param${index + 1}_${parameterIndex}`)
+ if (parameterIndex < value.length - 1) {
+ command.push(', ')
+ }
+ }
+ command.push(strings[index + 1])
+ } else {
+ this.input(`param${index + 1}`, value)
+ command.push(`@param${index + 1}`, strings[index + 1])
+ }
+ }
- if (this._cluster._findNodeIds(this._pattern, true).length !== 0) {
- err = new Error('Pool does not have online node.');
- err.code = 'POOL_NONEONLINE';
+ if (method) {
+ return this[method](command.join(''))
} else {
- err = new Error('Pool does not exist.');
- err.code = 'POOL_NOEXIST';
+ return command.join('')
}
-
- process.nextTick(function () {
- query.on('error', function () {});
- query.end(err);
- });
- return query;
- }
-
- if (!(typeof sql === 'object' && 'typeCast' in sql)) {
- query.typeCast = clusterNode.pool.config.connectionConfig.typeCast;
- }
-
- if (clusterNode.pool.config.connectionConfig.trace) {
- // Long stack trace support
- query._callSite = new Error();
}
- cluster._getConnection(clusterNode, function (err, conn) {
- var retry = err && cluster._canRetry
- && cluster._findNodeIds(namespace._pattern).length !== 0;
+ /**
+ * Add an input parameter to the request.
+ *
+ * @param {String} name Name of the input parameter without @ char.
+ * @param {*} [type] SQL data type of input parameter. If you omit type, module automaticaly decide which SQL data type should be used based on JS data type.
+ * @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values.
+ * @return {Request}
+ */
- if (retry) {
- namespace.query(query);
- return;
+ input (name, type, value) {
+ if ((/(--| |\/\*|\*\/|')/).test(name)) {
+ throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
}
- if (err) {
- query.on('error', function () {});
- query.end(err);
- return;
+ if (arguments.length < 2) {
+ throw new RequestError('Invalid number of arguments. At least 2 arguments expected.', 'EARGS')
+ } else if (arguments.length === 2) {
+ value = type
+ type = shared.getTypeByValue(value)
}
- // Release connection based off event
- query.once('end', function() {
- conn.release();
- });
+ // support for custom data types
+ if (value && typeof value.valueOf === 'function' && !(value instanceof Date)) value = value.valueOf()
- conn.query(query);
- });
+ if (value === undefined) value = null // undefined to null
+ if (typeof value === 'number' && isNaN(value)) value = null // NaN to null
+ if (type instanceof Function) type = type()
- return query;
-};
+ if (objectHasProperty(this.parameters, name)) {
+ throw new RequestError(`The parameter name ${name} has already been declared. Parameter names must be unique`, 'EDUPEPARAM')
+ }
-PoolNamespace.prototype._getClusterNode = function _getClusterNode() {
- var foundNodeIds = this._cluster._findNodeIds(this._pattern);
- var nodeId;
+ this.parameters[name] = {
+ name,
+ type: type.type,
+ io: 1,
+ value,
+ length: type.length,
+ scale: type.scale,
+ precision: type.precision,
+ tvpType: type.tvpType
+ }
- switch (foundNodeIds.length) {
- case 0:
- nodeId = null;
- break;
- case 1:
- nodeId = foundNodeIds[0];
- break;
- default:
- nodeId = this._selector(foundNodeIds);
- break;
+ return this
}
- return nodeId !== null
- ? this._cluster._getNode(nodeId)
- : null;
-};
-
-
-/***/ }),
+ /**
+ * Replace an input parameter on the request.
+ *
+ * @param {String} name Name of the input parameter without @ char.
+ * @param {*} [type] SQL data type of input parameter. If you omit type, module automaticaly decide which SQL data type should be used based on JS data type.
+ * @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values.
+ * @return {Request}
+ */
-/***/ 64849:
-/***/ ((module) => {
+ replaceInput (name, type, value) {
+ delete this.parameters[name]
+ return this.input(name, type, value)
+ }
-/**
- * PoolSelector
- */
-var PoolSelector = module.exports = {};
+ /**
+ * Add an output parameter to the request.
+ *
+ * @param {String} name Name of the output parameter without @ char.
+ * @param {*} type SQL data type of output parameter.
+ * @param {*} [value] Output parameter value initial value. `undefined` and `NaN` values are automatically converted to `null` values. Optional.
+ * @return {Request}
+ */
-PoolSelector.RR = function PoolSelectorRoundRobin() {
- var index = 0;
+ output (name, type, value) {
+ if (!type) { type = TYPES.NVarChar }
- return function(clusterIds) {
- if (index >= clusterIds.length) {
- index = 0;
+ if ((/(--| |\/\*|\*\/|')/).test(name)) {
+ throw new RequestError(`SQL injection warning for param '${name}'`, 'EINJECT')
}
- var clusterId = clusterIds[index++];
-
- return clusterId;
- };
-};
+ if ((type === TYPES.Text) || (type === TYPES.NText) || (type === TYPES.Image)) {
+ throw new RequestError('Deprecated types (Text, NText, Image) are not supported as OUTPUT parameters.', 'EDEPRECATED')
+ }
-PoolSelector.RANDOM = function PoolSelectorRandom() {
- return function(clusterIds) {
- return clusterIds[Math.floor(Math.random() * clusterIds.length)];
- };
-};
+ // support for custom data types
+ if (value && typeof value.valueOf === 'function' && !(value instanceof Date)) value = value.valueOf()
-PoolSelector.ORDER = function PoolSelectorOrder() {
- return function(clusterIds) {
- return clusterIds[0];
- };
-};
+ if (value === undefined) value = null // undefined to null
+ if (typeof value === 'number' && isNaN(value)) value = null // NaN to null
+ if (type instanceof Function) type = type()
+ if (objectHasProperty(this.parameters, name)) {
+ throw new RequestError(`The parameter name ${name} has already been declared. Parameter names must be unique`, 'EDUPEPARAM')
+ }
-/***/ }),
+ this.parameters[name] = {
+ name,
+ type: type.type,
+ io: 2,
+ value,
+ length: type.length,
+ scale: type.scale,
+ precision: type.precision
+ }
-/***/ 37806:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ return this
+ }
-var Buffer = __nccwpck_require__(21867).Buffer;
-var Crypto = __nccwpck_require__(76417);
-var Auth = exports;
+ /**
+ * Replace an output parameter on the request.
+ *
+ * @param {String} name Name of the output parameter without @ char.
+ * @param {*} type SQL data type of output parameter.
+ * @param {*} [value] Output parameter value initial value. `undefined` and `NaN` values are automatically converted to `null` values. Optional.
+ * @return {Request}
+ */
-function auth(name, data, options) {
- options = options || {};
+ replaceOutput (name, type, value) {
+ delete this.parameters[name]
- switch (name) {
- case 'mysql_native_password':
- return Auth.token(options.password, data.slice(0, 20));
- default:
- return undefined;
+ return this.output(name, type, value)
}
-}
-Auth.auth = auth;
-
-function sha1(msg) {
- var hash = Crypto.createHash('sha1');
- hash.update(msg, 'binary');
- return hash.digest('binary');
-}
-Auth.sha1 = sha1;
-function xor(a, b) {
- a = Buffer.from(a, 'binary');
- b = Buffer.from(b, 'binary');
- var result = Buffer.allocUnsafe(a.length);
- for (var i = 0; i < a.length; i++) {
- result[i] = (a[i] ^ b[i]);
- }
- return result;
-}
-Auth.xor = xor;
+ /**
+ * Execute the SQL batch.
+ *
+ * @param {String} batch T-SQL batch to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
-Auth.token = function(password, scramble) {
- if (!password) {
- return Buffer.alloc(0);
- }
+ batch (batch, callback) {
+ if (this.stream == null && this.connection) this.stream = this.connection.config.stream
+ if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
+ this.rowsAffected = 0
- // password must be in binary format, not utf8
- var stage1 = sha1((Buffer.from(password, 'utf8')).toString('binary'));
- var stage2 = sha1(stage1);
- var stage3 = sha1(scramble.toString('binary') + stage2);
- return xor(stage3, stage1);
-};
+ if (typeof callback === 'function') {
+ this._batch(batch, (err, recordsets, output, rowsAffected) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
-// This is a port of sql/password.c:hash_password which needs to be used for
-// pre-4.1 passwords.
-Auth.hashPassword = function(password) {
- var nr = [0x5030, 0x5735];
- var add = 7;
- var nr2 = [0x1234, 0x5671];
- var result = Buffer.alloc(8);
+ this.emit('done', {
+ output,
+ rowsAffected
+ })
+ }
- if (typeof password === 'string'){
- password = Buffer.from(password);
- }
+ if (err) return callback(err)
+ callback(null, {
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected
+ })
+ })
+ return this
+ }
- for (var i = 0; i < password.length; i++) {
- var c = password[i];
- if (c === 32 || c === 9) {
- // skip space in password
- continue;
+ // Check is method was called as tagged template
+ if (typeof batch === 'object') {
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
+ batch = this._template(strings, values)
}
- // nr^= (((nr & 63)+add)*c)+ (nr << 8);
- // nr = xor(nr, add(mul(add(and(nr, 63), add), c), shl(nr, 8)))
- nr = this.xor32(nr, this.add32(this.mul32(this.add32(this.and32(nr, [0, 63]), [0, add]), [0, c]), this.shl32(nr, 8)));
+ return new shared.Promise((resolve, reject) => {
+ this._batch(batch, (err, recordsets, output, rowsAffected) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
- // nr2+=(nr2 << 8) ^ nr;
- // nr2 = add(nr2, xor(shl(nr2, 8), nr))
- nr2 = this.add32(nr2, this.xor32(this.shl32(nr2, 8), nr));
+ this.emit('done', {
+ output,
+ rowsAffected
+ })
+ }
- // add+=tmp;
- add += c;
+ if (err) return reject(err)
+ resolve({
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected
+ })
+ })
+ })
}
- this.int31Write(result, nr, 0);
- this.int31Write(result, nr2, 4);
-
- return result;
-};
-
-Auth.randomInit = function(seed1, seed2) {
- return {
- max_value : 0x3FFFFFFF,
- max_value_dbl : 0x3FFFFFFF,
- seed1 : seed1 % 0x3FFFFFFF,
- seed2 : seed2 % 0x3FFFFFFF
- };
-};
+ /**
+ * @private
+ * @param {String} batch
+ * @param {Request~requestCallback} callback
+ */
-Auth.myRnd = function(r){
- r.seed1 = (r.seed1 * 3 + r.seed2) % r.max_value;
- r.seed2 = (r.seed1 + r.seed2 + 33) % r.max_value;
+ _batch (batch, callback) {
+ if (!this.connection) {
+ return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
+ }
- return r.seed1 / r.max_value_dbl;
-};
+ if (!this.connection.connected) {
+ return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
+ }
-Auth.scramble323 = function(message, password) {
- if (!password) {
- return Buffer.alloc(0);
+ this.canceled = false
+ setImmediate(callback)
}
- var to = Buffer.allocUnsafe(8);
- var hashPass = this.hashPassword(password);
- var hashMessage = this.hashPassword(message.slice(0, 8));
- var seed1 = this.int32Read(hashPass, 0) ^ this.int32Read(hashMessage, 0);
- var seed2 = this.int32Read(hashPass, 4) ^ this.int32Read(hashMessage, 4);
- var r = this.randomInit(seed1, seed2);
+ /**
+ * Bulk load.
+ *
+ * @param {Table} table SQL table.
+ * @param {object} [options] Options to be passed to the underlying driver (tedious only).
+ * @param {Request~bulkCallback} [callback] A callback which is called after bulk load has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
- for (var i = 0; i < 8; i++){
- to[i] = Math.floor(this.myRnd(r) * 31) + 64;
- }
- var extra = (Math.floor(this.myRnd(r) * 31));
+ bulk (table, options, callback) {
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ } else if (typeof options === 'undefined') {
+ options = {}
+ }
- for (var i = 0; i < 8; i++){
- to[i] ^= extra;
- }
+ if (this.stream == null && this.connection) this.stream = this.connection.config.stream
+ if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
- return to;
-};
+ if (this.stream || typeof callback === 'function') {
+ this._bulk(table, options, (err, rowsAffected) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ return this.emit('done', {
+ rowsAffected
+ })
+ }
-Auth.xor32 = function(a, b){
- return [a[0] ^ b[0], a[1] ^ b[1]];
-};
+ if (err) return callback(err)
+ callback(null, {
+ rowsAffected
+ })
+ })
+ return this
+ }
-Auth.add32 = function(a, b){
- var w1 = a[1] + b[1];
- var w2 = a[0] + b[0] + ((w1 & 0xFFFF0000) >> 16);
+ return new shared.Promise((resolve, reject) => {
+ this._bulk(table, options, (err, rowsAffected) => {
+ if (err) return reject(err)
+ resolve({
+ rowsAffected
+ })
+ })
+ })
+ }
- return [w2 & 0xFFFF, w1 & 0xFFFF];
-};
+ /**
+ * @private
+ * @param {Table} table
+ * @param {object} options
+ * @param {Request~bulkCallback} callback
+ */
-Auth.mul32 = function(a, b){
- // based on this example of multiplying 32b ints using 16b
- // http://www.dsprelated.com/showmessage/89790/1.php
- var w1 = a[1] * b[1];
- var w2 = (((a[1] * b[1]) >> 16) & 0xFFFF) + ((a[0] * b[1]) & 0xFFFF) + (a[1] * b[0] & 0xFFFF);
+ _bulk (table, options, callback) {
+ if (!this.parent) {
+ return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
+ }
- return [w2 & 0xFFFF, w1 & 0xFFFF];
-};
+ if (!this.parent.connected) {
+ return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
+ }
-Auth.and32 = function(a, b){
- return [a[0] & b[0], a[1] & b[1]];
-};
+ this.canceled = false
+ setImmediate(callback)
+ }
-Auth.shl32 = function(a, b){
- // assume b is 16 or less
- var w1 = a[1] << b;
- var w2 = (a[0] << b) | ((w1 & 0xFFFF0000) >> 16);
+ /**
+ * Sets request to `stream` mode and pulls all rows from all recordsets to a given stream.
+ *
+ * @param {Stream} stream Stream to pipe data into.
+ * @return {Stream}
+ */
- return [w2 & 0xFFFF, w1 & 0xFFFF];
-};
+ pipe (stream) {
+ this.stream = true
+ this.on('row', stream.write.bind(stream))
+ this.on('error', stream.emit.bind(stream, 'error'))
+ this.on('done', () => {
+ setImmediate(() => stream.end())
+ })
+ stream.emit('pipe', this)
+ return stream
+ }
-Auth.int31Write = function(buffer, number, offset) {
- buffer[offset] = (number[0] >> 8) & 0x7F;
- buffer[offset + 1] = (number[0]) & 0xFF;
- buffer[offset + 2] = (number[1] >> 8) & 0xFF;
- buffer[offset + 3] = (number[1]) & 0xFF;
-};
+ /**
+ * Execute the SQL command.
+ *
+ * @param {String} command T-SQL command to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
-Auth.int32Read = function(buffer, offset){
- return (buffer[offset] << 24)
- + (buffer[offset + 1] << 16)
- + (buffer[offset + 2] << 8)
- + (buffer[offset + 3]);
-};
+ query (command, callback) {
+ if (this.stream == null && this.connection) this.stream = this.connection.config.stream
+ if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
+ this.rowsAffected = 0
+ if (typeof callback === 'function') {
+ this._query(command, (err, recordsets, output, rowsAffected, columns) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
-/***/ }),
+ this.emit('done', {
+ output,
+ rowsAffected
+ })
+ }
-/***/ 87768:
-/***/ ((module) => {
+ if (err) return callback(err)
+ const result = {
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected
+ }
+ if (this.arrayRowMode) result.columns = columns
+ callback(null, result)
+ })
+ return this
+ }
+ // Check is method was called as tagged template
+ if (typeof command === 'object') {
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
+ command = this._template(strings, values)
+ }
-module.exports = BufferList;
-function BufferList() {
- this.bufs = [];
- this.size = 0;
-}
+ return new shared.Promise((resolve, reject) => {
+ this._query(command, (err, recordsets, output, rowsAffected, columns) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
-BufferList.prototype.shift = function shift() {
- var buf = this.bufs.shift();
+ this.emit('done', {
+ output,
+ rowsAffected
+ })
+ }
- if (buf) {
- this.size -= buf.length;
+ if (err) return reject(err)
+ const result = {
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected
+ }
+ if (this.arrayRowMode) result.columns = columns
+ resolve(result)
+ })
+ })
}
- return buf;
-};
-
-BufferList.prototype.push = function push(buf) {
- if (!buf || !buf.length) {
- return;
- }
+ /**
+ * @private
+ * @param {String} command
+ * @param {Request~bulkCallback} callback
+ */
- this.bufs.push(buf);
- this.size += buf.length;
-};
+ _query (command, callback) {
+ if (!this.parent) {
+ return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
+ }
+ if (!this.parent.connected) {
+ return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
+ }
-/***/ }),
+ this.canceled = false
+ setImmediate(callback)
+ }
-/***/ 32114:
-/***/ ((module) => {
+ /**
+ * Call a stored procedure.
+ *
+ * @param {String} procedure Name of the stored procedure to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
-module.exports = PacketHeader;
-function PacketHeader(length, number) {
- this.length = length;
- this.number = number;
-}
+ execute (command, callback) {
+ if (this.stream == null && this.connection) this.stream = this.connection.config.stream
+ if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
+ this.rowsAffected = 0
+ if (typeof callback === 'function') {
+ this._execute(command, (err, recordsets, output, returnValue, rowsAffected, columns) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
-/***/ }),
+ this.emit('done', {
+ output,
+ rowsAffected,
+ returnValue
+ })
+ }
-/***/ 36639:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ if (err) return callback(err)
+ const result = {
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected,
+ returnValue
+ }
+ if (this.arrayRowMode) result.columns = columns
+ callback(null, result)
+ })
+ return this
+ }
-var BIT_16 = Math.pow(2, 16);
-var BIT_24 = Math.pow(2, 24);
-var BUFFER_ALLOC_SIZE = Math.pow(2, 8);
-// The maximum precision JS Numbers can hold precisely
-// Don't panic: Good enough to represent byte values up to 8192 TB
-var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53);
-var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1;
-var Buffer = __nccwpck_require__(21867).Buffer;
+ return new shared.Promise((resolve, reject) => {
+ this._execute(command, (err, recordsets, output, returnValue, rowsAffected, columns) => {
+ if (this.stream) {
+ if (err) this.emit('error', err)
+ err = null
-module.exports = PacketWriter;
-function PacketWriter() {
- this._buffer = null;
- this._offset = 0;
-}
+ this.emit('done', {
+ output,
+ rowsAffected,
+ returnValue
+ })
+ }
-PacketWriter.prototype.toBuffer = function toBuffer(parser) {
- if (!this._buffer) {
- this._buffer = Buffer.alloc(0);
- this._offset = 0;
+ if (err) return reject(err)
+ const result = {
+ recordsets,
+ recordset: recordsets && recordsets[0],
+ output,
+ rowsAffected,
+ returnValue
+ }
+ if (this.arrayRowMode) result.columns = columns
+ resolve(result)
+ })
+ })
}
- var buffer = this._buffer;
- var length = this._offset;
- var packets = Math.floor(length / MAX_PACKET_LENGTH) + 1;
-
- this._buffer = Buffer.allocUnsafe(length + packets * 4);
- this._offset = 0;
+ /**
+ * @private
+ * @param {String} procedure
+ * @param {Request~bulkCallback} callback
+ */
- for (var packet = 0; packet < packets; packet++) {
- var isLast = (packet + 1 === packets);
- var packetLength = (isLast)
- ? length % MAX_PACKET_LENGTH
- : MAX_PACKET_LENGTH;
+ _execute (procedure, callback) {
+ if (!this.parent) {
+ return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
+ }
- var packetNumber = parser.incrementPacketNumber();
+ if (!this.parent.connected) {
+ return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
+ }
- this.writeUnsignedNumber(3, packetLength);
- this.writeUnsignedNumber(1, packetNumber);
+ this.canceled = false
+ setImmediate(callback)
+ }
- var start = packet * MAX_PACKET_LENGTH;
- var end = start + packetLength;
+ /**
+ * Cancel currently executed request.
+ *
+ * @return {Boolean}
+ */
- this.writeBuffer(buffer.slice(start, end));
+ cancel () {
+ this._cancel()
+ return true
}
- return this._buffer;
-};
-
-PacketWriter.prototype.writeUnsignedNumber = function(bytes, value) {
- this._allocate(bytes);
+ /**
+ * @private
+ */
- for (var i = 0; i < bytes; i++) {
- this._buffer[this._offset++] = (value >> (i * 8)) & 0xff;
+ _cancel () {
+ this.canceled = true
}
-};
-PacketWriter.prototype.writeFiller = function(bytes) {
- this._allocate(bytes);
-
- for (var i = 0; i < bytes; i++) {
- this._buffer[this._offset++] = 0x00;
+ pause () {
+ if (this.stream) {
+ this._pause()
+ return true
+ }
+ return false
}
-};
-PacketWriter.prototype.writeNullTerminatedString = function(value, encoding) {
- // Typecast undefined into '' and numbers into strings
- value = value || '';
- value = value + '';
+ _pause () {
+ this._paused = true
+ }
- var bytes = Buffer.byteLength(value, encoding || 'utf-8') + 1;
- this._allocate(bytes);
+ resume () {
+ if (this.stream) {
+ this._resume()
+ return true
+ }
+ return false
+ }
- this._buffer.write(value, this._offset, encoding);
- this._buffer[this._offset + bytes - 1] = 0x00;
+ _resume () {
+ this._paused = false
+ }
- this._offset += bytes;
-};
+ _setCurrentRequest (request) {
+ this._currentRequest = request
+ if (this._paused) {
+ this.pause()
+ }
+ return this
+ }
+}
-PacketWriter.prototype.writeString = function(value) {
- // Typecast undefined into '' and numbers into strings
- value = value || '';
- value = value + '';
+module.exports = Request
- var bytes = Buffer.byteLength(value, 'utf-8');
- this._allocate(bytes);
- this._buffer.write(value, this._offset, 'utf-8');
+/***/ }),
- this._offset += bytes;
-};
+/***/ 2555:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-PacketWriter.prototype.writeBuffer = function(value) {
- var bytes = value.length;
+"use strict";
- this._allocate(bytes);
- value.copy(this._buffer, this._offset);
- this._offset += bytes;
-};
-PacketWriter.prototype.writeLengthCodedNumber = function(value) {
- if (value === null) {
- this._allocate(1);
- this._buffer[this._offset++] = 251;
- return;
- }
+const debug = __nccwpck_require__(38237)('mssql:base')
+const { EventEmitter } = __nccwpck_require__(28614)
+const { IDS } = __nccwpck_require__(14178)
+const globalConnection = __nccwpck_require__(89105)
+const { TransactionError } = __nccwpck_require__(25903)
+const shared = __nccwpck_require__(67636)
+const ISOLATION_LEVEL = __nccwpck_require__(62202)
- if (value <= 250) {
- this._allocate(1);
- this._buffer[this._offset++] = value;
- return;
- }
+/**
+ * Class Transaction.
+ *
+ * @property {Number} isolationLevel Controls the locking and row versioning behavior of TSQL statements issued by a connection. READ_COMMITTED by default.
+ * @property {String} name Transaction name. Empty string by default.
+ *
+ * @fires Transaction#begin
+ * @fires Transaction#commit
+ * @fires Transaction#rollback
+ */
- if (value > IEEE_754_BINARY_64_PRECISION) {
- throw new Error(
- 'writeLengthCodedNumber: JS precision range exceeded, your ' +
- 'number is > 53 bit: "' + value + '"'
- );
- }
+class Transaction extends EventEmitter {
+ /**
+ * Create new Transaction.
+ *
+ * @param {Connection} [parent] If ommited, global connection is used instead.
+ */
- if (value < BIT_16) {
- this._allocate(3);
- this._buffer[this._offset++] = 252;
- } else if (value < BIT_24) {
- this._allocate(4);
- this._buffer[this._offset++] = 253;
- } else {
- this._allocate(9);
- this._buffer[this._offset++] = 254;
- }
+ constructor (parent) {
+ super()
- // 16 Bit
- this._buffer[this._offset++] = value & 0xff;
- this._buffer[this._offset++] = (value >> 8) & 0xff;
+ IDS.add(this, 'Transaction')
+ debug('transaction(%d): created', IDS.get(this))
- if (value < BIT_16) {
- return;
+ this.parent = parent || globalConnection.pool
+ this.isolationLevel = Transaction.defaultIsolationLevel
+ this.name = ''
}
- // 24 Bit
- this._buffer[this._offset++] = (value >> 16) & 0xff;
-
- if (value < BIT_24) {
- return;
+ get connected () {
+ return this.parent.connected
}
- this._buffer[this._offset++] = (value >> 24) & 0xff;
-
- // Hack: Get the most significant 32 bit (JS bitwise operators are 32 bit)
- value = value.toString(2);
- value = value.substr(0, value.length - 32);
- value = parseInt(value, 2);
-
- this._buffer[this._offset++] = value & 0xff;
- this._buffer[this._offset++] = (value >> 8) & 0xff;
- this._buffer[this._offset++] = (value >> 16) & 0xff;
-
- // Set last byte to 0, as we can only support 53 bits in JS (see above)
- this._buffer[this._offset++] = 0;
-};
+ /**
+ * Acquire connection from connection pool.
+ *
+ * @param {Request} request Request.
+ * @param {ConnectionPool~acquireCallback} [callback] A callback which is called after connection has established, or an error has occurred. If omited, method returns Promise.
+ * @return {Transaction|Promise}
+ */
-PacketWriter.prototype.writeLengthCodedBuffer = function(value) {
- var bytes = value.length;
- this.writeLengthCodedNumber(bytes);
- this.writeBuffer(value);
-};
+ acquire (request, callback) {
+ if (!this._acquiredConnection) {
+ setImmediate(callback, new TransactionError('Transaction has not begun. Call begin() first.', 'ENOTBEGUN'))
+ return this
+ }
-PacketWriter.prototype.writeNullTerminatedBuffer = function(value) {
- this.writeBuffer(value);
- this.writeFiller(1); // 0x00 terminator
-};
+ if (this._activeRequest) {
+ setImmediate(callback, new TransactionError("Can't acquire connection for the request. There is another request in progress.", 'EREQINPROG'))
+ return this
+ }
-PacketWriter.prototype.writeLengthCodedString = function(value) {
- if (value === null) {
- this.writeLengthCodedNumber(null);
- return;
+ this._activeRequest = request
+ setImmediate(callback, null, this._acquiredConnection, this._acquiredConfig)
+ return this
}
- value = (value === undefined)
- ? ''
- : String(value);
-
- var bytes = Buffer.byteLength(value, 'utf-8');
- this.writeLengthCodedNumber(bytes);
-
- if (!bytes) {
- return;
- }
+ /**
+ * Release connection back to the pool.
+ *
+ * @param {Connection} connection Previously acquired connection.
+ * @return {Transaction}
+ */
- this._allocate(bytes);
- this._buffer.write(value, this._offset, 'utf-8');
- this._offset += bytes;
-};
+ release (connection) {
+ if (connection === this._acquiredConnection) {
+ this._activeRequest = null
+ }
-PacketWriter.prototype._allocate = function _allocate(bytes) {
- if (!this._buffer) {
- this._buffer = Buffer.alloc(Math.max(BUFFER_ALLOC_SIZE, bytes));
- this._offset = 0;
- return;
+ return this
}
- var bytesRemaining = this._buffer.length - this._offset;
- if (bytesRemaining >= bytes) {
- return;
- }
+ /**
+ * Begin a transaction.
+ *
+ * @param {Number} [isolationLevel] Controls the locking and row versioning behavior of TSQL statements issued by a connection.
+ * @param {basicCallback} [callback] A callback which is called after transaction has began, or an error has occurred. If omited, method returns Promise.
+ * @return {Transaction|Promise}
+ */
- var newSize = this._buffer.length + Math.max(BUFFER_ALLOC_SIZE, bytes);
- var oldBuffer = this._buffer;
+ begin (isolationLevel, callback) {
+ if (isolationLevel instanceof Function) {
+ callback = isolationLevel
+ isolationLevel = undefined
+ }
- this._buffer = Buffer.alloc(newSize);
- oldBuffer.copy(this._buffer);
-};
+ if (typeof callback === 'function') {
+ this._begin(isolationLevel, err => {
+ if (!err) {
+ this.emit('begin')
+ }
+ callback(err)
+ })
+ return this
+ }
+ return new shared.Promise((resolve, reject) => {
+ this._begin(isolationLevel, err => {
+ if (err) return reject(err)
+ this.emit('begin')
+ resolve(this)
+ })
+ })
+ }
-/***/ }),
+ /**
+ * @private
+ * @param {Number} [isolationLevel]
+ * @param {basicCallback} [callback]
+ * @return {Transaction}
+ */
-/***/ 82017:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ _begin (isolationLevel, callback) {
+ if (this._acquiredConnection) {
+ return setImmediate(callback, new TransactionError('Transaction has already begun.', 'EALREADYBEGUN'))
+ }
-var PacketHeader = __nccwpck_require__(32114);
-var BigNumber = __nccwpck_require__(87558);
-var Buffer = __nccwpck_require__(21867).Buffer;
-var BufferList = __nccwpck_require__(87768);
+ this._aborted = false
+ this._rollbackRequested = false
+ if (isolationLevel) {
+ if (Object.keys(ISOLATION_LEVEL).some(key => {
+ return ISOLATION_LEVEL[key] === isolationLevel
+ })) {
+ this.isolationLevel = isolationLevel
+ } else {
+ throw new TransactionError('Invalid isolation level.')
+ }
+ }
-var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1;
-var MUL_32BIT = Math.pow(2, 32);
-var PACKET_HEADER_LENGTH = 4;
+ setImmediate(callback)
+ }
-module.exports = Parser;
-function Parser(options) {
- options = options || {};
+ /**
+ * Commit a transaction.
+ *
+ * @param {basicCallback} [callback] A callback which is called after transaction has commited, or an error has occurred. If omited, method returns Promise.
+ * @return {Transaction|Promise}
+ */
- this._supportBigNumbers = options.config && options.config.supportBigNumbers;
- this._buffer = Buffer.alloc(0);
- this._nextBuffers = new BufferList();
- this._longPacketBuffers = new BufferList();
- this._offset = 0;
- this._packetEnd = null;
- this._packetHeader = null;
- this._packetOffset = null;
- this._onError = options.onError || function(err) { throw err; };
- this._onPacket = options.onPacket || function() {};
- this._nextPacketNumber = 0;
- this._encoding = 'utf-8';
- this._paused = false;
-}
+ commit (callback) {
+ if (typeof callback === 'function') {
+ this._commit(err => {
+ if (!err) {
+ this.emit('commit')
+ }
+ callback(err)
+ })
+ return this
+ }
-Parser.prototype.write = function write(chunk) {
- this._nextBuffers.push(chunk);
+ return new shared.Promise((resolve, reject) => {
+ this._commit(err => {
+ if (err) return reject(err)
+ this.emit('commit')
+ resolve()
+ })
+ })
+ }
- while (!this._paused) {
- var packetHeader = this._tryReadPacketHeader();
+ /**
+ * @private
+ * @param {basicCallback} [callback]
+ * @return {Transaction}
+ */
- if (!packetHeader) {
- break;
+ _commit (callback) {
+ if (this._aborted) {
+ return setImmediate(callback, new TransactionError('Transaction has been aborted.', 'EABORT'))
}
- if (!this._combineNextBuffers(packetHeader.length)) {
- break;
+ if (!this._acquiredConnection) {
+ return setImmediate(callback, new TransactionError('Transaction has not begun. Call begin() first.', 'ENOTBEGUN'))
}
- this._parsePacket(packetHeader);
- }
-};
+ if (this._activeRequest) {
+ return setImmediate(callback, new TransactionError("Can't commit transaction. There is a request in progress.", 'EREQINPROG'))
+ }
-Parser.prototype.append = function append(chunk) {
- if (!chunk || chunk.length === 0) {
- return;
+ setImmediate(callback)
}
- // Calculate slice ranges
- var sliceEnd = this._buffer.length;
- var sliceStart = this._packetOffset === null
- ? this._offset
- : this._packetOffset;
- var sliceLength = sliceEnd - sliceStart;
-
- // Get chunk data
- var buffer = null;
- var chunks = !(chunk instanceof Array || Array.isArray(chunk)) ? [chunk] : chunk;
- var length = 0;
- var offset = 0;
+ /**
+ * Returns new request using this transaction.
+ *
+ * @return {Request}
+ */
- for (var i = 0; i < chunks.length; i++) {
- length += chunks[i].length;
+ request () {
+ return new shared.driver.Request(this)
}
- if (sliceLength !== 0) {
- // Create a new Buffer
- buffer = Buffer.allocUnsafe(sliceLength + length);
- offset = 0;
-
- // Copy data slice
- offset += this._buffer.copy(buffer, 0, sliceStart, sliceEnd);
+ /**
+ * Rollback a transaction.
+ *
+ * @param {basicCallback} [callback] A callback which is called after transaction has rolled back, or an error has occurred. If omited, method returns Promise.
+ * @return {Transaction|Promise}
+ */
- // Copy chunks
- for (var i = 0; i < chunks.length; i++) {
- offset += chunks[i].copy(buffer, offset);
+ rollback (callback) {
+ if (typeof callback === 'function') {
+ this._rollback(err => {
+ if (!err) {
+ this.emit('rollback', this._aborted)
+ }
+ callback(err)
+ })
+ return this
}
- } else if (chunks.length > 1) {
- // Create a new Buffer
- buffer = Buffer.allocUnsafe(length);
- offset = 0;
- // Copy chunks
- for (var i = 0; i < chunks.length; i++) {
- offset += chunks[i].copy(buffer, offset);
- }
- } else {
- // Buffer is the only chunk
- buffer = chunks[0];
+ return new shared.Promise((resolve, reject) => {
+ return this._rollback(err => {
+ if (err) return reject(err)
+ this.emit('rollback', this._aborted)
+ resolve()
+ })
+ })
}
- // Adjust data-tracking pointers
- this._buffer = buffer;
- this._offset = this._offset - sliceStart;
- this._packetEnd = this._packetEnd !== null
- ? this._packetEnd - sliceStart
- : null;
- this._packetOffset = this._packetOffset !== null
- ? this._packetOffset - sliceStart
- : null;
-};
+ /**
+ * @private
+ * @param {basicCallback} [callback]
+ * @return {Transaction}
+ */
-Parser.prototype.pause = function() {
- this._paused = true;
-};
+ _rollback (callback) {
+ if (this._aborted) {
+ return setImmediate(callback, new TransactionError('Transaction has been aborted.', 'EABORT'))
+ }
-Parser.prototype.resume = function() {
- this._paused = false;
+ if (!this._acquiredConnection) {
+ return setImmediate(callback, new TransactionError('Transaction has not begun. Call begin() first.', 'ENOTBEGUN'))
+ }
- // nextTick() to avoid entering write() multiple times within the same stack
- // which would cause problems as write manipulates the state of the object.
- process.nextTick(this.write.bind(this));
-};
+ if (this._activeRequest) {
+ return setImmediate(callback, new TransactionError("Can't rollback transaction. There is a request in progress.", 'EREQINPROG'))
+ }
-Parser.prototype.peak = function peak(offset) {
- return this._buffer[this._offset + (offset >>> 0)];
-};
+ this._rollbackRequested = true
-Parser.prototype.parseUnsignedNumber = function parseUnsignedNumber(bytes) {
- if (bytes === 1) {
- return this._buffer[this._offset++];
+ setImmediate(callback)
}
+}
- var buffer = this._buffer;
- var offset = this._offset + bytes - 1;
- var value = 0;
-
- if (bytes > 4) {
- var err = new Error('parseUnsignedNumber: Supports only up to 4 bytes');
- err.offset = (this._offset - this._packetOffset - 1);
- err.code = 'PARSER_UNSIGNED_TOO_LONG';
- throw err;
- }
+/**
+ * Default isolation level used for any transactions that don't explicitly specify an isolation level.
+ *
+ * @type {number}
+ */
+Transaction.defaultIsolationLevel = ISOLATION_LEVEL.READ_COMMITTED
- while (offset >= this._offset) {
- value = ((value << 8) | buffer[offset]) >>> 0;
- offset--;
- }
+module.exports = Transaction
- this._offset += bytes;
- return value;
-};
+/***/ }),
-Parser.prototype.parseLengthCodedString = function() {
- var length = this.parseLengthCodedNumber();
+/***/ 33560:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (length === null) {
- return null;
- }
+"use strict";
- return this.parseString(length);
-};
-Parser.prototype.parseLengthCodedBuffer = function() {
- var length = this.parseLengthCodedNumber();
+const URL = __nccwpck_require__(78835).URL
- if (length === null) {
- return null;
+const IGNORE_KEYS = ['stream']
+const oror = function () {
+ for (let i = 0, l = arguments.length; i < l; i++) {
+ if (arguments[i] !== null && arguments[i] !== undefined) {
+ return arguments[i]
+ }
}
+}
- return this.parseBuffer(length);
-};
+const parseConnectionURI = function (uri) {
+ const parsed = new URL(uri)
+ let instance
+ let user
+ let password
-Parser.prototype.parseLengthCodedNumber = function parseLengthCodedNumber() {
- if (this._offset >= this._buffer.length) {
- var err = new Error('Parser: read past end');
- err.offset = (this._offset - this._packetOffset);
- err.code = 'PARSER_READ_PAST_END';
- throw err;
+ const path = parsed.pathname.substr(1).split('/')
+ if (path.length > 1) {
+ instance = path.shift()
}
- var bits = this._buffer[this._offset++];
+ if (parsed.username) {
+ const auth = [parsed.username, parsed.password]
+ user = decodeURIComponent(auth.shift())
+ password = decodeURIComponent(auth.join(':'))
+ }
- if (bits <= 250) {
- return bits;
+ const port = parsed.port ? `,${parsed.port}` : (instance ? `\\${instance}` : '')
+ const object = {
+ server: `${parsed.hostname}${port}`,
+ uid: user || '',
+ pwd: password || '',
+ database: path[0]
}
- switch (bits) {
- case 251:
- return null;
- case 252:
- return this.parseUnsignedNumber(2);
- case 253:
- return this.parseUnsignedNumber(3);
- case 254:
- break;
- default:
- var err = new Error('Unexpected first byte' + (bits ? ': 0x' + bits.toString(16) : ''));
- err.offset = (this._offset - this._packetOffset - 1);
- err.code = 'PARSER_BAD_LENGTH_BYTE';
- throw err;
+ if (parsed.searchParams) {
+ parsed.searchParams.forEach((value, key) => {
+ if (key === 'domain') {
+ object.uid = `${value}\\${object.uid}`
+ } else {
+ object[key] = value
+ }
+ })
}
- var low = this.parseUnsignedNumber(4);
- var high = this.parseUnsignedNumber(4);
- var value;
-
- if (high >>> 21) {
- value = BigNumber(MUL_32BIT).times(high).plus(low).toString();
-
- if (this._supportBigNumbers) {
- return value;
+ Object.defineProperty(object, 'toString', {
+ value () {
+ const out = []
+ for (const key in this) {
+ if (IGNORE_KEYS.indexOf(key) === -1) {
+ out.push(`${key}={${this[key]}}`)
+ }
+ }
+ return out.join(';')
}
+ })
- var err = new Error(
- 'parseLengthCodedNumber: JS precision range exceeded, ' +
- 'number is >= 53 bit: "' + value + '"'
- );
- err.offset = (this._offset - this._packetOffset - 8);
- err.code = 'PARSER_JS_PRECISION_RANGE_EXCEEDED';
- throw err;
- }
-
- value = low + (MUL_32BIT * high);
-
- return value;
-};
+ return object
+}
-Parser.prototype.parseFiller = function(length) {
- return this.parseBuffer(length);
-};
+const parseConnectionString = function (string) {
+ let cursor = 0
+ let parsing = 'name'
+ let param = null
+ let buffer = ''
+ let quotes = null
+ const parsed = {}
+ const original = {}
-Parser.prototype.parseNullTerminatedBuffer = function() {
- var end = this._nullByteOffset();
- var value = this._buffer.slice(this._offset, end);
- this._offset = end + 1;
+ Object.defineProperty(parsed, '__original__', { value: original })
+ Object.defineProperty(parsed, 'toString', {
+ value () {
+ const out = []
+ for (const key in this) {
+ if (IGNORE_KEYS.indexOf(key) === -1) {
+ const esc = original[key].escape || ['', '']
+ out.push(`${original[key].name}=${esc[0] || ''}${this[key]}${esc[1] || ''}`)
+ }
+ }
+ return out.join(';')
+ }
+ })
- return value;
-};
+ while (cursor < string.length) {
+ const char = string.charAt(cursor)
+ switch (char) {
+ case '=':
+ if (parsing === 'name') {
+ buffer = buffer.trim()
+ param = buffer.toLowerCase()
+ original[param] = { name: buffer }
+ parsing = 'value'
+ buffer = ''
+ } else {
+ buffer += char
+ }
+ break
-Parser.prototype.parseNullTerminatedString = function() {
- var end = this._nullByteOffset();
- var value = this._buffer.toString(this._encoding, this._offset, end);
- this._offset = end + 1;
+ case '\'': case '"':
+ if (parsing === 'value') {
+ if (!buffer.trim().length) {
+ // value is wrapped in qotes
+ original[param].escape = [char, char]
+ quotes = char
+ buffer = ''
+ } else if (quotes) {
+ if (char === quotes) {
+ // found same char as used for wrapping quotes
+ if (char === string.charAt(cursor + 1)) {
+ // escaped quote
+ buffer += char
+ cursor++
+ } else {
+ // end of value
+ parsed[param] = buffer
+ param = null
+ parsing = null
+ buffer = ''
+ quotes = null
+ }
+ } else {
+ buffer += char
+ }
+ } else {
+ buffer += char
+ }
+ } else {
+ throw new Error('Invalid connection string.')
+ }
+ break
- return value;
-};
+ case '{':
+ if (parsing === 'value') {
+ if (buffer.trim().length === 0) {
+ // value is wrapped in qotes
+ original[param].escape = ['{', '}']
+ quotes = '{}'
+ buffer = ''
+ } else {
+ buffer += char
+ }
+ } else {
+ throw new Error('Invalid connection string.')
+ }
+ break
-Parser.prototype._nullByteOffset = function() {
- var offset = this._offset;
+ case '}':
+ if (parsing === 'value') {
+ if (quotes === '{}') {
+ // end of value
+ parsed[param] = buffer
+ param = null
+ parsing = null
+ buffer = ''
+ quotes = null
+ } else {
+ buffer += char
+ }
+ } else {
+ throw new Error('Invalid connection string.')
+ }
+ break
- while (this._buffer[offset] !== 0x00) {
- offset++;
+ case ';':
+ if (parsing === 'value') {
+ if (quotes) {
+ buffer += char
+ } else {
+ // end of value
+ parsed[param] = buffer
+ param = null
+ parsing = 'name'
+ buffer = ''
+ }
+ } else {
+ buffer = ''
+ parsing = 'name'
+ }
+ break
- if (offset >= this._buffer.length) {
- var err = new Error('Offset of null terminated string not found.');
- err.offset = (this._offset - this._packetOffset);
- err.code = 'PARSER_MISSING_NULL_BYTE';
- throw err;
+ default:
+ buffer += char
}
- }
-
- return offset;
-};
-
-Parser.prototype.parsePacketTerminatedBuffer = function parsePacketTerminatedBuffer() {
- var length = this._packetEnd - this._offset;
- return this.parseBuffer(length);
-};
-Parser.prototype.parsePacketTerminatedString = function() {
- var length = this._packetEnd - this._offset;
- return this.parseString(length);
-};
+ cursor++
+ }
-Parser.prototype.parseBuffer = function(length) {
- var response = Buffer.alloc(length);
- this._buffer.copy(response, 0, this._offset, this._offset + length);
+ if (parsing === 'value') {
+ // end of value
+ parsed[param] = buffer
+ }
- this._offset += length;
- return response;
-};
+ return parsed
+}
-Parser.prototype.parseString = function(length) {
- var offset = this._offset;
- var end = offset + length;
- var value = this._buffer.toString(this._encoding, offset, end);
+const resolveConnectionString = function (string, driver) {
+ const parsed = /^(mssql|tedious|msnodesql|tds):\/\//i.test(string) ? parseConnectionURI(string) : parseConnectionString(string)
+ const stream = (parsed.stream || '').toLowerCase()
+ const encrypt = (parsed.encrypt || '').toLowerCase()
- this._offset = end;
- return value;
-};
+ if (driver === 'msnodesqlv8') {
+ parsed.driver = 'SQL Server Native Client 11.0'
-Parser.prototype.parseGeometryValue = function() {
- var buffer = this.parseLengthCodedBuffer();
- var offset = 4;
+ if (parsed.__original__) {
+ parsed.__original__.driver = { name: 'Driver', escape: ['{', '}'] }
+ }
- if (buffer === null || !buffer.length) {
- return null;
+ return { connectionString: parsed.toString() }
}
- function parseGeometry() {
- var result = null;
- var byteOrder = buffer.readUInt8(offset); offset += 1;
- var wkbType = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
- switch (wkbType) {
- case 1: // WKBPoint
- var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- result = {x: x, y: y};
- break;
- case 2: // WKBLineString
- var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
- result = [];
- for (var i = numPoints; i > 0; i--) {
- var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- result.push({x: x, y: y});
- }
- break;
- case 3: // WKBPolygon
- var numRings = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
- result = [];
- for (var i = numRings; i > 0; i--) {
- var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
- var line = [];
- for (var j = numPoints; j > 0; j--) {
- var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
- line.push({x: x, y: y});
- }
- result.push(line);
- }
- break;
- case 4: // WKBMultiPoint
- case 5: // WKBMultiLineString
- case 6: // WKBMultiPolygon
- case 7: // WKBGeometryCollection
- var num = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
- var result = [];
- for (var i = num; i > 0; i--) {
- result.push(parseGeometry());
- }
- break;
+ let user = parsed.uid || parsed.uid || parsed['user id']
+ let server = parsed.server || parsed.address || parsed.addr || parsed['data source'] || parsed['network address']
+
+ const config = {
+ password: oror(parsed.pwd, parsed.password),
+ database: oror(parsed.database, parsed['initial catalog']),
+ connectionTimeout: oror(parsed.connectionTimeout, parsed.timeout, parsed['connect timeout'], parsed['connection timeout']),
+ requestTimeout: oror(parsed.requestTimeout, parsed['request timeout']),
+ stream: stream === 'true' || stream === 'yes' || stream === '1',
+ options: {
+ readOnlyIntent: parsed.applicationintent && parsed.applicationintent.toLowerCase() === 'readonly',
+ encrypt: encrypt === 'true' || encrypt === 'yes' || encrypt === '1'
}
- return result;
}
- return parseGeometry();
-};
-
-Parser.prototype.reachedPacketEnd = function() {
- return this._offset === this._packetEnd;
-};
-
-Parser.prototype.incrementPacketNumber = function() {
- var currentPacketNumber = this._nextPacketNumber;
- this._nextPacketNumber = (this._nextPacketNumber + 1) % 256;
- return currentPacketNumber;
-};
+ if (parsed.useUTC != null) {
+ const utc = parsed.useUTC.toLowerCase()
+ config.options.useUTC = utc === 'true' || utc === 'yes' || utc === '1'
+ }
+ if (config.connectionTimeout != null) {
+ config.connectionTimeout = parseInt(config.connectionTimeout, 10) * 1000
+ }
+ if (config.requestTimeout != null) {
+ config.requestTimeout = parseInt(config.requestTimeout, 10)
+ }
-Parser.prototype.resetPacketNumber = function() {
- this._nextPacketNumber = 0;
-};
+ if (parsed.multisubnetfailover != null) {
+ config.options.multiSubnetFailover = parsed.multisubnetfailover.toLowerCase() === 'true'
+ }
-Parser.prototype.packetLength = function packetLength() {
- if (!this._packetHeader) {
- return null;
+ if (/^(.*)\\(.*)$/.exec(user)) {
+ config.domain = RegExp.$1
+ user = RegExp.$2
}
- return this._packetHeader.length + this._longPacketBuffers.size;
-};
+ if (server) {
+ server = server.trim()
-Parser.prototype._combineNextBuffers = function _combineNextBuffers(bytes) {
- var length = this._buffer.length - this._offset;
+ if (/^np:/i.test(server)) {
+ throw new Error('Connection via Named Pipes is not supported.')
+ }
- if (length >= bytes) {
- return true;
- }
+ if (/^tcp:/i.test(server)) {
+ server = server.substr(4)
+ }
- if ((length + this._nextBuffers.size) < bytes) {
- return false;
- }
+ if (/^(.*)\\(.*)$/.exec(server)) {
+ server = RegExp.$1
+ config.options.instanceName = RegExp.$2
+ }
- var buffers = [];
- var bytesNeeded = bytes - length;
+ if (/^(.*),(.*)$/.exec(server)) {
+ server = RegExp.$1.trim()
+ config.port = parseInt(RegExp.$2.trim(), 10)
+ }
- while (bytesNeeded > 0) {
- var buffer = this._nextBuffers.shift();
- buffers.push(buffer);
- bytesNeeded -= buffer.length;
+ if (server === '.' || server === '(.)' || server.toLowerCase() === '(localdb)' || server.toLowerCase() === '(local)') {
+ server = 'localhost'
+ }
}
- this.append(buffers);
- return true;
-};
-
-Parser.prototype._combineLongPacketBuffers = function _combineLongPacketBuffers() {
- if (!this._longPacketBuffers.size) {
- return;
- }
+ config.user = user
+ config.server = server
+ return config
+}
- // Calculate bytes
- var remainingBytes = this._buffer.length - this._offset;
- var trailingPacketBytes = this._buffer.length - this._packetEnd;
+module.exports = {
+ parse: parseConnectionString,
+ resolve: resolveConnectionString
+}
- // Create buffer
- var buf = null;
- var buffer = Buffer.allocUnsafe(remainingBytes + this._longPacketBuffers.size);
- var offset = 0;
- // Copy long buffers
- while ((buf = this._longPacketBuffers.shift())) {
- offset += buf.copy(buffer, offset);
- }
+/***/ }),
- // Copy remaining bytes
- this._buffer.copy(buffer, offset, this._offset);
+/***/ 62388:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- this._buffer = buffer;
- this._offset = 0;
- this._packetEnd = this._buffer.length - trailingPacketBytes;
- this._packetOffset = 0;
-};
+"use strict";
-Parser.prototype._parsePacket = function _parsePacket(packetHeader) {
- this._packetEnd = this._offset + packetHeader.length;
- this._packetOffset = this._offset;
+const objectHasProperty = __nccwpck_require__(14178).objectHasProperty
+const inspect = Symbol.for('nodejs.util.inspect.custom')
- if (packetHeader.length === MAX_PACKET_LENGTH) {
- this._longPacketBuffers.push(this._buffer.slice(this._packetOffset, this._packetEnd));
- this._advanceToNextPacket();
- return;
+const TYPES = {
+ VarChar (length) {
+ return { type: TYPES.VarChar, length }
+ },
+ NVarChar (length) {
+ return { type: TYPES.NVarChar, length }
+ },
+ Text () {
+ return { type: TYPES.Text }
+ },
+ Int () {
+ return { type: TYPES.Int }
+ },
+ BigInt () {
+ return { type: TYPES.BigInt }
+ },
+ TinyInt () {
+ return { type: TYPES.TinyInt }
+ },
+ SmallInt () {
+ return { type: TYPES.SmallInt }
+ },
+ Bit () {
+ return { type: TYPES.Bit }
+ },
+ Float () {
+ return { type: TYPES.Float }
+ },
+ Numeric (precision, scale) {
+ return { type: TYPES.Numeric, precision, scale }
+ },
+ Decimal (precision, scale) {
+ return { type: TYPES.Decimal, precision, scale }
+ },
+ Real () {
+ return { type: TYPES.Real }
+ },
+ Date () {
+ return { type: TYPES.Date }
+ },
+ DateTime () {
+ return { type: TYPES.DateTime }
+ },
+ DateTime2 (scale) {
+ return { type: TYPES.DateTime2, scale }
+ },
+ DateTimeOffset (scale) {
+ return { type: TYPES.DateTimeOffset, scale }
+ },
+ SmallDateTime () {
+ return { type: TYPES.SmallDateTime }
+ },
+ Time (scale) {
+ return { type: TYPES.Time, scale }
+ },
+ UniqueIdentifier () {
+ return { type: TYPES.UniqueIdentifier }
+ },
+ SmallMoney () {
+ return { type: TYPES.SmallMoney }
+ },
+ Money () {
+ return { type: TYPES.Money }
+ },
+ Binary (length) {
+ return { type: TYPES.Binary, length }
+ },
+ VarBinary (length) {
+ return { type: TYPES.VarBinary, length }
+ },
+ Image () {
+ return { type: TYPES.Image }
+ },
+ Xml () {
+ return { type: TYPES.Xml }
+ },
+ Char (length) {
+ return { type: TYPES.Char, length }
+ },
+ NChar (length) {
+ return { type: TYPES.NChar, length }
+ },
+ NText () {
+ return { type: TYPES.NText }
+ },
+ TVP (tvpType) {
+ return { type: TYPES.TVP, tvpType }
+ },
+ UDT () {
+ return { type: TYPES.UDT }
+ },
+ Geography () {
+ return { type: TYPES.Geography }
+ },
+ Geometry () {
+ return { type: TYPES.Geometry }
+ },
+ Variant () {
+ return { type: TYPES.Variant }
}
+}
- this._combineLongPacketBuffers();
+module.exports.TYPES = TYPES
+module.exports.DECLARATIONS = {}
- var hadException = true;
- try {
- this._onPacket(packetHeader);
- hadException = false;
- } catch (err) {
- if (!err || typeof err.code !== 'string' || err.code.substr(0, 7) !== 'PARSER_') {
- throw err; // Rethrow non-MySQL errors
+const zero = function (value, length) {
+ if (length == null) length = 2
+
+ value = String(value)
+ if (value.length < length) {
+ for (let i = 1; i <= length - value.length; i++) {
+ value = `0${value}`
}
+ }
+ return value
+}
- // Pass down parser errors
- this._onError(err);
- hadException = false;
- } finally {
- this._advanceToNextPacket();
+for (const key in TYPES) {
+ if (objectHasProperty(TYPES, key)) {
+ const value = TYPES[key]
+ value.declaration = key.toLowerCase()
+ module.exports.DECLARATIONS[value.declaration] = value;
- // If there was an exception, the parser while loop will be broken out
- // of after the finally block. So schedule a blank write to re-enter it
- // to continue parsing any bytes that may already have been received.
- if (hadException) {
- process.nextTick(this.write.bind(this));
- }
+ ((key, value) => {
+ value[inspect] = () => `[sql.${key}]`
+ })(key, value)
}
-};
+}
-Parser.prototype._tryReadPacketHeader = function _tryReadPacketHeader() {
- if (this._packetHeader) {
- return this._packetHeader;
+module.exports.declare = (type, options) => {
+ switch (type) {
+ case TYPES.VarChar: case TYPES.VarBinary:
+ return `${type.declaration} (${options.length > 8000 ? 'MAX' : (options.length == null ? 'MAX' : options.length)})`
+ case TYPES.NVarChar:
+ return `${type.declaration} (${options.length > 4000 ? 'MAX' : (options.length == null ? 'MAX' : options.length)})`
+ case TYPES.Char: case TYPES.NChar: case TYPES.Binary:
+ return `${type.declaration} (${options.length == null ? 1 : options.length})`
+ case TYPES.Decimal: case TYPES.Numeric:
+ return `${type.declaration} (${options.precision == null ? 18 : options.precision}, ${options.scale == null ? 0 : options.scale})`
+ case TYPES.Time: case TYPES.DateTime2: case TYPES.DateTimeOffset:
+ return `${type.declaration} (${options.scale == null ? 7 : options.scale})`
+ case TYPES.TVP:
+ return `${options.tvpType} readonly`
+ default:
+ return type.declaration
}
+}
- if (!this._combineNextBuffers(PACKET_HEADER_LENGTH)) {
- return null;
+module.exports.cast = (value, type, options) => {
+ if (value == null) {
+ return null
}
- this._packetHeader = new PacketHeader(
- this.parseUnsignedNumber(3),
- this.parseUnsignedNumber(1)
- );
+ switch (typeof value) {
+ case 'string':
+ return `N'${value.replace(/'/g, '\'\'')}'`
- if (this._packetHeader.number !== this._nextPacketNumber) {
- var err = new Error(
- 'Packets out of order. Got: ' + this._packetHeader.number + ' ' +
- 'Expected: ' + this._nextPacketNumber
- );
+ case 'number':
+ return value
- err.code = 'PROTOCOL_PACKETS_OUT_OF_ORDER';
- err.fatal = true;
+ case 'boolean':
+ return value ? 1 : 0
- this._onError(err);
- }
+ case 'object':
+ if (value instanceof Date) {
+ let ns = value.getUTCMilliseconds() / 1000
+ if (value.nanosecondDelta != null) {
+ ns += value.nanosecondDelta
+ }
+ const scale = options.scale == null ? 7 : options.scale
- this.incrementPacketNumber();
+ if (scale > 0) {
+ ns = String(ns).substr(1, scale + 1)
+ } else {
+ ns = ''
+ }
- return this._packetHeader;
-};
+ return `N'${value.getUTCFullYear()}-${zero(value.getUTCMonth() + 1)}-${zero(value.getUTCDate())} ${zero(value.getUTCHours())}:${zero(value.getUTCMinutes())}:${zero(value.getUTCSeconds())}${ns}'`
+ } else if (Buffer.isBuffer(value)) {
+ return `0x${value.toString('hex')}`
+ }
-Parser.prototype._advanceToNextPacket = function() {
- this._offset = this._packetEnd;
- this._packetHeader = null;
- this._packetEnd = null;
- this._packetOffset = null;
-};
+ return null
+
+ default:
+ return null
+ }
+}
/***/ }),
-/***/ 23714:
+/***/ 86485:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var Parser = __nccwpck_require__(82017);
-var Sequences = __nccwpck_require__(30794);
-var Packets = __nccwpck_require__(87628);
-var Stream = __nccwpck_require__(92413).Stream;
-var Util = __nccwpck_require__(31669);
-var PacketWriter = __nccwpck_require__(36639);
-
-module.exports = Protocol;
-Util.inherits(Protocol, Stream);
-function Protocol(options) {
- Stream.call(this);
+"use strict";
- options = options || {};
- this.readable = true;
- this.writable = true;
+const MSSQLError = __nccwpck_require__(24022)
- this._config = options.config || {};
- this._connection = options.connection;
- this._callback = null;
- this._fatalError = null;
- this._quitSequence = null;
- this._handshake = false;
- this._handshaked = false;
- this._ended = false;
- this._destroyed = false;
- this._queue = [];
- this._handshakeInitializationPacket = null;
+/**
+ * Class ConnectionError.
+ */
- this._parser = new Parser({
- onError : this.handleParserError.bind(this),
- onPacket : this._parsePacket.bind(this),
- config : this._config
- });
-}
+class ConnectionError extends MSSQLError {
+ /**
+ * Creates a new ConnectionError.
+ *
+ * @param {String} message Error message.
+ * @param {String} [code] Error code.
+ */
-Protocol.prototype.write = function(buffer) {
- this._parser.write(buffer);
- return true;
-};
+ constructor (message, code) {
+ super(message, code)
-Protocol.prototype.handshake = function handshake(options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
+ this.name = 'ConnectionError'
}
+}
- options = options || {};
- options.config = this._config;
-
- var sequence = this._enqueue(new Sequences.Handshake(options, callback));
-
- this._handshake = true;
+module.exports = ConnectionError
- return sequence;
-};
-Protocol.prototype.query = function query(options, callback) {
- return this._enqueue(new Sequences.Query(options, callback));
-};
+/***/ }),
-Protocol.prototype.changeUser = function changeUser(options, callback) {
- return this._enqueue(new Sequences.ChangeUser(options, callback));
-};
+/***/ 25903:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-Protocol.prototype.ping = function ping(options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
+"use strict";
- return this._enqueue(new Sequences.Ping(options, callback));
-};
-Protocol.prototype.stats = function stats(options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
+const ConnectionError = __nccwpck_require__(86485)
+const MSSQLError = __nccwpck_require__(24022)
+const PreparedStatementError = __nccwpck_require__(47641)
+const RequestError = __nccwpck_require__(31296)
+const TransactionError = __nccwpck_require__(70274)
- return this._enqueue(new Sequences.Statistics(options, callback));
-};
+module.exports = {
+ ConnectionError,
+ MSSQLError,
+ PreparedStatementError,
+ RequestError,
+ TransactionError
+}
-Protocol.prototype.quit = function quit(options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- var self = this;
- var sequence = this._enqueue(new Sequences.Quit(options, callback));
+/***/ }),
- sequence.on('end', function () {
- self.end();
- });
+/***/ 24022:
+/***/ ((module) => {
- return this._quitSequence = sequence;
-};
+"use strict";
-Protocol.prototype.end = function() {
- if (this._ended) {
- return;
- }
- this._ended = true;
- if (this._quitSequence && (this._quitSequence._ended || this._queue[0] === this._quitSequence)) {
- this._quitSequence.end();
- this.emit('end');
- return;
- }
+class MSSQLError extends Error {
+ /**
+ * Creates a new ConnectionError.
+ *
+ * @param {String} message Error message.
+ * @param {String} [code] Error code.
+ */
- var err = new Error('Connection lost: The server closed the connection.');
- err.fatal = true;
- err.code = 'PROTOCOL_CONNECTION_LOST';
+ constructor (message, code) {
+ if (message instanceof Error) {
+ super(message.message)
+ this.code = message.code || code
- this._delegateError(err);
-};
+ Error.captureStackTrace(this, this.constructor)
+ Object.defineProperty(this, 'originalError', { enumerable: true, value: message })
+ } else {
+ super(message)
+ this.code = code
+ }
-Protocol.prototype.pause = function() {
- this._parser.pause();
- // Since there is a file stream in query, we must transmit pause/resume event to current sequence.
- var seq = this._queue[0];
- if (seq && seq.emit) {
- seq.emit('pause');
+ this.name = 'MSSQLError'
}
-};
+}
-Protocol.prototype.resume = function() {
- this._parser.resume();
- // Since there is a file stream in query, we must transmit pause/resume event to current sequence.
- var seq = this._queue[0];
- if (seq && seq.emit) {
- seq.emit('resume');
- }
-};
+module.exports = MSSQLError
-Protocol.prototype._enqueue = function(sequence) {
- if (!this._validateEnqueue(sequence)) {
- return sequence;
- }
- if (this._config.trace) {
- // Long stack trace support
- sequence._callSite = sequence._callSite || new Error();
- }
+/***/ }),
- this._queue.push(sequence);
- this.emit('enqueue', sequence);
+/***/ 47641:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- var self = this;
- sequence
- .on('error', function(err) {
- self._delegateError(err, sequence);
- })
- .on('packet', function(packet) {
- sequence._timer.active();
- self._emitPacket(packet);
- })
- .on('timeout', function() {
- var err = new Error(sequence.constructor.name + ' inactivity timeout');
+"use strict";
- err.code = 'PROTOCOL_SEQUENCE_TIMEOUT';
- err.fatal = true;
- err.timeout = sequence._timeout;
- self._delegateError(err, sequence);
- });
+const MSSQLError = __nccwpck_require__(24022)
- if (sequence.constructor === Sequences.Handshake) {
- sequence.on('start-tls', function () {
- sequence._timer.active();
- self._connection._startTLS(function(err) {
- if (err) {
- // SSL negotiation error are fatal
- err.code = 'HANDSHAKE_SSL_ERROR';
- err.fatal = true;
- sequence.end(err);
- return;
- }
+/**
+ * Class PreparedStatementError.
+ */
- sequence._timer.active();
- sequence._tlsUpgradeCompleteHandler();
- });
- });
+class PreparedStatementError extends MSSQLError {
+ /**
+ * Creates a new PreparedStatementError.
+ *
+ * @param {String} message Error message.
+ * @param {String} [code] Error code.
+ */
- sequence.on('end', function () {
- self._handshaked = true;
+ constructor (message, code) {
+ super(message, code)
- if (!self._fatalError) {
- self.emit('handshake', self._handshakeInitializationPacket);
- }
- });
+ this.name = 'PreparedStatementError'
}
+}
- sequence.on('end', function () {
- self._dequeue(sequence);
- });
-
- if (this._queue.length === 1) {
- this._parser.resetPacketNumber();
- this._startSequence(sequence);
- }
+module.exports = PreparedStatementError
- return sequence;
-};
-Protocol.prototype._validateEnqueue = function _validateEnqueue(sequence) {
- var err;
- var prefix = 'Cannot enqueue ' + sequence.constructor.name;
+/***/ }),
- if (this._fatalError) {
- err = new Error(prefix + ' after fatal error.');
- err.code = 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR';
- } else if (this._quitSequence) {
- err = new Error(prefix + ' after invoking quit.');
- err.code = 'PROTOCOL_ENQUEUE_AFTER_QUIT';
- } else if (this._destroyed) {
- err = new Error(prefix + ' after being destroyed.');
- err.code = 'PROTOCOL_ENQUEUE_AFTER_DESTROY';
- } else if ((this._handshake || this._handshaked) && sequence.constructor === Sequences.Handshake) {
- err = new Error(prefix + ' after already enqueuing a Handshake.');
- err.code = 'PROTOCOL_ENQUEUE_HANDSHAKE_TWICE';
- } else {
- return true;
- }
+/***/ 31296:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- var self = this;
- err.fatal = false;
+"use strict";
- // add error handler
- sequence.on('error', function (err) {
- self._delegateError(err, sequence);
- });
- process.nextTick(function () {
- sequence.end(err);
- });
+const MSSQLError = __nccwpck_require__(24022)
- return false;
-};
+/**
+ * Class RequestError.
+ *
+ * @property {String} number Error number.
+ * @property {Number} lineNumber Line number.
+ * @property {String} state Error state.
+ * @property {String} class Error class.
+ * @property {String} serverName Server name.
+ * @property {String} procName Procedure name.
+ */
-Protocol.prototype._parsePacket = function() {
- var sequence = this._queue[0];
+class RequestError extends MSSQLError {
+ /**
+ * Creates a new RequestError.
+ *
+ * @param {String} message Error message.
+ * @param {String} [code] Error code.
+ */
- if (!sequence) {
- var err = new Error('Received packet with no active sequence.');
- err.code = 'PROTOCOL_STRAY_PACKET';
- err.fatal = true;
+ constructor (message, code) {
+ super(message, code)
+ if (message instanceof Error) {
+ if (message.info) {
+ this.number = message.info.number || message.code // err.code is returned by msnodesql driver
+ this.lineNumber = message.info.lineNumber
+ this.state = message.info.state || message.sqlstate // err.sqlstate is returned by msnodesql driver
+ this.class = message.info.class
+ this.serverName = message.info.serverName
+ this.procName = message.info.procName
+ } else {
+ this.number = message.code // err.code is returned by msnodesql driver
+ this.state = message.sqlstate // err.sqlstate is returned by msnodesql driver
+ }
+ }
- this._delegateError(err);
- return;
+ this.name = 'RequestError'
+ if ((/^\[Microsoft\]\[SQL Server Native Client 11\.0\](?:\[SQL Server\])?([\s\S]*)$/).exec(this.message)) {
+ this.message = RegExp.$1
+ }
}
+}
- var Packet = this._determinePacket(sequence);
- var packet = new Packet({protocol41: this._config.protocol41});
- var packetName = Packet.name;
+module.exports = RequestError
- // Special case: Faster dispatch, and parsing done inside sequence
- if (Packet === Packets.RowDataPacket) {
- sequence.RowDataPacket(packet, this._parser, this._connection);
- if (this._config.debug) {
- this._debugPacket(true, packet);
- }
+/***/ }),
- return;
- }
+/***/ 70274:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (this._config.debug) {
- this._parsePacketDebug(packet);
- } else {
- packet.parse(this._parser);
- }
+"use strict";
- if (Packet === Packets.HandshakeInitializationPacket) {
- this._handshakeInitializationPacket = packet;
- this.emit('initialize', packet);
- }
- sequence._timer.active();
+const MSSQLError = __nccwpck_require__(24022)
- if (!sequence[packetName]) {
- var err = new Error('Received packet in the wrong sequence.');
- err.code = 'PROTOCOL_INCORRECT_PACKET_SEQUENCE';
- err.fatal = true;
+/**
+ * Class TransactionError.
+ */
- this._delegateError(err);
- return;
- }
+class TransactionError extends MSSQLError {
+ /**
+ * Creates a new TransactionError.
+ *
+ * @param {String} message Error message.
+ * @param {String} [code] Error code.
+ */
- sequence[packetName](packet);
-};
+ constructor (message, code) {
+ super(message, code)
-Protocol.prototype._parsePacketDebug = function _parsePacketDebug(packet) {
- try {
- packet.parse(this._parser);
- } finally {
- this._debugPacket(true, packet);
+ this.name = 'TransactionError'
}
-};
+}
-Protocol.prototype._emitPacket = function(packet) {
- var packetWriter = new PacketWriter();
- packet.write(packetWriter);
- this.emit('data', packetWriter.toBuffer(this._parser));
+module.exports = TransactionError
- if (this._config.debug) {
- this._debugPacket(false, packet);
- }
-};
-Protocol.prototype._determinePacket = function(sequence) {
- var firstByte = this._parser.peak();
+/***/ }),
- if (sequence.determinePacket) {
- var Packet = sequence.determinePacket(firstByte, this._parser);
- if (Packet) {
- return Packet;
- }
- }
+/***/ 89105:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- switch (firstByte) {
- case 0x00: return Packets.OkPacket;
- case 0xfe: return Packets.EofPacket;
- case 0xff: return Packets.ErrorPacket;
- }
+"use strict";
- throw new Error('Could not determine packet, firstByte = ' + firstByte);
-};
-Protocol.prototype._dequeue = function(sequence) {
- sequence._timer.stop();
+const shared = __nccwpck_require__(67636)
- // No point in advancing the queue, we are dead
- if (this._fatalError) {
- return;
- }
+let globalConnection = null
+const globalConnectionHandlers = {}
- this._queue.shift();
+/**
+ * Open global connection pool.
+ *
+ * @param {Object|String} config Connection configuration object or connection string.
+ * @param {basicCallback} [callback] A callback which is called after connection has established, or an error has occurred. If omited, method returns Promise.
+ * @return {Promise.}
+ */
- var sequence = this._queue[0];
- if (!sequence) {
- this.emit('drain');
- return;
- }
+function connect (config, callback) {
+ if (!globalConnection) {
+ globalConnection = new shared.driver.ConnectionPool(config)
- this._parser.resetPacketNumber();
+ for (const event in globalConnectionHandlers) {
+ for (let i = 0, l = globalConnectionHandlers[event].length; i < l; i++) {
+ globalConnection.on(event, globalConnectionHandlers[event][i])
+ }
+ }
- this._startSequence(sequence);
-};
+ const ogClose = globalConnection.close
-Protocol.prototype._startSequence = function(sequence) {
- if (sequence._timeout > 0 && isFinite(sequence._timeout)) {
- sequence._timer.start(sequence._timeout);
- }
+ const globalClose = function (callback) {
+ // remove event handlers from the global connection
+ for (const event in globalConnectionHandlers) {
+ for (let i = 0, l = globalConnectionHandlers[event].length; i < l; i++) {
+ this.removeListener(event, globalConnectionHandlers[event][i])
+ }
+ }
- if (sequence.constructor === Sequences.ChangeUser) {
- sequence.start(this._handshakeInitializationPacket);
- } else {
- sequence.start();
- }
-};
+ // attach error handler to prevent process crash in case of error
+ this.on('error', err => {
+ if (globalConnectionHandlers.error) {
+ for (let i = 0, l = globalConnectionHandlers.error.length; i < l; i++) {
+ globalConnectionHandlers.error[i].call(this, err)
+ }
+ }
+ })
-Protocol.prototype.handleNetworkError = function(err) {
- err.fatal = true;
+ globalConnection = null
+ return ogClose.call(this, callback)
+ }
- var sequence = this._queue[0];
- if (sequence) {
- sequence.end(err);
- } else {
- this._delegateError(err);
+ globalConnection.close = globalClose.bind(globalConnection)
}
-};
-
-Protocol.prototype.handleParserError = function handleParserError(err) {
- var sequence = this._queue[0];
- if (sequence) {
- sequence.end(err);
- } else {
- this._delegateError(err);
+ if (typeof callback === 'function') {
+ return globalConnection.connect((err, connection) => {
+ if (err) {
+ globalConnection = null
+ }
+ callback(err, connection)
+ })
}
-};
+ return globalConnection.connect().catch((err) => {
+ globalConnection = null
+ return shared.Promise.reject(err)
+ })
+}
-Protocol.prototype._delegateError = function(err, sequence) {
- // Stop delegating errors after the first fatal error
- if (this._fatalError) {
- return;
- }
+/**
+ * Close all active connections in the global pool.
+ *
+ * @param {basicCallback} [callback] A callback which is called after connection has closed, or an error has occurred. If omited, method returns Promise.
+ * @return {ConnectionPool|Promise}
+ */
- if (err.fatal) {
- this._fatalError = err;
+function close (callback) {
+ if (globalConnection) {
+ const gc = globalConnection
+ globalConnection = null
+ return gc.close(callback)
}
- if (this._shouldErrorBubbleUp(err, sequence)) {
- // Can't use regular 'error' event here as that always destroys the pipe
- // between socket and protocol which is not what we want (unless the
- // exception was fatal).
- this.emit('unhandledError', err);
- } else if (err.fatal) {
- // Send fatal error to all sequences in the queue
- var queue = this._queue;
- process.nextTick(function () {
- queue.forEach(function (sequence) {
- sequence.end(err);
- });
- queue.length = 0;
- });
+ if (typeof callback === 'function') {
+ setImmediate(callback)
+ return null
}
- // Make sure the stream we are piping to is getting closed
- if (err.fatal) {
- this.emit('end', err);
- }
-};
+ return new shared.Promise((resolve) => {
+ resolve(globalConnection)
+ })
+}
-Protocol.prototype._shouldErrorBubbleUp = function(err, sequence) {
- if (sequence) {
- if (sequence.hasErrorHandler()) {
- return false;
- } else if (!err.fatal) {
- return true;
- }
- }
+/**
+ * Attach event handler to global connection pool.
+ *
+ * @param {String} event Event name.
+ * @param {Function} handler Event handler.
+ * @return {ConnectionPool}
+ */
- return (err.fatal && !this._hasPendingErrorHandlers());
-};
+function on (event, handler) {
+ if (!globalConnectionHandlers[event]) globalConnectionHandlers[event] = []
+ globalConnectionHandlers[event].push(handler)
-Protocol.prototype._hasPendingErrorHandlers = function() {
- return this._queue.some(function(sequence) {
- return sequence.hasErrorHandler();
- });
-};
+ if (globalConnection) globalConnection.on(event, handler)
+ return globalConnection
+}
-Protocol.prototype.destroy = function() {
- this._destroyed = true;
- this._parser.pause();
+/**
+ * Detach event handler from global connection.
+ *
+ * @param {String} event Event name.
+ * @param {Function} handler Event handler.
+ * @return {ConnectionPool}
+ */
- if (this._connection.state !== 'disconnected') {
- if (!this._ended) {
- this.end();
- }
- }
-};
+function removeListener (event, handler) {
+ if (!globalConnectionHandlers[event]) return globalConnection
+ const index = globalConnectionHandlers[event].indexOf(handler)
+ if (index === -1) return globalConnection
+ globalConnectionHandlers[event].splice(index, 1)
+ if (globalConnectionHandlers[event].length === 0) globalConnectionHandlers[event] = undefined
-Protocol.prototype._debugPacket = function(incoming, packet) {
- var connection = this._connection;
- var direction = incoming
- ? '<--'
- : '-->';
- var packetName = packet.constructor.name;
- var threadId = connection && connection.threadId !== null
- ? ' (' + connection.threadId + ')'
- : '';
+ if (globalConnection) globalConnection.removeListener(event, handler)
+ return globalConnection
+}
- // check for debug packet restriction
- if (Array.isArray(this._config.debug) && this._config.debug.indexOf(packetName) === -1) {
- return;
- }
+/**
+ * Creates a new query using global connection from a tagged template string.
+ *
+ * @variation 1
+ * @param {Array|String} strings Array of string literals or sql command.
+ * @param {...*} keys Values.
+ * @return {Request}
+ */
- var packetPayload = Util.inspect(packet).replace(/^[^{]+/, '');
+/**
+ * Execute the SQL command.
+ *
+ * @variation 2
+ * @param {String} command T-SQL command to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
- console.log('%s%s %s %s\n', direction, threadId, packetName, packetPayload);
-};
+function query () {
+ if (typeof arguments[0] === 'string') { return new shared.driver.Request().query(arguments[0], arguments[1]) }
+
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
+
+ return new shared.driver.Request()._template(strings, values, 'query')
+}
+
+/**
+ * Creates a new batch using global connection from a tagged template string.
+ *
+ * @variation 1
+ * @param {Array} strings Array of string literals.
+ * @param {...*} keys Values.
+ * @return {Request}
+ */
+
+/**
+ * Execute the SQL command.
+ *
+ * @variation 2
+ * @param {String} command T-SQL command to be executed.
+ * @param {Request~requestCallback} [callback] A callback which is called after execution has completed, or an error has occurred. If omited, method returns Promise.
+ * @return {Request|Promise}
+ */
+
+function batch () {
+ if (typeof arguments[0] === 'string') { return new shared.driver.Request().batch(arguments[0], arguments[1]) }
+
+ const values = Array.prototype.slice.call(arguments)
+ const strings = values.shift()
+
+ return new shared.driver.Request()._template(strings, values, 'batch')
+}
+
+module.exports = {
+ batch,
+ close,
+ connect,
+ off: removeListener,
+ on,
+ query,
+ removeListener
+}
+
+Object.defineProperty(module.exports, "pool", ({
+ get: () => {
+ return globalConnection
+ },
+ set: () => {}
+}))
/***/ }),
-/***/ 18774:
+/***/ 62202:
/***/ ((module) => {
-module.exports = ResultSet;
-function ResultSet(resultSetHeaderPacket) {
- this.resultSetHeaderPacket = resultSetHeaderPacket;
- this.fieldPackets = [];
- this.eofPackets = [];
- this.rows = [];
-}
+"use strict";
+
+
+module.exports = {
+ READ_UNCOMMITTED: 0x01,
+ READ_COMMITTED: 0x02,
+ REPEATABLE_READ: 0x03,
+ SERIALIZABLE: 0x04,
+ SNAPSHOT: 0x05
+}
/***/ }),
-/***/ 27522:
+/***/ 67636:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-module.exports = __nccwpck_require__(84386);
+"use strict";
+
+
+const TYPES = __nccwpck_require__(62388).TYPES
+const Table = __nccwpck_require__(67417)
+
+let PromiseLibrary = Promise
+const driver = {}
+const map = []
+
+/**
+ * Register you own type map.
+ *
+ * @path module.exports.map
+ * @param {*} jstype JS data type.
+ * @param {*} sqltype SQL data type.
+ */
+
+map.register = function (jstype, sqltype) {
+ for (let index = 0; index < this.length; index++) {
+ const item = this[index]
+ if (item.js === jstype) {
+ this.splice(index, 1)
+ break
+ }
+ }
+
+ this.push({
+ js: jstype,
+ sql: sqltype
+ })
+
+ return null
+}
+
+map.register(String, TYPES.NVarChar)
+map.register(Number, TYPES.Int)
+map.register(Boolean, TYPES.Bit)
+map.register(Date, TYPES.DateTime)
+map.register(Buffer, TYPES.VarBinary)
+map.register(Table, TYPES.TVP)
+
+/**
+ * @ignore
+ */
+
+const getTypeByValue = function (value) {
+ if ((value === null) || (value === undefined)) { return TYPES.NVarChar }
+
+ switch (typeof value) {
+ case 'string':
+ for (var item of Array.from(map)) {
+ if (item.js === String) {
+ return item.sql
+ }
+ }
+
+ return TYPES.NVarChar
+
+ case 'number':
+ if (value % 1 === 0) {
+ return TYPES.Int
+ } else {
+ return TYPES.Float
+ }
+
+ case 'boolean':
+ for (item of Array.from(map)) {
+ if (item.js === Boolean) {
+ return item.sql
+ }
+ }
+
+ return TYPES.Bit
+
+ case 'object':
+ for (item of Array.from(map)) {
+ if (value instanceof item.js) {
+ return item.sql
+ }
+ }
+
+ return TYPES.NVarChar
+
+ default:
+ return TYPES.NVarChar
+ }
+}
+
+module.exports = {
+ driver,
+ getTypeByValue,
+ map
+}
+
+Object.defineProperty(module.exports, "Promise", ({
+ get: () => {
+ return PromiseLibrary
+ },
+ set: (value) => {
+ PromiseLibrary = value
+ }
+}))
/***/ }),
-/***/ 42443:
+/***/ 67417:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var Timers = __nccwpck_require__(78213);
+"use strict";
-module.exports = Timer;
-function Timer(object) {
- this._object = object;
- this._timeout = null;
+
+const TYPES = __nccwpck_require__(62388).TYPES
+const declareType = __nccwpck_require__(62388).declare
+const objectHasProperty = __nccwpck_require__(14178).objectHasProperty
+
+const MAX = 65535 // (1 << 16) - 1
+const JSON_COLUMN_ID = 'JSON_F52E2B61-18A1-11d1-B105-00805F49916B'
+
+function Table (name) {
+ if (name) {
+ const parsed = Table.parseName(name)
+ this.name = parsed.name
+ this.schema = parsed.schema
+ this.database = parsed.database
+ this.path = (this.database ? `[${this.database}].` : '') + (this.schema ? `[${this.schema}].` : '') + `[${this.name}]`
+ this.temporary = this.name.charAt(0) === '#'
+ }
+
+ this.columns = []
+ this.rows = []
+
+ Object.defineProperty(this.columns, 'add', {
+ value (name, column, options) {
+ if (column == null) {
+ throw new Error('Column data type is not defined.')
+ }
+ if (column instanceof Function) {
+ column = column()
+ }
+
+ options = options || {}
+ column.name = name;
+
+ ['nullable', 'primary', 'identity', 'readOnly', 'length'].forEach(prop => {
+ if (objectHasProperty(options, prop)) {
+ column[prop] = options[prop]
+ }
+ })
+
+ return this.push(column)
+ }
+ })
+
+ Object.defineProperty(this.rows, 'add', {
+ value () {
+ return this.push(Array.prototype.slice.call(arguments))
+ }
+ }
+ )
}
-Timer.prototype.active = function active() {
- if (this._timeout) {
- if (this._timeout.refresh) {
- this._timeout.refresh();
+/*
+@private
+*/
+
+Table.prototype._makeBulk = function _makeBulk () {
+ for (let i = 0; i < this.columns.length; i++) {
+ const col = this.columns[i]
+ switch (col.type) {
+ case TYPES.Date:
+ case TYPES.DateTime:
+ case TYPES.DateTime2:
+ for (let j = 0; j < this.rows.length; j++) {
+ const dateValue = this.rows[j][i]
+ if (typeof dateValue === 'string' || typeof dateValue === 'number') {
+ const date = new Date(dateValue)
+ if (isNaN(date.getDate())) {
+ throw new TypeError('Invalid date value passed to bulk rows')
+ }
+ this.rows[j][i] = date
+ }
+ }
+ break
+
+ case TYPES.Xml:
+ col.type = TYPES.NVarChar(MAX).type
+ break
+
+ case TYPES.UDT:
+ case TYPES.Geography:
+ case TYPES.Geometry:
+ col.type = TYPES.VarBinary(MAX).type
+ break
+
+ default:
+ break
+ }
+ }
+
+ return this
+}
+
+Table.prototype.declare = function declare () {
+ const pkey = this.columns.filter(col => col.primary === true).map(col => col.name)
+ const cols = this.columns.map(col => {
+ const def = [`[${col.name}] ${declareType(col.type, col)}`]
+
+ if (col.nullable === true) {
+ def.push('null')
+ } else if (col.nullable === false) {
+ def.push('not null')
+ }
+
+ if (col.primary === true && pkey.length === 1) {
+ def.push('primary key')
+ }
+
+ return def.join(' ')
+ })
+
+ const constraint = pkey.length > 1 ? `, constraint PK_${this.temporary ? this.name.substr(1) : this.name} primary key (${pkey.join(', ')})` : ''
+ return `create table ${this.path} (${cols.join(', ')}${constraint})`
+}
+
+Table.fromRecordset = function fromRecordset (recordset, name) {
+ const t = new this(name)
+
+ for (const colName in recordset.columns) {
+ if (objectHasProperty(recordset.columns, colName)) {
+ const col = recordset.columns[colName]
+
+ t.columns.add(colName, {
+ type: col.type,
+ length: col.length,
+ scale: col.scale,
+ precision: col.precision
+ }, {
+ nullable: col.nullable,
+ identity: col.identity,
+ readOnly: col.readOnly
+ })
+ }
+ }
+
+ if (t.columns.length === 1 && t.columns[0].name === JSON_COLUMN_ID) {
+ for (let i = 0; i < recordset.length; i++) {
+ t.rows.add(JSON.stringify(recordset[i]))
+ }
+ } else {
+ for (let i = 0; i < recordset.length; i++) {
+ t.rows.add.apply(t.rows, t.columns.map(col => recordset[i][col.name]))
+ }
+ }
+
+ return t
+}
+
+Table.parseName = function parseName (name) {
+ const length = name.length
+ let cursor = -1
+ let buffer = ''
+ let escaped = false
+ const path = []
+
+ while (++cursor < length) {
+ const char = name.charAt(cursor)
+ if (char === '[') {
+ if (escaped) {
+ buffer += char
+ } else {
+ escaped = true
+ }
+ } else if (char === ']') {
+ if (escaped) {
+ escaped = false
+ } else {
+ throw new Error('Invalid table name.')
+ }
+ } else if (char === '.') {
+ if (escaped) {
+ buffer += char
+ } else {
+ path.push(buffer)
+ buffer = ''
+ }
} else {
- Timers.active(this._timeout);
+ buffer += char
}
}
-};
-Timer.prototype.start = function start(msecs) {
- this.stop();
- this._timeout = Timers.setTimeout(this._onTimeout.bind(this), msecs);
-};
+ if (buffer) {
+ path.push(buffer)
+ }
-Timer.prototype.stop = function stop() {
- if (this._timeout) {
- Timers.clearTimeout(this._timeout);
- this._timeout = null;
+ switch (path.length) {
+ case 1:
+ return {
+ name: path[0],
+ schema: null,
+ database: null
+ }
+
+ case 2:
+ return {
+ name: path[1],
+ schema: path[0],
+ database: null
+ }
+
+ case 3:
+ return {
+ name: path[2],
+ schema: path[1],
+ database: path[0]
+ }
+
+ default:
+ throw new Error('Invalid table name.')
}
-};
+}
-Timer.prototype._onTimeout = function _onTimeout() {
- return this._object._onTimeout();
-};
+module.exports = Table
/***/ }),
-/***/ 30124:
-/***/ ((__unused_webpack_module, exports) => {
+/***/ 89:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-exports.BIG5_CHINESE_CI = 1;
-exports.LATIN2_CZECH_CS = 2;
-exports.DEC8_SWEDISH_CI = 3;
-exports.CP850_GENERAL_CI = 4;
-exports.LATIN1_GERMAN1_CI = 5;
-exports.HP8_ENGLISH_CI = 6;
-exports.KOI8R_GENERAL_CI = 7;
-exports.LATIN1_SWEDISH_CI = 8;
-exports.LATIN2_GENERAL_CI = 9;
-exports.SWE7_SWEDISH_CI = 10;
-exports.ASCII_GENERAL_CI = 11;
-exports.UJIS_JAPANESE_CI = 12;
-exports.SJIS_JAPANESE_CI = 13;
-exports.CP1251_BULGARIAN_CI = 14;
-exports.LATIN1_DANISH_CI = 15;
-exports.HEBREW_GENERAL_CI = 16;
-exports.TIS620_THAI_CI = 18;
-exports.EUCKR_KOREAN_CI = 19;
-exports.LATIN7_ESTONIAN_CS = 20;
-exports.LATIN2_HUNGARIAN_CI = 21;
-exports.KOI8U_GENERAL_CI = 22;
-exports.CP1251_UKRAINIAN_CI = 23;
-exports.GB2312_CHINESE_CI = 24;
-exports.GREEK_GENERAL_CI = 25;
-exports.CP1250_GENERAL_CI = 26;
-exports.LATIN2_CROATIAN_CI = 27;
-exports.GBK_CHINESE_CI = 28;
-exports.CP1257_LITHUANIAN_CI = 29;
-exports.LATIN5_TURKISH_CI = 30;
-exports.LATIN1_GERMAN2_CI = 31;
-exports.ARMSCII8_GENERAL_CI = 32;
-exports.UTF8_GENERAL_CI = 33;
-exports.CP1250_CZECH_CS = 34;
-exports.UCS2_GENERAL_CI = 35;
-exports.CP866_GENERAL_CI = 36;
-exports.KEYBCS2_GENERAL_CI = 37;
-exports.MACCE_GENERAL_CI = 38;
-exports.MACROMAN_GENERAL_CI = 39;
-exports.CP852_GENERAL_CI = 40;
-exports.LATIN7_GENERAL_CI = 41;
-exports.LATIN7_GENERAL_CS = 42;
-exports.MACCE_BIN = 43;
-exports.CP1250_CROATIAN_CI = 44;
-exports.UTF8MB4_GENERAL_CI = 45;
-exports.UTF8MB4_BIN = 46;
-exports.LATIN1_BIN = 47;
-exports.LATIN1_GENERAL_CI = 48;
-exports.LATIN1_GENERAL_CS = 49;
-exports.CP1251_BIN = 50;
-exports.CP1251_GENERAL_CI = 51;
-exports.CP1251_GENERAL_CS = 52;
-exports.MACROMAN_BIN = 53;
-exports.UTF16_GENERAL_CI = 54;
-exports.UTF16_BIN = 55;
-exports.UTF16LE_GENERAL_CI = 56;
-exports.CP1256_GENERAL_CI = 57;
-exports.CP1257_BIN = 58;
-exports.CP1257_GENERAL_CI = 59;
-exports.UTF32_GENERAL_CI = 60;
-exports.UTF32_BIN = 61;
-exports.UTF16LE_BIN = 62;
-exports.BINARY = 63;
-exports.ARMSCII8_BIN = 64;
-exports.ASCII_BIN = 65;
-exports.CP1250_BIN = 66;
-exports.CP1256_BIN = 67;
-exports.CP866_BIN = 68;
-exports.DEC8_BIN = 69;
-exports.GREEK_BIN = 70;
-exports.HEBREW_BIN = 71;
-exports.HP8_BIN = 72;
-exports.KEYBCS2_BIN = 73;
-exports.KOI8R_BIN = 74;
-exports.KOI8U_BIN = 75;
-exports.LATIN2_BIN = 77;
-exports.LATIN5_BIN = 78;
-exports.LATIN7_BIN = 79;
-exports.CP850_BIN = 80;
-exports.CP852_BIN = 81;
-exports.SWE7_BIN = 82;
-exports.UTF8_BIN = 83;
-exports.BIG5_BIN = 84;
-exports.EUCKR_BIN = 85;
-exports.GB2312_BIN = 86;
-exports.GBK_BIN = 87;
-exports.SJIS_BIN = 88;
-exports.TIS620_BIN = 89;
-exports.UCS2_BIN = 90;
-exports.UJIS_BIN = 91;
-exports.GEOSTD8_GENERAL_CI = 92;
-exports.GEOSTD8_BIN = 93;
-exports.LATIN1_SPANISH_CI = 94;
-exports.CP932_JAPANESE_CI = 95;
-exports.CP932_BIN = 96;
-exports.EUCJPMS_JAPANESE_CI = 97;
-exports.EUCJPMS_BIN = 98;
-exports.CP1250_POLISH_CI = 99;
-exports.UTF16_UNICODE_CI = 101;
-exports.UTF16_ICELANDIC_CI = 102;
-exports.UTF16_LATVIAN_CI = 103;
-exports.UTF16_ROMANIAN_CI = 104;
-exports.UTF16_SLOVENIAN_CI = 105;
-exports.UTF16_POLISH_CI = 106;
-exports.UTF16_ESTONIAN_CI = 107;
-exports.UTF16_SPANISH_CI = 108;
-exports.UTF16_SWEDISH_CI = 109;
-exports.UTF16_TURKISH_CI = 110;
-exports.UTF16_CZECH_CI = 111;
-exports.UTF16_DANISH_CI = 112;
-exports.UTF16_LITHUANIAN_CI = 113;
-exports.UTF16_SLOVAK_CI = 114;
-exports.UTF16_SPANISH2_CI = 115;
-exports.UTF16_ROMAN_CI = 116;
-exports.UTF16_PERSIAN_CI = 117;
-exports.UTF16_ESPERANTO_CI = 118;
-exports.UTF16_HUNGARIAN_CI = 119;
-exports.UTF16_SINHALA_CI = 120;
-exports.UTF16_GERMAN2_CI = 121;
-exports.UTF16_CROATIAN_MYSQL561_CI = 122;
-exports.UTF16_UNICODE_520_CI = 123;
-exports.UTF16_VIETNAMESE_CI = 124;
-exports.UCS2_UNICODE_CI = 128;
-exports.UCS2_ICELANDIC_CI = 129;
-exports.UCS2_LATVIAN_CI = 130;
-exports.UCS2_ROMANIAN_CI = 131;
-exports.UCS2_SLOVENIAN_CI = 132;
-exports.UCS2_POLISH_CI = 133;
-exports.UCS2_ESTONIAN_CI = 134;
-exports.UCS2_SPANISH_CI = 135;
-exports.UCS2_SWEDISH_CI = 136;
-exports.UCS2_TURKISH_CI = 137;
-exports.UCS2_CZECH_CI = 138;
-exports.UCS2_DANISH_CI = 139;
-exports.UCS2_LITHUANIAN_CI = 140;
-exports.UCS2_SLOVAK_CI = 141;
-exports.UCS2_SPANISH2_CI = 142;
-exports.UCS2_ROMAN_CI = 143;
-exports.UCS2_PERSIAN_CI = 144;
-exports.UCS2_ESPERANTO_CI = 145;
-exports.UCS2_HUNGARIAN_CI = 146;
-exports.UCS2_SINHALA_CI = 147;
-exports.UCS2_GERMAN2_CI = 148;
-exports.UCS2_CROATIAN_MYSQL561_CI = 149;
-exports.UCS2_UNICODE_520_CI = 150;
-exports.UCS2_VIETNAMESE_CI = 151;
-exports.UCS2_GENERAL_MYSQL500_CI = 159;
-exports.UTF32_UNICODE_CI = 160;
-exports.UTF32_ICELANDIC_CI = 161;
-exports.UTF32_LATVIAN_CI = 162;
-exports.UTF32_ROMANIAN_CI = 163;
-exports.UTF32_SLOVENIAN_CI = 164;
-exports.UTF32_POLISH_CI = 165;
-exports.UTF32_ESTONIAN_CI = 166;
-exports.UTF32_SPANISH_CI = 167;
-exports.UTF32_SWEDISH_CI = 168;
-exports.UTF32_TURKISH_CI = 169;
-exports.UTF32_CZECH_CI = 170;
-exports.UTF32_DANISH_CI = 171;
-exports.UTF32_LITHUANIAN_CI = 172;
-exports.UTF32_SLOVAK_CI = 173;
-exports.UTF32_SPANISH2_CI = 174;
-exports.UTF32_ROMAN_CI = 175;
-exports.UTF32_PERSIAN_CI = 176;
-exports.UTF32_ESPERANTO_CI = 177;
-exports.UTF32_HUNGARIAN_CI = 178;
-exports.UTF32_SINHALA_CI = 179;
-exports.UTF32_GERMAN2_CI = 180;
-exports.UTF32_CROATIAN_MYSQL561_CI = 181;
-exports.UTF32_UNICODE_520_CI = 182;
-exports.UTF32_VIETNAMESE_CI = 183;
-exports.UTF8_UNICODE_CI = 192;
-exports.UTF8_ICELANDIC_CI = 193;
-exports.UTF8_LATVIAN_CI = 194;
-exports.UTF8_ROMANIAN_CI = 195;
-exports.UTF8_SLOVENIAN_CI = 196;
-exports.UTF8_POLISH_CI = 197;
-exports.UTF8_ESTONIAN_CI = 198;
-exports.UTF8_SPANISH_CI = 199;
-exports.UTF8_SWEDISH_CI = 200;
-exports.UTF8_TURKISH_CI = 201;
-exports.UTF8_CZECH_CI = 202;
-exports.UTF8_DANISH_CI = 203;
-exports.UTF8_LITHUANIAN_CI = 204;
-exports.UTF8_SLOVAK_CI = 205;
-exports.UTF8_SPANISH2_CI = 206;
-exports.UTF8_ROMAN_CI = 207;
-exports.UTF8_PERSIAN_CI = 208;
-exports.UTF8_ESPERANTO_CI = 209;
-exports.UTF8_HUNGARIAN_CI = 210;
-exports.UTF8_SINHALA_CI = 211;
-exports.UTF8_GERMAN2_CI = 212;
-exports.UTF8_CROATIAN_MYSQL561_CI = 213;
-exports.UTF8_UNICODE_520_CI = 214;
-exports.UTF8_VIETNAMESE_CI = 215;
-exports.UTF8_GENERAL_MYSQL500_CI = 223;
-exports.UTF8MB4_UNICODE_CI = 224;
-exports.UTF8MB4_ICELANDIC_CI = 225;
-exports.UTF8MB4_LATVIAN_CI = 226;
-exports.UTF8MB4_ROMANIAN_CI = 227;
-exports.UTF8MB4_SLOVENIAN_CI = 228;
-exports.UTF8MB4_POLISH_CI = 229;
-exports.UTF8MB4_ESTONIAN_CI = 230;
-exports.UTF8MB4_SPANISH_CI = 231;
-exports.UTF8MB4_SWEDISH_CI = 232;
-exports.UTF8MB4_TURKISH_CI = 233;
-exports.UTF8MB4_CZECH_CI = 234;
-exports.UTF8MB4_DANISH_CI = 235;
-exports.UTF8MB4_LITHUANIAN_CI = 236;
-exports.UTF8MB4_SLOVAK_CI = 237;
-exports.UTF8MB4_SPANISH2_CI = 238;
-exports.UTF8MB4_ROMAN_CI = 239;
-exports.UTF8MB4_PERSIAN_CI = 240;
-exports.UTF8MB4_ESPERANTO_CI = 241;
-exports.UTF8MB4_HUNGARIAN_CI = 242;
-exports.UTF8MB4_SINHALA_CI = 243;
-exports.UTF8MB4_GERMAN2_CI = 244;
-exports.UTF8MB4_CROATIAN_MYSQL561_CI = 245;
-exports.UTF8MB4_UNICODE_520_CI = 246;
-exports.UTF8MB4_VIETNAMESE_CI = 247;
-exports.UTF8_GENERAL50_CI = 253;
+"use strict";
-// short aliases
-exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI;
-exports.ASCII = exports.ASCII_GENERAL_CI;
-exports.BIG5 = exports.BIG5_CHINESE_CI;
-exports.BINARY = exports.BINARY;
-exports.CP1250 = exports.CP1250_GENERAL_CI;
-exports.CP1251 = exports.CP1251_GENERAL_CI;
-exports.CP1256 = exports.CP1256_GENERAL_CI;
-exports.CP1257 = exports.CP1257_GENERAL_CI;
-exports.CP866 = exports.CP866_GENERAL_CI;
-exports.CP850 = exports.CP850_GENERAL_CI;
-exports.CP852 = exports.CP852_GENERAL_CI;
-exports.CP932 = exports.CP932_JAPANESE_CI;
-exports.DEC8 = exports.DEC8_SWEDISH_CI;
-exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI;
-exports.EUCKR = exports.EUCKR_KOREAN_CI;
-exports.GB2312 = exports.GB2312_CHINESE_CI;
-exports.GBK = exports.GBK_CHINESE_CI;
-exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI;
-exports.GREEK = exports.GREEK_GENERAL_CI;
-exports.HEBREW = exports.HEBREW_GENERAL_CI;
-exports.HP8 = exports.HP8_ENGLISH_CI;
-exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI;
-exports.KOI8R = exports.KOI8R_GENERAL_CI;
-exports.KOI8U = exports.KOI8U_GENERAL_CI;
-exports.LATIN1 = exports.LATIN1_SWEDISH_CI;
-exports.LATIN2 = exports.LATIN2_GENERAL_CI;
-exports.LATIN5 = exports.LATIN5_TURKISH_CI;
-exports.LATIN7 = exports.LATIN7_GENERAL_CI;
-exports.MACCE = exports.MACCE_GENERAL_CI;
-exports.MACROMAN = exports.MACROMAN_GENERAL_CI;
-exports.SJIS = exports.SJIS_JAPANESE_CI;
-exports.SWE7 = exports.SWE7_SWEDISH_CI;
-exports.TIS620 = exports.TIS620_THAI_CI;
-exports.UCS2 = exports.UCS2_GENERAL_CI;
-exports.UJIS = exports.UJIS_JAPANESE_CI;
-exports.UTF16 = exports.UTF16_GENERAL_CI;
-exports.UTF16LE = exports.UTF16LE_GENERAL_CI;
-exports.UTF8 = exports.UTF8_GENERAL_CI;
-exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI;
-exports.UTF32 = exports.UTF32_GENERAL_CI;
+const tds = __nccwpck_require__(62459)
+const debug = __nccwpck_require__(38237)('mssql:tedi')
+const BaseConnectionPool = __nccwpck_require__(85558)
+const { IDS } = __nccwpck_require__(14178)
+const shared = __nccwpck_require__(67636)
+const ConnectionError = __nccwpck_require__(86485)
-/***/ }),
+class ConnectionPool extends BaseConnectionPool {
+ _poolCreate () {
+ return new shared.Promise((resolve, reject) => {
+ const resolveOnce = (v) => {
+ resolve(v)
+ resolve = reject = () => {}
+ }
+ const rejectOnce = (e) => {
+ reject(e)
+ resolve = reject = () => {}
+ }
+ const cfg = {
+ server: this.config.server,
+ options: Object.assign({
+ encrypt: typeof this.config.encrypt === 'boolean' ? this.config.encrypt : true
+ }, this.config.options),
+ authentication: Object.assign({
+ type: this.config.domain !== undefined ? 'ntlm' : 'default',
+ options: {
+ userName: this.config.user,
+ password: this.config.password,
+ domain: this.config.domain
+ }
+ }, this.config.authentication)
+ }
-/***/ 5427:
-/***/ ((__unused_webpack_module, exports) => {
+ cfg.options.database = this.config.database
+ cfg.options.port = this.config.port
+ cfg.options.connectTimeout = this.config.connectionTimeout || this.config.timeout || 15000
+ cfg.options.requestTimeout = this.config.requestTimeout != null ? this.config.requestTimeout : 15000
+ cfg.options.tdsVersion = cfg.options.tdsVersion || '7_4'
+ cfg.options.rowCollectionOnDone = false
+ cfg.options.rowCollectionOnRequestCompletion = false
+ cfg.options.useColumnNames = false
+ cfg.options.appName = cfg.options.appName || 'node-mssql'
-// Manually extracted from mysql-5.5.23/include/mysql_com.h
-exports.CLIENT_LONG_PASSWORD = 1; /* new more secure passwords */
-exports.CLIENT_FOUND_ROWS = 2; /* Found instead of affected rows */
-exports.CLIENT_LONG_FLAG = 4; /* Get all column flags */
-exports.CLIENT_CONNECT_WITH_DB = 8; /* One can specify db on connect */
-exports.CLIENT_NO_SCHEMA = 16; /* Don't allow database.table.column */
-exports.CLIENT_COMPRESS = 32; /* Can use compression protocol */
-exports.CLIENT_ODBC = 64; /* Odbc client */
-exports.CLIENT_LOCAL_FILES = 128; /* Can use LOAD DATA LOCAL */
-exports.CLIENT_IGNORE_SPACE = 256; /* Ignore spaces before '(' */
-exports.CLIENT_PROTOCOL_41 = 512; /* New 4.1 protocol */
-exports.CLIENT_INTERACTIVE = 1024; /* This is an interactive client */
-exports.CLIENT_SSL = 2048; /* Switch to SSL after handshake */
-exports.CLIENT_IGNORE_SIGPIPE = 4096; /* IGNORE sigpipes */
-exports.CLIENT_TRANSACTIONS = 8192; /* Client knows about transactions */
-exports.CLIENT_RESERVED = 16384; /* Old flag for 4.1 protocol */
-exports.CLIENT_SECURE_CONNECTION = 32768; /* New 4.1 authentication */
+ // tedious always connect via tcp when port is specified
+ if (cfg.options.instanceName) delete cfg.options.port
-exports.CLIENT_MULTI_STATEMENTS = 65536; /* Enable/disable multi-stmt support */
-exports.CLIENT_MULTI_RESULTS = 131072; /* Enable/disable multi-results */
-exports.CLIENT_PS_MULTI_RESULTS = 262144; /* Multi-results in PS-protocol */
+ if (isNaN(cfg.options.requestTimeout)) cfg.options.requestTimeout = 15000
+ if (cfg.options.requestTimeout === Infinity) cfg.options.requestTimeout = 0
+ if (cfg.options.requestTimeout < 0) cfg.options.requestTimeout = 0
-exports.CLIENT_PLUGIN_AUTH = 524288; /* Client supports plugin authentication */
+ if (this.config.debug) {
+ cfg.options.debug = {
+ packet: true,
+ token: true,
+ data: true,
+ payload: true
+ }
+ }
+ const tedious = new tds.Connection(cfg)
+ IDS.add(tedious, 'Connection')
+ debug('pool(%d): connection #%d created', IDS.get(this), IDS.get(tedious))
+ debug('connection(%d): establishing', IDS.get(tedious))
-exports.CLIENT_SSL_VERIFY_SERVER_CERT = 1073741824;
-exports.CLIENT_REMEMBER_OPTIONS = 2147483648;
+ tedious.once('connect', err => {
+ if (err) {
+ err = new ConnectionError(err)
+ return rejectOnce(err)
+ }
+ debug('connection(%d): established', IDS.get(tedious))
+ resolveOnce(tedious)
+ })
-/***/ }),
+ tedious.on('end', () => {
+ const err = new ConnectionError('The connection ended without ever completing the connection')
+ rejectOnce(err)
+ })
+ tedious.on('error', err => {
+ if (err.code === 'ESOCKET') {
+ tedious.hasError = true
+ } else {
+ this.emit('error', err)
+ }
+ rejectOnce(err)
+ })
-/***/ 95847:
-/***/ ((__unused_webpack_module, exports) => {
+ if (this.config.debug) {
+ tedious.on('debug', this.emit.bind(this, 'debug', tedious))
+ }
+ if (typeof this.config.beforeConnect === 'function') {
+ this.config.beforeConnect(tedious)
+ }
+ })
+ }
-/**
- * MySQL error constants
- *
- * Extracted from version 5.7.29
- *
- * !! Generated by generate-error-constants.js, do not modify by hand !!
- */
+ _poolValidate (tedious) {
+ return tedious && !tedious.closed && !tedious.hasError
+ }
-exports.EE_CANTCREATEFILE = 1;
-exports.EE_READ = 2;
-exports.EE_WRITE = 3;
-exports.EE_BADCLOSE = 4;
-exports.EE_OUTOFMEMORY = 5;
-exports.EE_DELETE = 6;
-exports.EE_LINK = 7;
-exports.EE_EOFERR = 9;
-exports.EE_CANTLOCK = 10;
-exports.EE_CANTUNLOCK = 11;
-exports.EE_DIR = 12;
-exports.EE_STAT = 13;
-exports.EE_CANT_CHSIZE = 14;
-exports.EE_CANT_OPEN_STREAM = 15;
-exports.EE_GETWD = 16;
-exports.EE_SETWD = 17;
-exports.EE_LINK_WARNING = 18;
-exports.EE_OPEN_WARNING = 19;
-exports.EE_DISK_FULL = 20;
-exports.EE_CANT_MKDIR = 21;
-exports.EE_UNKNOWN_CHARSET = 22;
-exports.EE_OUT_OF_FILERESOURCES = 23;
-exports.EE_CANT_READLINK = 24;
-exports.EE_CANT_SYMLINK = 25;
-exports.EE_REALPATH = 26;
-exports.EE_SYNC = 27;
-exports.EE_UNKNOWN_COLLATION = 28;
-exports.EE_FILENOTFOUND = 29;
-exports.EE_FILE_NOT_CLOSED = 30;
-exports.EE_CHANGE_OWNERSHIP = 31;
-exports.EE_CHANGE_PERMISSIONS = 32;
-exports.EE_CANT_SEEK = 33;
-exports.EE_CAPACITY_EXCEEDED = 34;
-exports.HA_ERR_KEY_NOT_FOUND = 120;
-exports.HA_ERR_FOUND_DUPP_KEY = 121;
-exports.HA_ERR_INTERNAL_ERROR = 122;
-exports.HA_ERR_RECORD_CHANGED = 123;
-exports.HA_ERR_WRONG_INDEX = 124;
-exports.HA_ERR_CRASHED = 126;
-exports.HA_ERR_WRONG_IN_RECORD = 127;
-exports.HA_ERR_OUT_OF_MEM = 128;
-exports.HA_ERR_NOT_A_TABLE = 130;
-exports.HA_ERR_WRONG_COMMAND = 131;
-exports.HA_ERR_OLD_FILE = 132;
-exports.HA_ERR_NO_ACTIVE_RECORD = 133;
-exports.HA_ERR_RECORD_DELETED = 134;
-exports.HA_ERR_RECORD_FILE_FULL = 135;
-exports.HA_ERR_INDEX_FILE_FULL = 136;
-exports.HA_ERR_END_OF_FILE = 137;
-exports.HA_ERR_UNSUPPORTED = 138;
-exports.HA_ERR_TOO_BIG_ROW = 139;
-exports.HA_WRONG_CREATE_OPTION = 140;
-exports.HA_ERR_FOUND_DUPP_UNIQUE = 141;
-exports.HA_ERR_UNKNOWN_CHARSET = 142;
-exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143;
-exports.HA_ERR_CRASHED_ON_REPAIR = 144;
-exports.HA_ERR_CRASHED_ON_USAGE = 145;
-exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146;
-exports.HA_ERR_LOCK_TABLE_FULL = 147;
-exports.HA_ERR_READ_ONLY_TRANSACTION = 148;
-exports.HA_ERR_LOCK_DEADLOCK = 149;
-exports.HA_ERR_CANNOT_ADD_FOREIGN = 150;
-exports.HA_ERR_NO_REFERENCED_ROW = 151;
-exports.HA_ERR_ROW_IS_REFERENCED = 152;
-exports.HA_ERR_NO_SAVEPOINT = 153;
-exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154;
-exports.HA_ERR_NO_SUCH_TABLE = 155;
-exports.HA_ERR_TABLE_EXIST = 156;
-exports.HA_ERR_NO_CONNECTION = 157;
-exports.HA_ERR_NULL_IN_SPATIAL = 158;
-exports.HA_ERR_TABLE_DEF_CHANGED = 159;
-exports.HA_ERR_NO_PARTITION_FOUND = 160;
-exports.HA_ERR_RBR_LOGGING_FAILED = 161;
-exports.HA_ERR_DROP_INDEX_FK = 162;
-exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163;
-exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164;
-exports.HA_ERR_TABLE_READONLY = 165;
-exports.HA_ERR_AUTOINC_READ_FAILED = 166;
-exports.HA_ERR_AUTOINC_ERANGE = 167;
-exports.HA_ERR_GENERIC = 168;
-exports.HA_ERR_RECORD_IS_THE_SAME = 169;
-exports.HA_ERR_LOGGING_IMPOSSIBLE = 170;
-exports.HA_ERR_CORRUPT_EVENT = 171;
-exports.HA_ERR_NEW_FILE = 172;
-exports.HA_ERR_ROWS_EVENT_APPLY = 173;
-exports.HA_ERR_INITIALIZATION = 174;
-exports.HA_ERR_FILE_TOO_SHORT = 175;
-exports.HA_ERR_WRONG_CRC = 176;
-exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177;
-exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178;
-exports.HA_ERR_INDEX_COL_TOO_LONG = 179;
-exports.HA_ERR_INDEX_CORRUPT = 180;
-exports.HA_ERR_UNDO_REC_TOO_BIG = 181;
-exports.HA_FTS_INVALID_DOCID = 182;
-exports.HA_ERR_TABLE_IN_FK_CHECK = 183;
-exports.HA_ERR_TABLESPACE_EXISTS = 184;
-exports.HA_ERR_TOO_MANY_FIELDS = 185;
-exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186;
-exports.HA_ERR_INNODB_READ_ONLY = 187;
-exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188;
-exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189;
-exports.HA_ERR_INNODB_FORCED_RECOVERY = 190;
-exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191;
-exports.HA_ERR_FK_DEPTH_EXCEEDED = 192;
-exports.HA_MISSING_CREATE_OPTION = 193;
-exports.HA_ERR_SE_OUT_OF_MEMORY = 194;
-exports.HA_ERR_TABLE_CORRUPT = 195;
-exports.HA_ERR_QUERY_INTERRUPTED = 196;
-exports.HA_ERR_TABLESPACE_MISSING = 197;
-exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198;
-exports.HA_ERR_WRONG_FILE_NAME = 199;
-exports.HA_ERR_NOT_ALLOWED_COMMAND = 200;
-exports.HA_ERR_COMPUTE_FAILED = 201;
-exports.ER_HASHCHK = 1000;
-exports.ER_NISAMCHK = 1001;
-exports.ER_NO = 1002;
-exports.ER_YES = 1003;
-exports.ER_CANT_CREATE_FILE = 1004;
-exports.ER_CANT_CREATE_TABLE = 1005;
-exports.ER_CANT_CREATE_DB = 1006;
-exports.ER_DB_CREATE_EXISTS = 1007;
-exports.ER_DB_DROP_EXISTS = 1008;
-exports.ER_DB_DROP_DELETE = 1009;
-exports.ER_DB_DROP_RMDIR = 1010;
-exports.ER_CANT_DELETE_FILE = 1011;
-exports.ER_CANT_FIND_SYSTEM_REC = 1012;
-exports.ER_CANT_GET_STAT = 1013;
-exports.ER_CANT_GET_WD = 1014;
-exports.ER_CANT_LOCK = 1015;
-exports.ER_CANT_OPEN_FILE = 1016;
-exports.ER_FILE_NOT_FOUND = 1017;
-exports.ER_CANT_READ_DIR = 1018;
-exports.ER_CANT_SET_WD = 1019;
-exports.ER_CHECKREAD = 1020;
-exports.ER_DISK_FULL = 1021;
-exports.ER_DUP_KEY = 1022;
-exports.ER_ERROR_ON_CLOSE = 1023;
-exports.ER_ERROR_ON_READ = 1024;
-exports.ER_ERROR_ON_RENAME = 1025;
-exports.ER_ERROR_ON_WRITE = 1026;
-exports.ER_FILE_USED = 1027;
-exports.ER_FILSORT_ABORT = 1028;
-exports.ER_FORM_NOT_FOUND = 1029;
-exports.ER_GET_ERRNO = 1030;
-exports.ER_ILLEGAL_HA = 1031;
-exports.ER_KEY_NOT_FOUND = 1032;
-exports.ER_NOT_FORM_FILE = 1033;
-exports.ER_NOT_KEYFILE = 1034;
-exports.ER_OLD_KEYFILE = 1035;
-exports.ER_OPEN_AS_READONLY = 1036;
-exports.ER_OUTOFMEMORY = 1037;
-exports.ER_OUT_OF_SORTMEMORY = 1038;
-exports.ER_UNEXPECTED_EOF = 1039;
-exports.ER_CON_COUNT_ERROR = 1040;
-exports.ER_OUT_OF_RESOURCES = 1041;
-exports.ER_BAD_HOST_ERROR = 1042;
-exports.ER_HANDSHAKE_ERROR = 1043;
-exports.ER_DBACCESS_DENIED_ERROR = 1044;
-exports.ER_ACCESS_DENIED_ERROR = 1045;
-exports.ER_NO_DB_ERROR = 1046;
-exports.ER_UNKNOWN_COM_ERROR = 1047;
-exports.ER_BAD_NULL_ERROR = 1048;
-exports.ER_BAD_DB_ERROR = 1049;
-exports.ER_TABLE_EXISTS_ERROR = 1050;
-exports.ER_BAD_TABLE_ERROR = 1051;
-exports.ER_NON_UNIQ_ERROR = 1052;
-exports.ER_SERVER_SHUTDOWN = 1053;
-exports.ER_BAD_FIELD_ERROR = 1054;
-exports.ER_WRONG_FIELD_WITH_GROUP = 1055;
-exports.ER_WRONG_GROUP_FIELD = 1056;
-exports.ER_WRONG_SUM_SELECT = 1057;
-exports.ER_WRONG_VALUE_COUNT = 1058;
-exports.ER_TOO_LONG_IDENT = 1059;
-exports.ER_DUP_FIELDNAME = 1060;
-exports.ER_DUP_KEYNAME = 1061;
-exports.ER_DUP_ENTRY = 1062;
-exports.ER_WRONG_FIELD_SPEC = 1063;
-exports.ER_PARSE_ERROR = 1064;
-exports.ER_EMPTY_QUERY = 1065;
-exports.ER_NONUNIQ_TABLE = 1066;
-exports.ER_INVALID_DEFAULT = 1067;
-exports.ER_MULTIPLE_PRI_KEY = 1068;
-exports.ER_TOO_MANY_KEYS = 1069;
-exports.ER_TOO_MANY_KEY_PARTS = 1070;
-exports.ER_TOO_LONG_KEY = 1071;
-exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072;
-exports.ER_BLOB_USED_AS_KEY = 1073;
-exports.ER_TOO_BIG_FIELDLENGTH = 1074;
-exports.ER_WRONG_AUTO_KEY = 1075;
-exports.ER_READY = 1076;
-exports.ER_NORMAL_SHUTDOWN = 1077;
-exports.ER_GOT_SIGNAL = 1078;
-exports.ER_SHUTDOWN_COMPLETE = 1079;
-exports.ER_FORCING_CLOSE = 1080;
-exports.ER_IPSOCK_ERROR = 1081;
-exports.ER_NO_SUCH_INDEX = 1082;
-exports.ER_WRONG_FIELD_TERMINATORS = 1083;
-exports.ER_BLOBS_AND_NO_TERMINATED = 1084;
-exports.ER_TEXTFILE_NOT_READABLE = 1085;
-exports.ER_FILE_EXISTS_ERROR = 1086;
-exports.ER_LOAD_INFO = 1087;
-exports.ER_ALTER_INFO = 1088;
-exports.ER_WRONG_SUB_KEY = 1089;
-exports.ER_CANT_REMOVE_ALL_FIELDS = 1090;
-exports.ER_CANT_DROP_FIELD_OR_KEY = 1091;
-exports.ER_INSERT_INFO = 1092;
-exports.ER_UPDATE_TABLE_USED = 1093;
-exports.ER_NO_SUCH_THREAD = 1094;
-exports.ER_KILL_DENIED_ERROR = 1095;
-exports.ER_NO_TABLES_USED = 1096;
-exports.ER_TOO_BIG_SET = 1097;
-exports.ER_NO_UNIQUE_LOGFILE = 1098;
-exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099;
-exports.ER_TABLE_NOT_LOCKED = 1100;
-exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101;
-exports.ER_WRONG_DB_NAME = 1102;
-exports.ER_WRONG_TABLE_NAME = 1103;
-exports.ER_TOO_BIG_SELECT = 1104;
-exports.ER_UNKNOWN_ERROR = 1105;
-exports.ER_UNKNOWN_PROCEDURE = 1106;
-exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107;
-exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108;
-exports.ER_UNKNOWN_TABLE = 1109;
-exports.ER_FIELD_SPECIFIED_TWICE = 1110;
-exports.ER_INVALID_GROUP_FUNC_USE = 1111;
-exports.ER_UNSUPPORTED_EXTENSION = 1112;
-exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113;
-exports.ER_RECORD_FILE_FULL = 1114;
-exports.ER_UNKNOWN_CHARACTER_SET = 1115;
-exports.ER_TOO_MANY_TABLES = 1116;
-exports.ER_TOO_MANY_FIELDS = 1117;
-exports.ER_TOO_BIG_ROWSIZE = 1118;
-exports.ER_STACK_OVERRUN = 1119;
-exports.ER_WRONG_OUTER_JOIN = 1120;
-exports.ER_NULL_COLUMN_IN_INDEX = 1121;
-exports.ER_CANT_FIND_UDF = 1122;
-exports.ER_CANT_INITIALIZE_UDF = 1123;
-exports.ER_UDF_NO_PATHS = 1124;
-exports.ER_UDF_EXISTS = 1125;
-exports.ER_CANT_OPEN_LIBRARY = 1126;
-exports.ER_CANT_FIND_DL_ENTRY = 1127;
-exports.ER_FUNCTION_NOT_DEFINED = 1128;
-exports.ER_HOST_IS_BLOCKED = 1129;
-exports.ER_HOST_NOT_PRIVILEGED = 1130;
-exports.ER_PASSWORD_ANONYMOUS_USER = 1131;
-exports.ER_PASSWORD_NOT_ALLOWED = 1132;
-exports.ER_PASSWORD_NO_MATCH = 1133;
-exports.ER_UPDATE_INFO = 1134;
-exports.ER_CANT_CREATE_THREAD = 1135;
-exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136;
-exports.ER_CANT_REOPEN_TABLE = 1137;
-exports.ER_INVALID_USE_OF_NULL = 1138;
-exports.ER_REGEXP_ERROR = 1139;
-exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140;
-exports.ER_NONEXISTING_GRANT = 1141;
-exports.ER_TABLEACCESS_DENIED_ERROR = 1142;
-exports.ER_COLUMNACCESS_DENIED_ERROR = 1143;
-exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144;
-exports.ER_GRANT_WRONG_HOST_OR_USER = 1145;
-exports.ER_NO_SUCH_TABLE = 1146;
-exports.ER_NONEXISTING_TABLE_GRANT = 1147;
-exports.ER_NOT_ALLOWED_COMMAND = 1148;
-exports.ER_SYNTAX_ERROR = 1149;
-exports.ER_DELAYED_CANT_CHANGE_LOCK = 1150;
-exports.ER_TOO_MANY_DELAYED_THREADS = 1151;
-exports.ER_ABORTING_CONNECTION = 1152;
-exports.ER_NET_PACKET_TOO_LARGE = 1153;
-exports.ER_NET_READ_ERROR_FROM_PIPE = 1154;
-exports.ER_NET_FCNTL_ERROR = 1155;
-exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156;
-exports.ER_NET_UNCOMPRESS_ERROR = 1157;
-exports.ER_NET_READ_ERROR = 1158;
-exports.ER_NET_READ_INTERRUPTED = 1159;
-exports.ER_NET_ERROR_ON_WRITE = 1160;
-exports.ER_NET_WRITE_INTERRUPTED = 1161;
-exports.ER_TOO_LONG_STRING = 1162;
-exports.ER_TABLE_CANT_HANDLE_BLOB = 1163;
-exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164;
-exports.ER_DELAYED_INSERT_TABLE_LOCKED = 1165;
-exports.ER_WRONG_COLUMN_NAME = 1166;
-exports.ER_WRONG_KEY_COLUMN = 1167;
-exports.ER_WRONG_MRG_TABLE = 1168;
-exports.ER_DUP_UNIQUE = 1169;
-exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170;
-exports.ER_PRIMARY_CANT_HAVE_NULL = 1171;
-exports.ER_TOO_MANY_ROWS = 1172;
-exports.ER_REQUIRES_PRIMARY_KEY = 1173;
-exports.ER_NO_RAID_COMPILED = 1174;
-exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175;
-exports.ER_KEY_DOES_NOT_EXITS = 1176;
-exports.ER_CHECK_NO_SUCH_TABLE = 1177;
-exports.ER_CHECK_NOT_IMPLEMENTED = 1178;
-exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179;
-exports.ER_ERROR_DURING_COMMIT = 1180;
-exports.ER_ERROR_DURING_ROLLBACK = 1181;
-exports.ER_ERROR_DURING_FLUSH_LOGS = 1182;
-exports.ER_ERROR_DURING_CHECKPOINT = 1183;
-exports.ER_NEW_ABORTING_CONNECTION = 1184;
-exports.ER_DUMP_NOT_IMPLEMENTED = 1185;
-exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186;
-exports.ER_INDEX_REBUILD = 1187;
-exports.ER_MASTER = 1188;
-exports.ER_MASTER_NET_READ = 1189;
-exports.ER_MASTER_NET_WRITE = 1190;
-exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191;
-exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192;
-exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193;
-exports.ER_CRASHED_ON_USAGE = 1194;
-exports.ER_CRASHED_ON_REPAIR = 1195;
-exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196;
-exports.ER_TRANS_CACHE_FULL = 1197;
-exports.ER_SLAVE_MUST_STOP = 1198;
-exports.ER_SLAVE_NOT_RUNNING = 1199;
-exports.ER_BAD_SLAVE = 1200;
-exports.ER_MASTER_INFO = 1201;
-exports.ER_SLAVE_THREAD = 1202;
-exports.ER_TOO_MANY_USER_CONNECTIONS = 1203;
-exports.ER_SET_CONSTANTS_ONLY = 1204;
-exports.ER_LOCK_WAIT_TIMEOUT = 1205;
-exports.ER_LOCK_TABLE_FULL = 1206;
-exports.ER_READ_ONLY_TRANSACTION = 1207;
-exports.ER_DROP_DB_WITH_READ_LOCK = 1208;
-exports.ER_CREATE_DB_WITH_READ_LOCK = 1209;
-exports.ER_WRONG_ARGUMENTS = 1210;
-exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211;
-exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212;
-exports.ER_LOCK_DEADLOCK = 1213;
-exports.ER_TABLE_CANT_HANDLE_FT = 1214;
-exports.ER_CANNOT_ADD_FOREIGN = 1215;
-exports.ER_NO_REFERENCED_ROW = 1216;
-exports.ER_ROW_IS_REFERENCED = 1217;
-exports.ER_CONNECT_TO_MASTER = 1218;
-exports.ER_QUERY_ON_MASTER = 1219;
-exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220;
-exports.ER_WRONG_USAGE = 1221;
-exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222;
-exports.ER_CANT_UPDATE_WITH_READLOCK = 1223;
-exports.ER_MIXING_NOT_ALLOWED = 1224;
-exports.ER_DUP_ARGUMENT = 1225;
-exports.ER_USER_LIMIT_REACHED = 1226;
-exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227;
-exports.ER_LOCAL_VARIABLE = 1228;
-exports.ER_GLOBAL_VARIABLE = 1229;
-exports.ER_NO_DEFAULT = 1230;
-exports.ER_WRONG_VALUE_FOR_VAR = 1231;
-exports.ER_WRONG_TYPE_FOR_VAR = 1232;
-exports.ER_VAR_CANT_BE_READ = 1233;
-exports.ER_CANT_USE_OPTION_HERE = 1234;
-exports.ER_NOT_SUPPORTED_YET = 1235;
-exports.ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236;
-exports.ER_SLAVE_IGNORED_TABLE = 1237;
-exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238;
-exports.ER_WRONG_FK_DEF = 1239;
-exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240;
-exports.ER_OPERAND_COLUMNS = 1241;
-exports.ER_SUBQUERY_NO_1_ROW = 1242;
-exports.ER_UNKNOWN_STMT_HANDLER = 1243;
-exports.ER_CORRUPT_HELP_DB = 1244;
-exports.ER_CYCLIC_REFERENCE = 1245;
-exports.ER_AUTO_CONVERT = 1246;
-exports.ER_ILLEGAL_REFERENCE = 1247;
-exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248;
-exports.ER_SELECT_REDUCED = 1249;
-exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250;
-exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251;
-exports.ER_SPATIAL_CANT_HAVE_NULL = 1252;
-exports.ER_COLLATION_CHARSET_MISMATCH = 1253;
-exports.ER_SLAVE_WAS_RUNNING = 1254;
-exports.ER_SLAVE_WAS_NOT_RUNNING = 1255;
-exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256;
-exports.ER_ZLIB_Z_MEM_ERROR = 1257;
-exports.ER_ZLIB_Z_BUF_ERROR = 1258;
-exports.ER_ZLIB_Z_DATA_ERROR = 1259;
-exports.ER_CUT_VALUE_GROUP_CONCAT = 1260;
-exports.ER_WARN_TOO_FEW_RECORDS = 1261;
-exports.ER_WARN_TOO_MANY_RECORDS = 1262;
-exports.ER_WARN_NULL_TO_NOTNULL = 1263;
-exports.ER_WARN_DATA_OUT_OF_RANGE = 1264;
-exports.WARN_DATA_TRUNCATED = 1265;
-exports.ER_WARN_USING_OTHER_HANDLER = 1266;
-exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267;
-exports.ER_DROP_USER = 1268;
-exports.ER_REVOKE_GRANTS = 1269;
-exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270;
-exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271;
-exports.ER_VARIABLE_IS_NOT_STRUCT = 1272;
-exports.ER_UNKNOWN_COLLATION = 1273;
-exports.ER_SLAVE_IGNORED_SSL_PARAMS = 1274;
-exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275;
-exports.ER_WARN_FIELD_RESOLVED = 1276;
-exports.ER_BAD_SLAVE_UNTIL_COND = 1277;
-exports.ER_MISSING_SKIP_SLAVE = 1278;
-exports.ER_UNTIL_COND_IGNORED = 1279;
-exports.ER_WRONG_NAME_FOR_INDEX = 1280;
-exports.ER_WRONG_NAME_FOR_CATALOG = 1281;
-exports.ER_WARN_QC_RESIZE = 1282;
-exports.ER_BAD_FT_COLUMN = 1283;
-exports.ER_UNKNOWN_KEY_CACHE = 1284;
-exports.ER_WARN_HOSTNAME_WONT_WORK = 1285;
-exports.ER_UNKNOWN_STORAGE_ENGINE = 1286;
-exports.ER_WARN_DEPRECATED_SYNTAX = 1287;
-exports.ER_NON_UPDATABLE_TABLE = 1288;
-exports.ER_FEATURE_DISABLED = 1289;
-exports.ER_OPTION_PREVENTS_STATEMENT = 1290;
-exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291;
-exports.ER_TRUNCATED_WRONG_VALUE = 1292;
-exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293;
-exports.ER_INVALID_ON_UPDATE = 1294;
-exports.ER_UNSUPPORTED_PS = 1295;
-exports.ER_GET_ERRMSG = 1296;
-exports.ER_GET_TEMPORARY_ERRMSG = 1297;
-exports.ER_UNKNOWN_TIME_ZONE = 1298;
-exports.ER_WARN_INVALID_TIMESTAMP = 1299;
-exports.ER_INVALID_CHARACTER_STRING = 1300;
-exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301;
-exports.ER_CONFLICTING_DECLARATIONS = 1302;
-exports.ER_SP_NO_RECURSIVE_CREATE = 1303;
-exports.ER_SP_ALREADY_EXISTS = 1304;
-exports.ER_SP_DOES_NOT_EXIST = 1305;
-exports.ER_SP_DROP_FAILED = 1306;
-exports.ER_SP_STORE_FAILED = 1307;
-exports.ER_SP_LILABEL_MISMATCH = 1308;
-exports.ER_SP_LABEL_REDEFINE = 1309;
-exports.ER_SP_LABEL_MISMATCH = 1310;
-exports.ER_SP_UNINIT_VAR = 1311;
-exports.ER_SP_BADSELECT = 1312;
-exports.ER_SP_BADRETURN = 1313;
-exports.ER_SP_BADSTATEMENT = 1314;
-exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315;
-exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316;
-exports.ER_QUERY_INTERRUPTED = 1317;
-exports.ER_SP_WRONG_NO_OF_ARGS = 1318;
-exports.ER_SP_COND_MISMATCH = 1319;
-exports.ER_SP_NORETURN = 1320;
-exports.ER_SP_NORETURNEND = 1321;
-exports.ER_SP_BAD_CURSOR_QUERY = 1322;
-exports.ER_SP_BAD_CURSOR_SELECT = 1323;
-exports.ER_SP_CURSOR_MISMATCH = 1324;
-exports.ER_SP_CURSOR_ALREADY_OPEN = 1325;
-exports.ER_SP_CURSOR_NOT_OPEN = 1326;
-exports.ER_SP_UNDECLARED_VAR = 1327;
-exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328;
-exports.ER_SP_FETCH_NO_DATA = 1329;
-exports.ER_SP_DUP_PARAM = 1330;
-exports.ER_SP_DUP_VAR = 1331;
-exports.ER_SP_DUP_COND = 1332;
-exports.ER_SP_DUP_CURS = 1333;
-exports.ER_SP_CANT_ALTER = 1334;
-exports.ER_SP_SUBSELECT_NYI = 1335;
-exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336;
-exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337;
-exports.ER_SP_CURSOR_AFTER_HANDLER = 1338;
-exports.ER_SP_CASE_NOT_FOUND = 1339;
-exports.ER_FPARSER_TOO_BIG_FILE = 1340;
-exports.ER_FPARSER_BAD_HEADER = 1341;
-exports.ER_FPARSER_EOF_IN_COMMENT = 1342;
-exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343;
-exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344;
-exports.ER_VIEW_NO_EXPLAIN = 1345;
-exports.ER_FRM_UNKNOWN_TYPE = 1346;
-exports.ER_WRONG_OBJECT = 1347;
-exports.ER_NONUPDATEABLE_COLUMN = 1348;
-exports.ER_VIEW_SELECT_DERIVED = 1349;
-exports.ER_VIEW_SELECT_CLAUSE = 1350;
-exports.ER_VIEW_SELECT_VARIABLE = 1351;
-exports.ER_VIEW_SELECT_TMPTABLE = 1352;
-exports.ER_VIEW_WRONG_LIST = 1353;
-exports.ER_WARN_VIEW_MERGE = 1354;
-exports.ER_WARN_VIEW_WITHOUT_KEY = 1355;
-exports.ER_VIEW_INVALID = 1356;
-exports.ER_SP_NO_DROP_SP = 1357;
-exports.ER_SP_GOTO_IN_HNDLR = 1358;
-exports.ER_TRG_ALREADY_EXISTS = 1359;
-exports.ER_TRG_DOES_NOT_EXIST = 1360;
-exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361;
-exports.ER_TRG_CANT_CHANGE_ROW = 1362;
-exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363;
-exports.ER_NO_DEFAULT_FOR_FIELD = 1364;
-exports.ER_DIVISION_BY_ZERO = 1365;
-exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366;
-exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367;
-exports.ER_VIEW_NONUPD_CHECK = 1368;
-exports.ER_VIEW_CHECK_FAILED = 1369;
-exports.ER_PROCACCESS_DENIED_ERROR = 1370;
-exports.ER_RELAY_LOG_FAIL = 1371;
-exports.ER_PASSWD_LENGTH = 1372;
-exports.ER_UNKNOWN_TARGET_BINLOG = 1373;
-exports.ER_IO_ERR_LOG_INDEX_READ = 1374;
-exports.ER_BINLOG_PURGE_PROHIBITED = 1375;
-exports.ER_FSEEK_FAIL = 1376;
-exports.ER_BINLOG_PURGE_FATAL_ERR = 1377;
-exports.ER_LOG_IN_USE = 1378;
-exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379;
-exports.ER_RELAY_LOG_INIT = 1380;
-exports.ER_NO_BINARY_LOGGING = 1381;
-exports.ER_RESERVED_SYNTAX = 1382;
-exports.ER_WSAS_FAILED = 1383;
-exports.ER_DIFF_GROUPS_PROC = 1384;
-exports.ER_NO_GROUP_FOR_PROC = 1385;
-exports.ER_ORDER_WITH_PROC = 1386;
-exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387;
-exports.ER_NO_FILE_MAPPING = 1388;
-exports.ER_WRONG_MAGIC = 1389;
-exports.ER_PS_MANY_PARAM = 1390;
-exports.ER_KEY_PART_0 = 1391;
-exports.ER_VIEW_CHECKSUM = 1392;
-exports.ER_VIEW_MULTIUPDATE = 1393;
-exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394;
-exports.ER_VIEW_DELETE_MERGE_VIEW = 1395;
-exports.ER_CANNOT_USER = 1396;
-exports.ER_XAER_NOTA = 1397;
-exports.ER_XAER_INVAL = 1398;
-exports.ER_XAER_RMFAIL = 1399;
-exports.ER_XAER_OUTSIDE = 1400;
-exports.ER_XAER_RMERR = 1401;
-exports.ER_XA_RBROLLBACK = 1402;
-exports.ER_NONEXISTING_PROC_GRANT = 1403;
-exports.ER_PROC_AUTO_GRANT_FAIL = 1404;
-exports.ER_PROC_AUTO_REVOKE_FAIL = 1405;
-exports.ER_DATA_TOO_LONG = 1406;
-exports.ER_SP_BAD_SQLSTATE = 1407;
-exports.ER_STARTUP = 1408;
-exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409;
-exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410;
-exports.ER_WRONG_VALUE_FOR_TYPE = 1411;
-exports.ER_TABLE_DEF_CHANGED = 1412;
-exports.ER_SP_DUP_HANDLER = 1413;
-exports.ER_SP_NOT_VAR_ARG = 1414;
-exports.ER_SP_NO_RETSET = 1415;
-exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416;
-exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417;
-exports.ER_BINLOG_UNSAFE_ROUTINE = 1418;
-exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419;
-exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420;
-exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421;
-exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422;
-exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423;
-exports.ER_SP_NO_RECURSION = 1424;
-exports.ER_TOO_BIG_SCALE = 1425;
-exports.ER_TOO_BIG_PRECISION = 1426;
-exports.ER_M_BIGGER_THAN_D = 1427;
-exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428;
-exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429;
-exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430;
-exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431;
-exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432;
-exports.ER_FOREIGN_DATA_STRING_INVALID = 1433;
-exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434;
-exports.ER_TRG_IN_WRONG_SCHEMA = 1435;
-exports.ER_STACK_OVERRUN_NEED_MORE = 1436;
-exports.ER_TOO_LONG_BODY = 1437;
-exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438;
-exports.ER_TOO_BIG_DISPLAYWIDTH = 1439;
-exports.ER_XAER_DUPID = 1440;
-exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441;
-exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442;
-exports.ER_VIEW_PREVENT_UPDATE = 1443;
-exports.ER_PS_NO_RECURSION = 1444;
-exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445;
-exports.ER_MALFORMED_DEFINER = 1446;
-exports.ER_VIEW_FRM_NO_USER = 1447;
-exports.ER_VIEW_OTHER_USER = 1448;
-exports.ER_NO_SUCH_USER = 1449;
-exports.ER_FORBID_SCHEMA_CHANGE = 1450;
-exports.ER_ROW_IS_REFERENCED_2 = 1451;
-exports.ER_NO_REFERENCED_ROW_2 = 1452;
-exports.ER_SP_BAD_VAR_SHADOW = 1453;
-exports.ER_TRG_NO_DEFINER = 1454;
-exports.ER_OLD_FILE_FORMAT = 1455;
-exports.ER_SP_RECURSION_LIMIT = 1456;
-exports.ER_SP_PROC_TABLE_CORRUPT = 1457;
-exports.ER_SP_WRONG_NAME = 1458;
-exports.ER_TABLE_NEEDS_UPGRADE = 1459;
-exports.ER_SP_NO_AGGREGATE = 1460;
-exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461;
-exports.ER_VIEW_RECURSIVE = 1462;
-exports.ER_NON_GROUPING_FIELD_USED = 1463;
-exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464;
-exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465;
-exports.ER_REMOVED_SPACES = 1466;
-exports.ER_AUTOINC_READ_FAILED = 1467;
-exports.ER_USERNAME = 1468;
-exports.ER_HOSTNAME = 1469;
-exports.ER_WRONG_STRING_LENGTH = 1470;
-exports.ER_NON_INSERTABLE_TABLE = 1471;
-exports.ER_ADMIN_WRONG_MRG_TABLE = 1472;
-exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473;
-exports.ER_NAME_BECOMES_EMPTY = 1474;
-exports.ER_AMBIGUOUS_FIELD_TERM = 1475;
-exports.ER_FOREIGN_SERVER_EXISTS = 1476;
-exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477;
-exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478;
-exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479;
-exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480;
-exports.ER_PARTITION_MAXVALUE_ERROR = 1481;
-exports.ER_PARTITION_SUBPARTITION_ERROR = 1482;
-exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483;
-exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484;
-exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485;
-exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486;
-exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487;
-exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488;
-exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489;
-exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490;
-exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491;
-exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492;
-exports.ER_RANGE_NOT_INCREASING_ERROR = 1493;
-exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494;
-exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495;
-exports.ER_PARTITION_ENTRY_ERROR = 1496;
-exports.ER_MIX_HANDLER_ERROR = 1497;
-exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498;
-exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499;
-exports.ER_SUBPARTITION_ERROR = 1500;
-exports.ER_CANT_CREATE_HANDLER_FILE = 1501;
-exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502;
-exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503;
-exports.ER_NO_PARTS_ERROR = 1504;
-exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505;
-exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506;
-exports.ER_DROP_PARTITION_NON_EXISTENT = 1507;
-exports.ER_DROP_LAST_PARTITION = 1508;
-exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509;
-exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510;
-exports.ER_REORG_NO_PARAM_ERROR = 1511;
-exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512;
-exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513;
-exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514;
-exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515;
-exports.ER_REORG_PARTITION_NOT_EXIST = 1516;
-exports.ER_SAME_NAME_PARTITION = 1517;
-exports.ER_NO_BINLOG_ERROR = 1518;
-exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519;
-exports.ER_REORG_OUTSIDE_RANGE = 1520;
-exports.ER_PARTITION_FUNCTION_FAILURE = 1521;
-exports.ER_PART_STATE_ERROR = 1522;
-exports.ER_LIMITED_PART_RANGE = 1523;
-exports.ER_PLUGIN_IS_NOT_LOADED = 1524;
-exports.ER_WRONG_VALUE = 1525;
-exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526;
-exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527;
-exports.ER_CREATE_FILEGROUP_FAILED = 1528;
-exports.ER_DROP_FILEGROUP_FAILED = 1529;
-exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530;
-exports.ER_WRONG_SIZE_NUMBER = 1531;
-exports.ER_SIZE_OVERFLOW_ERROR = 1532;
-exports.ER_ALTER_FILEGROUP_FAILED = 1533;
-exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534;
-exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535;
-exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536;
-exports.ER_EVENT_ALREADY_EXISTS = 1537;
-exports.ER_EVENT_STORE_FAILED = 1538;
-exports.ER_EVENT_DOES_NOT_EXIST = 1539;
-exports.ER_EVENT_CANT_ALTER = 1540;
-exports.ER_EVENT_DROP_FAILED = 1541;
-exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542;
-exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543;
-exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544;
-exports.ER_EVENT_OPEN_TABLE_FAILED = 1545;
-exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546;
-exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547;
-exports.ER_CANNOT_LOAD_FROM_TABLE = 1548;
-exports.ER_EVENT_CANNOT_DELETE = 1549;
-exports.ER_EVENT_COMPILE_ERROR = 1550;
-exports.ER_EVENT_SAME_NAME = 1551;
-exports.ER_EVENT_DATA_TOO_LONG = 1552;
-exports.ER_DROP_INDEX_FK = 1553;
-exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554;
-exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555;
-exports.ER_CANT_LOCK_LOG_TABLE = 1556;
-exports.ER_FOREIGN_DUPLICATE_KEY = 1557;
-exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558;
-exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559;
-exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560;
-exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561;
-exports.ER_PARTITION_NO_TEMPORARY = 1562;
-exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563;
-exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564;
-exports.ER_DDL_LOG_ERROR = 1565;
-exports.ER_NULL_IN_VALUES_LESS_THAN = 1566;
-exports.ER_WRONG_PARTITION_NAME = 1567;
-exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568;
-exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569;
-exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570;
-exports.ER_EVENT_SET_VAR_ERROR = 1571;
-exports.ER_PARTITION_MERGE_ERROR = 1572;
-exports.ER_CANT_ACTIVATE_LOG = 1573;
-exports.ER_RBR_NOT_AVAILABLE = 1574;
-exports.ER_BASE64_DECODE_ERROR = 1575;
-exports.ER_EVENT_RECURSION_FORBIDDEN = 1576;
-exports.ER_EVENTS_DB_ERROR = 1577;
-exports.ER_ONLY_INTEGERS_ALLOWED = 1578;
-exports.ER_UNSUPORTED_LOG_ENGINE = 1579;
-exports.ER_BAD_LOG_STATEMENT = 1580;
-exports.ER_CANT_RENAME_LOG_TABLE = 1581;
-exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582;
-exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583;
-exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584;
-exports.ER_NATIVE_FCT_NAME_COLLISION = 1585;
-exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586;
-exports.ER_BINLOG_PURGE_EMFILE = 1587;
-exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588;
-exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589;
-exports.ER_SLAVE_INCIDENT = 1590;
-exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591;
-exports.ER_BINLOG_UNSAFE_STATEMENT = 1592;
-exports.ER_SLAVE_FATAL_ERROR = 1593;
-exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594;
-exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595;
-exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596;
-exports.ER_SLAVE_MASTER_COM_FAILURE = 1597;
-exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598;
-exports.ER_VIEW_NO_CREATION_CTX = 1599;
-exports.ER_VIEW_INVALID_CREATION_CTX = 1600;
-exports.ER_SR_INVALID_CREATION_CTX = 1601;
-exports.ER_TRG_CORRUPTED_FILE = 1602;
-exports.ER_TRG_NO_CREATION_CTX = 1603;
-exports.ER_TRG_INVALID_CREATION_CTX = 1604;
-exports.ER_EVENT_INVALID_CREATION_CTX = 1605;
-exports.ER_TRG_CANT_OPEN_TABLE = 1606;
-exports.ER_CANT_CREATE_SROUTINE = 1607;
-exports.ER_NEVER_USED = 1608;
-exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609;
-exports.ER_SLAVE_CORRUPT_EVENT = 1610;
-exports.ER_LOAD_DATA_INVALID_COLUMN = 1611;
-exports.ER_LOG_PURGE_NO_FILE = 1612;
-exports.ER_XA_RBTIMEOUT = 1613;
-exports.ER_XA_RBDEADLOCK = 1614;
-exports.ER_NEED_REPREPARE = 1615;
-exports.ER_DELAYED_NOT_SUPPORTED = 1616;
-exports.WARN_NO_MASTER_INFO = 1617;
-exports.WARN_OPTION_IGNORED = 1618;
-exports.ER_PLUGIN_DELETE_BUILTIN = 1619;
-exports.WARN_PLUGIN_BUSY = 1620;
-exports.ER_VARIABLE_IS_READONLY = 1621;
-exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622;
-exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623;
-exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624;
-exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625;
-exports.ER_CONFLICT_FN_PARSE_ERROR = 1626;
-exports.ER_EXCEPTIONS_WRITE_ERROR = 1627;
-exports.ER_TOO_LONG_TABLE_COMMENT = 1628;
-exports.ER_TOO_LONG_FIELD_COMMENT = 1629;
-exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630;
-exports.ER_DATABASE_NAME = 1631;
-exports.ER_TABLE_NAME = 1632;
-exports.ER_PARTITION_NAME = 1633;
-exports.ER_SUBPARTITION_NAME = 1634;
-exports.ER_TEMPORARY_NAME = 1635;
-exports.ER_RENAMED_NAME = 1636;
-exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637;
-exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638;
-exports.ER_DEBUG_SYNC_TIMEOUT = 1639;
-exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640;
-exports.ER_DUP_SIGNAL_SET = 1641;
-exports.ER_SIGNAL_WARN = 1642;
-exports.ER_SIGNAL_NOT_FOUND = 1643;
-exports.ER_SIGNAL_EXCEPTION = 1644;
-exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645;
-exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646;
-exports.WARN_COND_ITEM_TRUNCATED = 1647;
-exports.ER_COND_ITEM_TOO_LONG = 1648;
-exports.ER_UNKNOWN_LOCALE = 1649;
-exports.ER_SLAVE_IGNORE_SERVER_IDS = 1650;
-exports.ER_QUERY_CACHE_DISABLED = 1651;
-exports.ER_SAME_NAME_PARTITION_FIELD = 1652;
-exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653;
-exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654;
-exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655;
-exports.ER_MAXVALUE_IN_VALUES_IN = 1656;
-exports.ER_TOO_MANY_VALUES_ERROR = 1657;
-exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658;
-exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659;
-exports.ER_PARTITION_FIELDS_TOO_LONG = 1660;
-exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661;
-exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662;
-exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663;
-exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664;
-exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665;
-exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666;
-exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667;
-exports.ER_BINLOG_UNSAFE_LIMIT = 1668;
-exports.ER_BINLOG_UNSAFE_INSERT_DELAYED = 1669;
-exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670;
-exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671;
-exports.ER_BINLOG_UNSAFE_UDF = 1672;
-exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673;
-exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674;
-exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675;
-exports.ER_MESSAGE_AND_STATEMENT = 1676;
-exports.ER_SLAVE_CONVERSION_FAILED = 1677;
-exports.ER_SLAVE_CANT_CREATE_CONVERSION = 1678;
-exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679;
-exports.ER_PATH_LENGTH = 1680;
-exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681;
-exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682;
-exports.ER_WRONG_PERFSCHEMA_USAGE = 1683;
-exports.ER_WARN_I_S_SKIPPED_TABLE = 1684;
-exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685;
-exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686;
-exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687;
-exports.ER_TOO_LONG_INDEX_COMMENT = 1688;
-exports.ER_LOCK_ABORTED = 1689;
-exports.ER_DATA_OUT_OF_RANGE = 1690;
-exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691;
-exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692;
-exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693;
-exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694;
-exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695;
-exports.ER_FAILED_READ_FROM_PAR_FILE = 1696;
-exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697;
-exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698;
-exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699;
-exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700;
-exports.ER_TRUNCATE_ILLEGAL_FK = 1701;
-exports.ER_PLUGIN_IS_PERMANENT = 1702;
-exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703;
-exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704;
-exports.ER_STMT_CACHE_FULL = 1705;
-exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706;
-exports.ER_TABLE_NEEDS_REBUILD = 1707;
-exports.WARN_OPTION_BELOW_LIMIT = 1708;
-exports.ER_INDEX_COLUMN_TOO_LONG = 1709;
-exports.ER_ERROR_IN_TRIGGER_BODY = 1710;
-exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711;
-exports.ER_INDEX_CORRUPT = 1712;
-exports.ER_UNDO_RECORD_TOO_BIG = 1713;
-exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714;
-exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715;
-exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716;
-exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717;
-exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718;
-exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719;
-exports.ER_PLUGIN_NO_UNINSTALL = 1720;
-exports.ER_PLUGIN_NO_INSTALL = 1721;
-exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722;
-exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723;
-exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724;
-exports.ER_TABLE_IN_FK_CHECK = 1725;
-exports.ER_UNSUPPORTED_ENGINE = 1726;
-exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727;
-exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728;
-exports.ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729;
-exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730;
-exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731;
-exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732;
-exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733;
-exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734;
-exports.ER_UNKNOWN_PARTITION = 1735;
-exports.ER_TABLES_DIFFERENT_METADATA = 1736;
-exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737;
-exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738;
-exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739;
-exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740;
-exports.ER_NO_SUCH_KEY_VALUE = 1741;
-exports.ER_RPL_INFO_DATA_TOO_LONG = 1742;
-exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743;
-exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744;
-exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745;
-exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746;
-exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747;
-exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748;
-exports.ER_NO_SUCH_PARTITION = 1749;
-exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750;
-exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751;
-exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752;
-exports.ER_MTS_FEATURE_IS_NOT_SUPPORTED = 1753;
-exports.ER_MTS_UPDATED_DBS_GREATER_MAX = 1754;
-exports.ER_MTS_CANT_PARALLEL = 1755;
-exports.ER_MTS_INCONSISTENT_DATA = 1756;
-exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757;
-exports.ER_DA_INVALID_CONDITION_NUMBER = 1758;
-exports.ER_INSECURE_PLAIN_TEXT = 1759;
-exports.ER_INSECURE_CHANGE_MASTER = 1760;
-exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761;
-exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762;
-exports.ER_SQLTHREAD_WITH_SECURE_SLAVE = 1763;
-exports.ER_TABLE_HAS_NO_FT = 1764;
-exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765;
-exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766;
-exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767;
-exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768;
-exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769;
-exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770;
-exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771;
-exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772;
-exports.ER_MALFORMED_GTID_SET_ENCODING = 1773;
-exports.ER_MALFORMED_GTID_SPECIFICATION = 1774;
-exports.ER_GNO_EXHAUSTED = 1775;
-exports.ER_BAD_SLAVE_AUTO_POSITION = 1776;
-exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777;
-exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778;
-exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779;
-exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780;
-exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781;
-exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782;
-exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783;
-exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784;
-exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785;
-exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786;
-exports.ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION = 1787;
-exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788;
-exports.ER_MASTER_HAS_PURGED_REQUIRED_GTIDS = 1789;
-exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790;
-exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791;
-exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792;
-exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793;
-exports.ER_SLAVE_CONFIGURATION = 1794;
-exports.ER_INNODB_FT_LIMIT = 1795;
-exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796;
-exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797;
-exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798;
-exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799;
-exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800;
-exports.ER_UNKNOWN_ALTER_LOCK = 1801;
-exports.ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802;
-exports.ER_MTS_RECOVERY_FAILURE = 1803;
-exports.ER_MTS_RESET_WORKERS = 1804;
-exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805;
-exports.ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806;
-exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807;
-exports.ER_TABLE_SCHEMA_MISMATCH = 1808;
-exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809;
-exports.ER_IO_READ_ERROR = 1810;
-exports.ER_IO_WRITE_ERROR = 1811;
-exports.ER_TABLESPACE_MISSING = 1812;
-exports.ER_TABLESPACE_EXISTS = 1813;
-exports.ER_TABLESPACE_DISCARDED = 1814;
-exports.ER_INTERNAL_ERROR = 1815;
-exports.ER_INNODB_IMPORT_ERROR = 1816;
-exports.ER_INNODB_INDEX_CORRUPT = 1817;
-exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818;
-exports.ER_NOT_VALID_PASSWORD = 1819;
-exports.ER_MUST_CHANGE_PASSWORD = 1820;
-exports.ER_FK_NO_INDEX_CHILD = 1821;
-exports.ER_FK_NO_INDEX_PARENT = 1822;
-exports.ER_FK_FAIL_ADD_SYSTEM = 1823;
-exports.ER_FK_CANNOT_OPEN_PARENT = 1824;
-exports.ER_FK_INCORRECT_OPTION = 1825;
-exports.ER_FK_DUP_NAME = 1826;
-exports.ER_PASSWORD_FORMAT = 1827;
-exports.ER_FK_COLUMN_CANNOT_DROP = 1828;
-exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829;
-exports.ER_FK_COLUMN_NOT_NULL = 1830;
-exports.ER_DUP_INDEX = 1831;
-exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832;
-exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833;
-exports.ER_FK_CANNOT_DELETE_PARENT = 1834;
-exports.ER_MALFORMED_PACKET = 1835;
-exports.ER_READ_ONLY_MODE = 1836;
-exports.ER_GTID_NEXT_TYPE_UNDEFINED_GROUP = 1837;
-exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838;
-exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839;
-exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840;
-exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841;
-exports.ER_GTID_PURGED_WAS_CHANGED = 1842;
-exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843;
-exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE = 1852;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857;
-exports.ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858;
-exports.ER_DUP_UNKNOWN_IN_INDEX = 1859;
-exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861;
-exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862;
-exports.ER_ROW_IN_WRONG_PARTITION = 1863;
-exports.ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864;
-exports.ER_INNODB_NO_FT_USES_PARSER = 1865;
-exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866;
-exports.ER_WARN_PURGE_LOG_IN_USE = 1867;
-exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868;
-exports.ER_AUTO_INCREMENT_CONFLICT = 1869;
-exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870;
-exports.ER_SLAVE_MI_INIT_REPOSITORY = 1871;
-exports.ER_SLAVE_RLI_INIT_REPOSITORY = 1872;
-exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873;
-exports.ER_INNODB_READ_ONLY = 1874;
-exports.ER_STOP_SLAVE_SQL_THREAD_TIMEOUT = 1875;
-exports.ER_STOP_SLAVE_IO_THREAD_TIMEOUT = 1876;
-exports.ER_TABLE_CORRUPT = 1877;
-exports.ER_TEMP_FILE_WRITE_FAILURE = 1878;
-exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879;
-exports.ER_OLD_TEMPORALS_UPGRADED = 1880;
-exports.ER_INNODB_FORCED_RECOVERY = 1881;
-exports.ER_AES_INVALID_IV = 1882;
-exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883;
-exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP = 1884;
-exports.ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER = 1885;
-exports.ER_MISSING_KEY = 1886;
-exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887;
-exports.ER_FOUND_MISSING_GTIDS = 1888;
-exports.ER_FILE_CORRUPT = 3000;
-exports.ER_ERROR_ON_MASTER = 3001;
-exports.ER_INCONSISTENT_ERROR = 3002;
-exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003;
-exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004;
-exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005;
-exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006;
-exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007;
-exports.ER_FK_DEPTH_EXCEEDED = 3008;
-exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009;
-exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010;
-exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011;
-exports.ER_EXPLAIN_NOT_SUPPORTED = 3012;
-exports.ER_INVALID_FIELD_SIZE = 3013;
-exports.ER_MISSING_HA_CREATE_OPTION = 3014;
-exports.ER_ENGINE_OUT_OF_MEMORY = 3015;
-exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016;
-exports.ER_SLAVE_SQL_THREAD_MUST_STOP = 3017;
-exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018;
-exports.ER_INNODB_UNDO_LOG_FULL = 3019;
-exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020;
-exports.ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP = 3021;
-exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022;
-exports.ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS = 3023;
-exports.ER_QUERY_TIMEOUT = 3024;
-exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025;
-exports.ER_DUP_LIST_ENTRY = 3026;
-exports.ER_SQL_MODE_NO_EFFECT = 3027;
-exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028;
-exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029;
-exports.ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030;
-exports.ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER = 3031;
-exports.ER_SERVER_OFFLINE_MODE = 3032;
-exports.ER_GIS_DIFFERENT_SRIDS = 3033;
-exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034;
-exports.ER_GIS_UNKNOWN_ERROR = 3035;
-exports.ER_GIS_UNKNOWN_EXCEPTION = 3036;
-exports.ER_GIS_INVALID_DATA = 3037;
-exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038;
-exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039;
-exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040;
-exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041;
-exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042;
-exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043;
-exports.ER_STD_BAD_ALLOC_ERROR = 3044;
-exports.ER_STD_DOMAIN_ERROR = 3045;
-exports.ER_STD_LENGTH_ERROR = 3046;
-exports.ER_STD_INVALID_ARGUMENT = 3047;
-exports.ER_STD_OUT_OF_RANGE_ERROR = 3048;
-exports.ER_STD_OVERFLOW_ERROR = 3049;
-exports.ER_STD_RANGE_ERROR = 3050;
-exports.ER_STD_UNDERFLOW_ERROR = 3051;
-exports.ER_STD_LOGIC_ERROR = 3052;
-exports.ER_STD_RUNTIME_ERROR = 3053;
-exports.ER_STD_UNKNOWN_EXCEPTION = 3054;
-exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055;
-exports.ER_CHANGE_MASTER_PASSWORD_LENGTH = 3056;
-exports.ER_USER_LOCK_WRONG_NAME = 3057;
-exports.ER_USER_LOCK_DEADLOCK = 3058;
-exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059;
-exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060;
-exports.ER_ILLEGAL_USER_VAR = 3061;
-exports.ER_GTID_MODE_OFF = 3062;
-exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063;
-exports.ER_INCORRECT_TYPE = 3064;
-exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065;
-exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066;
-exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067;
-exports.ER_NET_OK_PACKET_TOO_LARGE = 3068;
-exports.ER_INVALID_JSON_DATA = 3069;
-exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070;
-exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071;
-exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072;
-exports.ER_DIMENSION_UNSUPPORTED = 3073;
-exports.ER_SLAVE_CHANNEL_DOES_NOT_EXIST = 3074;
-exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075;
-exports.ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076;
-exports.ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY = 3077;
-exports.ER_SLAVE_CHANNEL_DELETE = 3078;
-exports.ER_SLAVE_MULTIPLE_CHANNELS_CMD = 3079;
-exports.ER_SLAVE_MAX_CHANNELS_EXCEEDED = 3080;
-exports.ER_SLAVE_CHANNEL_MUST_STOP = 3081;
-exports.ER_SLAVE_CHANNEL_NOT_RUNNING = 3082;
-exports.ER_SLAVE_CHANNEL_WAS_RUNNING = 3083;
-exports.ER_SLAVE_CHANNEL_WAS_NOT_RUNNING = 3084;
-exports.ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP = 3085;
-exports.ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER = 3086;
-exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087;
-exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088;
-exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089;
-exports.ER_WARN_DEPRECATED_SQLMODE = 3090;
-exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091;
-exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092;
-exports.ER_GROUP_REPLICATION_RUNNING = 3093;
-exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094;
-exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095;
-exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096;
-exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097;
-exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098;
-exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099;
-exports.ER_RUN_HOOK_ERROR = 3100;
-exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101;
-exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102;
-exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103;
-exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104;
-exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105;
-exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106;
-exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107;
-exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108;
-exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109;
-exports.ER_FEATURE_NOT_AVAILABLE = 3110;
-exports.ER_CANT_SET_GTID_MODE = 3111;
-exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112;
-exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113;
-exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114;
-exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115;
-exports.ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3116;
-exports.ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3117;
-exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118;
-exports.ER_WRONG_TABLESPACE_NAME = 3119;
-exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120;
-exports.ER_WRONG_FILE_NAME = 3121;
-exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122;
-exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123;
-exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124;
-exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125;
-exports.ER_WARN_CONFLICTING_HINT = 3126;
-exports.ER_WARN_UNKNOWN_QB_NAME = 3127;
-exports.ER_UNRESOLVED_HINT_NAME = 3128;
-exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129;
-exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130;
-exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131;
-exports.ER_LOCKING_SERVICE_DEADLOCK = 3132;
-exports.ER_LOCKING_SERVICE_TIMEOUT = 3133;
-exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134;
-exports.ER_SQL_MODE_MERGED = 3135;
-exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136;
-exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137;
-exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138;
-exports.ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED = 3139;
-exports.ER_INVALID_JSON_TEXT = 3140;
-exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141;
-exports.ER_INVALID_JSON_BINARY_DATA = 3142;
-exports.ER_INVALID_JSON_PATH = 3143;
-exports.ER_INVALID_JSON_CHARSET = 3144;
-exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145;
-exports.ER_INVALID_TYPE_FOR_JSON = 3146;
-exports.ER_INVALID_CAST_TO_JSON = 3147;
-exports.ER_INVALID_JSON_PATH_CHARSET = 3148;
-exports.ER_INVALID_JSON_PATH_WILDCARD = 3149;
-exports.ER_JSON_VALUE_TOO_BIG = 3150;
-exports.ER_JSON_KEY_TOO_BIG = 3151;
-exports.ER_JSON_USED_AS_KEY = 3152;
-exports.ER_JSON_VACUOUS_PATH = 3153;
-exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154;
-exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155;
-exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156;
-exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157;
-exports.ER_JSON_DOCUMENT_NULL_KEY = 3158;
-exports.ER_SECURE_TRANSPORT_REQUIRED = 3159;
-exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160;
-exports.ER_DISABLED_STORAGE_ENGINE = 3161;
-exports.ER_USER_DOES_NOT_EXIST = 3162;
-exports.ER_USER_ALREADY_EXISTS = 3163;
-exports.ER_AUDIT_API_ABORT = 3164;
-exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165;
-exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166;
-exports.ER_FEATURE_DISABLED_SEE_DOC = 3167;
-exports.ER_SERVER_ISNT_AVAILABLE = 3168;
-exports.ER_SESSION_WAS_KILLED = 3169;
-exports.ER_CAPACITY_EXCEEDED = 3170;
-exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171;
-exports.ER_TABLE_NEEDS_UPG_PART = 3172;
-exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173;
-exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174;
-exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175;
-exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176;
-exports.ER_LOCK_REFUSED_BY_ENGINE = 3177;
-exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178;
-exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179;
-exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180;
-exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181;
-exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182;
-exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183;
-exports.ER_INVALID_ENCRYPTION_OPTION = 3184;
-exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185;
-exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186;
-exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187;
-exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188;
-exports.ER_USER_COLUMN_OLD_LENGTH = 3189;
-exports.ER_CANT_RESET_MASTER = 3190;
-exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191;
-exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192;
-exports.ER_TABLE_REFERENCED = 3193;
-exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194;
-exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195;
-exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196;
-exports.ER_XA_RETRY = 3197;
-exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198;
-exports.ER_BINLOG_UNSAFE_XA = 3199;
-exports.ER_UDF_ERROR = 3200;
-exports.ER_KEYRING_MIGRATION_FAILURE = 3201;
-exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202;
-exports.ER_KEYRING_MIGRATION_STATUS = 3203;
-exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204;
-exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205;
-exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206;
-exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207;
-exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208;
-exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209;
-exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210;
-exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211;
-exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212;
-exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213;
-exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214;
-exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215;
-exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216;
-exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217;
-exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218;
-exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219;
-exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220;
-exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221;
-exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222;
-exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223;
-exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224;
-exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225;
-exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226;
-exports.ER_XA_REPLICATION_FILTERS = 3227;
-exports.ER_CANT_OPEN_ERROR_LOG = 3228;
-exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229;
-exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230;
-
-// Lookup-by-number table
-exports[1] = 'EE_CANTCREATEFILE';
-exports[2] = 'EE_READ';
-exports[3] = 'EE_WRITE';
-exports[4] = 'EE_BADCLOSE';
-exports[5] = 'EE_OUTOFMEMORY';
-exports[6] = 'EE_DELETE';
-exports[7] = 'EE_LINK';
-exports[9] = 'EE_EOFERR';
-exports[10] = 'EE_CANTLOCK';
-exports[11] = 'EE_CANTUNLOCK';
-exports[12] = 'EE_DIR';
-exports[13] = 'EE_STAT';
-exports[14] = 'EE_CANT_CHSIZE';
-exports[15] = 'EE_CANT_OPEN_STREAM';
-exports[16] = 'EE_GETWD';
-exports[17] = 'EE_SETWD';
-exports[18] = 'EE_LINK_WARNING';
-exports[19] = 'EE_OPEN_WARNING';
-exports[20] = 'EE_DISK_FULL';
-exports[21] = 'EE_CANT_MKDIR';
-exports[22] = 'EE_UNKNOWN_CHARSET';
-exports[23] = 'EE_OUT_OF_FILERESOURCES';
-exports[24] = 'EE_CANT_READLINK';
-exports[25] = 'EE_CANT_SYMLINK';
-exports[26] = 'EE_REALPATH';
-exports[27] = 'EE_SYNC';
-exports[28] = 'EE_UNKNOWN_COLLATION';
-exports[29] = 'EE_FILENOTFOUND';
-exports[30] = 'EE_FILE_NOT_CLOSED';
-exports[31] = 'EE_CHANGE_OWNERSHIP';
-exports[32] = 'EE_CHANGE_PERMISSIONS';
-exports[33] = 'EE_CANT_SEEK';
-exports[34] = 'EE_CAPACITY_EXCEEDED';
-exports[120] = 'HA_ERR_KEY_NOT_FOUND';
-exports[121] = 'HA_ERR_FOUND_DUPP_KEY';
-exports[122] = 'HA_ERR_INTERNAL_ERROR';
-exports[123] = 'HA_ERR_RECORD_CHANGED';
-exports[124] = 'HA_ERR_WRONG_INDEX';
-exports[126] = 'HA_ERR_CRASHED';
-exports[127] = 'HA_ERR_WRONG_IN_RECORD';
-exports[128] = 'HA_ERR_OUT_OF_MEM';
-exports[130] = 'HA_ERR_NOT_A_TABLE';
-exports[131] = 'HA_ERR_WRONG_COMMAND';
-exports[132] = 'HA_ERR_OLD_FILE';
-exports[133] = 'HA_ERR_NO_ACTIVE_RECORD';
-exports[134] = 'HA_ERR_RECORD_DELETED';
-exports[135] = 'HA_ERR_RECORD_FILE_FULL';
-exports[136] = 'HA_ERR_INDEX_FILE_FULL';
-exports[137] = 'HA_ERR_END_OF_FILE';
-exports[138] = 'HA_ERR_UNSUPPORTED';
-exports[139] = 'HA_ERR_TOO_BIG_ROW';
-exports[140] = 'HA_WRONG_CREATE_OPTION';
-exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE';
-exports[142] = 'HA_ERR_UNKNOWN_CHARSET';
-exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF';
-exports[144] = 'HA_ERR_CRASHED_ON_REPAIR';
-exports[145] = 'HA_ERR_CRASHED_ON_USAGE';
-exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT';
-exports[147] = 'HA_ERR_LOCK_TABLE_FULL';
-exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION';
-exports[149] = 'HA_ERR_LOCK_DEADLOCK';
-exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN';
-exports[151] = 'HA_ERR_NO_REFERENCED_ROW';
-exports[152] = 'HA_ERR_ROW_IS_REFERENCED';
-exports[153] = 'HA_ERR_NO_SAVEPOINT';
-exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE';
-exports[155] = 'HA_ERR_NO_SUCH_TABLE';
-exports[156] = 'HA_ERR_TABLE_EXIST';
-exports[157] = 'HA_ERR_NO_CONNECTION';
-exports[158] = 'HA_ERR_NULL_IN_SPATIAL';
-exports[159] = 'HA_ERR_TABLE_DEF_CHANGED';
-exports[160] = 'HA_ERR_NO_PARTITION_FOUND';
-exports[161] = 'HA_ERR_RBR_LOGGING_FAILED';
-exports[162] = 'HA_ERR_DROP_INDEX_FK';
-exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY';
-exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE';
-exports[165] = 'HA_ERR_TABLE_READONLY';
-exports[166] = 'HA_ERR_AUTOINC_READ_FAILED';
-exports[167] = 'HA_ERR_AUTOINC_ERANGE';
-exports[168] = 'HA_ERR_GENERIC';
-exports[169] = 'HA_ERR_RECORD_IS_THE_SAME';
-exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE';
-exports[171] = 'HA_ERR_CORRUPT_EVENT';
-exports[172] = 'HA_ERR_NEW_FILE';
-exports[173] = 'HA_ERR_ROWS_EVENT_APPLY';
-exports[174] = 'HA_ERR_INITIALIZATION';
-exports[175] = 'HA_ERR_FILE_TOO_SHORT';
-exports[176] = 'HA_ERR_WRONG_CRC';
-exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS';
-exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS';
-exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG';
-exports[180] = 'HA_ERR_INDEX_CORRUPT';
-exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG';
-exports[182] = 'HA_FTS_INVALID_DOCID';
-exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK';
-exports[184] = 'HA_ERR_TABLESPACE_EXISTS';
-exports[185] = 'HA_ERR_TOO_MANY_FIELDS';
-exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION';
-exports[187] = 'HA_ERR_INNODB_READ_ONLY';
-exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT';
-exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE';
-exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY';
-exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE';
-exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED';
-exports[193] = 'HA_MISSING_CREATE_OPTION';
-exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY';
-exports[195] = 'HA_ERR_TABLE_CORRUPT';
-exports[196] = 'HA_ERR_QUERY_INTERRUPTED';
-exports[197] = 'HA_ERR_TABLESPACE_MISSING';
-exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY';
-exports[199] = 'HA_ERR_WRONG_FILE_NAME';
-exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND';
-exports[201] = 'HA_ERR_COMPUTE_FAILED';
-exports[1000] = 'ER_HASHCHK';
-exports[1001] = 'ER_NISAMCHK';
-exports[1002] = 'ER_NO';
-exports[1003] = 'ER_YES';
-exports[1004] = 'ER_CANT_CREATE_FILE';
-exports[1005] = 'ER_CANT_CREATE_TABLE';
-exports[1006] = 'ER_CANT_CREATE_DB';
-exports[1007] = 'ER_DB_CREATE_EXISTS';
-exports[1008] = 'ER_DB_DROP_EXISTS';
-exports[1009] = 'ER_DB_DROP_DELETE';
-exports[1010] = 'ER_DB_DROP_RMDIR';
-exports[1011] = 'ER_CANT_DELETE_FILE';
-exports[1012] = 'ER_CANT_FIND_SYSTEM_REC';
-exports[1013] = 'ER_CANT_GET_STAT';
-exports[1014] = 'ER_CANT_GET_WD';
-exports[1015] = 'ER_CANT_LOCK';
-exports[1016] = 'ER_CANT_OPEN_FILE';
-exports[1017] = 'ER_FILE_NOT_FOUND';
-exports[1018] = 'ER_CANT_READ_DIR';
-exports[1019] = 'ER_CANT_SET_WD';
-exports[1020] = 'ER_CHECKREAD';
-exports[1021] = 'ER_DISK_FULL';
-exports[1022] = 'ER_DUP_KEY';
-exports[1023] = 'ER_ERROR_ON_CLOSE';
-exports[1024] = 'ER_ERROR_ON_READ';
-exports[1025] = 'ER_ERROR_ON_RENAME';
-exports[1026] = 'ER_ERROR_ON_WRITE';
-exports[1027] = 'ER_FILE_USED';
-exports[1028] = 'ER_FILSORT_ABORT';
-exports[1029] = 'ER_FORM_NOT_FOUND';
-exports[1030] = 'ER_GET_ERRNO';
-exports[1031] = 'ER_ILLEGAL_HA';
-exports[1032] = 'ER_KEY_NOT_FOUND';
-exports[1033] = 'ER_NOT_FORM_FILE';
-exports[1034] = 'ER_NOT_KEYFILE';
-exports[1035] = 'ER_OLD_KEYFILE';
-exports[1036] = 'ER_OPEN_AS_READONLY';
-exports[1037] = 'ER_OUTOFMEMORY';
-exports[1038] = 'ER_OUT_OF_SORTMEMORY';
-exports[1039] = 'ER_UNEXPECTED_EOF';
-exports[1040] = 'ER_CON_COUNT_ERROR';
-exports[1041] = 'ER_OUT_OF_RESOURCES';
-exports[1042] = 'ER_BAD_HOST_ERROR';
-exports[1043] = 'ER_HANDSHAKE_ERROR';
-exports[1044] = 'ER_DBACCESS_DENIED_ERROR';
-exports[1045] = 'ER_ACCESS_DENIED_ERROR';
-exports[1046] = 'ER_NO_DB_ERROR';
-exports[1047] = 'ER_UNKNOWN_COM_ERROR';
-exports[1048] = 'ER_BAD_NULL_ERROR';
-exports[1049] = 'ER_BAD_DB_ERROR';
-exports[1050] = 'ER_TABLE_EXISTS_ERROR';
-exports[1051] = 'ER_BAD_TABLE_ERROR';
-exports[1052] = 'ER_NON_UNIQ_ERROR';
-exports[1053] = 'ER_SERVER_SHUTDOWN';
-exports[1054] = 'ER_BAD_FIELD_ERROR';
-exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP';
-exports[1056] = 'ER_WRONG_GROUP_FIELD';
-exports[1057] = 'ER_WRONG_SUM_SELECT';
-exports[1058] = 'ER_WRONG_VALUE_COUNT';
-exports[1059] = 'ER_TOO_LONG_IDENT';
-exports[1060] = 'ER_DUP_FIELDNAME';
-exports[1061] = 'ER_DUP_KEYNAME';
-exports[1062] = 'ER_DUP_ENTRY';
-exports[1063] = 'ER_WRONG_FIELD_SPEC';
-exports[1064] = 'ER_PARSE_ERROR';
-exports[1065] = 'ER_EMPTY_QUERY';
-exports[1066] = 'ER_NONUNIQ_TABLE';
-exports[1067] = 'ER_INVALID_DEFAULT';
-exports[1068] = 'ER_MULTIPLE_PRI_KEY';
-exports[1069] = 'ER_TOO_MANY_KEYS';
-exports[1070] = 'ER_TOO_MANY_KEY_PARTS';
-exports[1071] = 'ER_TOO_LONG_KEY';
-exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS';
-exports[1073] = 'ER_BLOB_USED_AS_KEY';
-exports[1074] = 'ER_TOO_BIG_FIELDLENGTH';
-exports[1075] = 'ER_WRONG_AUTO_KEY';
-exports[1076] = 'ER_READY';
-exports[1077] = 'ER_NORMAL_SHUTDOWN';
-exports[1078] = 'ER_GOT_SIGNAL';
-exports[1079] = 'ER_SHUTDOWN_COMPLETE';
-exports[1080] = 'ER_FORCING_CLOSE';
-exports[1081] = 'ER_IPSOCK_ERROR';
-exports[1082] = 'ER_NO_SUCH_INDEX';
-exports[1083] = 'ER_WRONG_FIELD_TERMINATORS';
-exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED';
-exports[1085] = 'ER_TEXTFILE_NOT_READABLE';
-exports[1086] = 'ER_FILE_EXISTS_ERROR';
-exports[1087] = 'ER_LOAD_INFO';
-exports[1088] = 'ER_ALTER_INFO';
-exports[1089] = 'ER_WRONG_SUB_KEY';
-exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS';
-exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY';
-exports[1092] = 'ER_INSERT_INFO';
-exports[1093] = 'ER_UPDATE_TABLE_USED';
-exports[1094] = 'ER_NO_SUCH_THREAD';
-exports[1095] = 'ER_KILL_DENIED_ERROR';
-exports[1096] = 'ER_NO_TABLES_USED';
-exports[1097] = 'ER_TOO_BIG_SET';
-exports[1098] = 'ER_NO_UNIQUE_LOGFILE';
-exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE';
-exports[1100] = 'ER_TABLE_NOT_LOCKED';
-exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT';
-exports[1102] = 'ER_WRONG_DB_NAME';
-exports[1103] = 'ER_WRONG_TABLE_NAME';
-exports[1104] = 'ER_TOO_BIG_SELECT';
-exports[1105] = 'ER_UNKNOWN_ERROR';
-exports[1106] = 'ER_UNKNOWN_PROCEDURE';
-exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE';
-exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE';
-exports[1109] = 'ER_UNKNOWN_TABLE';
-exports[1110] = 'ER_FIELD_SPECIFIED_TWICE';
-exports[1111] = 'ER_INVALID_GROUP_FUNC_USE';
-exports[1112] = 'ER_UNSUPPORTED_EXTENSION';
-exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS';
-exports[1114] = 'ER_RECORD_FILE_FULL';
-exports[1115] = 'ER_UNKNOWN_CHARACTER_SET';
-exports[1116] = 'ER_TOO_MANY_TABLES';
-exports[1117] = 'ER_TOO_MANY_FIELDS';
-exports[1118] = 'ER_TOO_BIG_ROWSIZE';
-exports[1119] = 'ER_STACK_OVERRUN';
-exports[1120] = 'ER_WRONG_OUTER_JOIN';
-exports[1121] = 'ER_NULL_COLUMN_IN_INDEX';
-exports[1122] = 'ER_CANT_FIND_UDF';
-exports[1123] = 'ER_CANT_INITIALIZE_UDF';
-exports[1124] = 'ER_UDF_NO_PATHS';
-exports[1125] = 'ER_UDF_EXISTS';
-exports[1126] = 'ER_CANT_OPEN_LIBRARY';
-exports[1127] = 'ER_CANT_FIND_DL_ENTRY';
-exports[1128] = 'ER_FUNCTION_NOT_DEFINED';
-exports[1129] = 'ER_HOST_IS_BLOCKED';
-exports[1130] = 'ER_HOST_NOT_PRIVILEGED';
-exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER';
-exports[1132] = 'ER_PASSWORD_NOT_ALLOWED';
-exports[1133] = 'ER_PASSWORD_NO_MATCH';
-exports[1134] = 'ER_UPDATE_INFO';
-exports[1135] = 'ER_CANT_CREATE_THREAD';
-exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW';
-exports[1137] = 'ER_CANT_REOPEN_TABLE';
-exports[1138] = 'ER_INVALID_USE_OF_NULL';
-exports[1139] = 'ER_REGEXP_ERROR';
-exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS';
-exports[1141] = 'ER_NONEXISTING_GRANT';
-exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR';
-exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR';
-exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE';
-exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER';
-exports[1146] = 'ER_NO_SUCH_TABLE';
-exports[1147] = 'ER_NONEXISTING_TABLE_GRANT';
-exports[1148] = 'ER_NOT_ALLOWED_COMMAND';
-exports[1149] = 'ER_SYNTAX_ERROR';
-exports[1150] = 'ER_DELAYED_CANT_CHANGE_LOCK';
-exports[1151] = 'ER_TOO_MANY_DELAYED_THREADS';
-exports[1152] = 'ER_ABORTING_CONNECTION';
-exports[1153] = 'ER_NET_PACKET_TOO_LARGE';
-exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE';
-exports[1155] = 'ER_NET_FCNTL_ERROR';
-exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER';
-exports[1157] = 'ER_NET_UNCOMPRESS_ERROR';
-exports[1158] = 'ER_NET_READ_ERROR';
-exports[1159] = 'ER_NET_READ_INTERRUPTED';
-exports[1160] = 'ER_NET_ERROR_ON_WRITE';
-exports[1161] = 'ER_NET_WRITE_INTERRUPTED';
-exports[1162] = 'ER_TOO_LONG_STRING';
-exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB';
-exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT';
-exports[1165] = 'ER_DELAYED_INSERT_TABLE_LOCKED';
-exports[1166] = 'ER_WRONG_COLUMN_NAME';
-exports[1167] = 'ER_WRONG_KEY_COLUMN';
-exports[1168] = 'ER_WRONG_MRG_TABLE';
-exports[1169] = 'ER_DUP_UNIQUE';
-exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH';
-exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL';
-exports[1172] = 'ER_TOO_MANY_ROWS';
-exports[1173] = 'ER_REQUIRES_PRIMARY_KEY';
-exports[1174] = 'ER_NO_RAID_COMPILED';
-exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE';
-exports[1176] = 'ER_KEY_DOES_NOT_EXITS';
-exports[1177] = 'ER_CHECK_NO_SUCH_TABLE';
-exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED';
-exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION';
-exports[1180] = 'ER_ERROR_DURING_COMMIT';
-exports[1181] = 'ER_ERROR_DURING_ROLLBACK';
-exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS';
-exports[1183] = 'ER_ERROR_DURING_CHECKPOINT';
-exports[1184] = 'ER_NEW_ABORTING_CONNECTION';
-exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED';
-exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED';
-exports[1187] = 'ER_INDEX_REBUILD';
-exports[1188] = 'ER_MASTER';
-exports[1189] = 'ER_MASTER_NET_READ';
-exports[1190] = 'ER_MASTER_NET_WRITE';
-exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND';
-exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION';
-exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE';
-exports[1194] = 'ER_CRASHED_ON_USAGE';
-exports[1195] = 'ER_CRASHED_ON_REPAIR';
-exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK';
-exports[1197] = 'ER_TRANS_CACHE_FULL';
-exports[1198] = 'ER_SLAVE_MUST_STOP';
-exports[1199] = 'ER_SLAVE_NOT_RUNNING';
-exports[1200] = 'ER_BAD_SLAVE';
-exports[1201] = 'ER_MASTER_INFO';
-exports[1202] = 'ER_SLAVE_THREAD';
-exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS';
-exports[1204] = 'ER_SET_CONSTANTS_ONLY';
-exports[1205] = 'ER_LOCK_WAIT_TIMEOUT';
-exports[1206] = 'ER_LOCK_TABLE_FULL';
-exports[1207] = 'ER_READ_ONLY_TRANSACTION';
-exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK';
-exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK';
-exports[1210] = 'ER_WRONG_ARGUMENTS';
-exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER';
-exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR';
-exports[1213] = 'ER_LOCK_DEADLOCK';
-exports[1214] = 'ER_TABLE_CANT_HANDLE_FT';
-exports[1215] = 'ER_CANNOT_ADD_FOREIGN';
-exports[1216] = 'ER_NO_REFERENCED_ROW';
-exports[1217] = 'ER_ROW_IS_REFERENCED';
-exports[1218] = 'ER_CONNECT_TO_MASTER';
-exports[1219] = 'ER_QUERY_ON_MASTER';
-exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND';
-exports[1221] = 'ER_WRONG_USAGE';
-exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT';
-exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK';
-exports[1224] = 'ER_MIXING_NOT_ALLOWED';
-exports[1225] = 'ER_DUP_ARGUMENT';
-exports[1226] = 'ER_USER_LIMIT_REACHED';
-exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR';
-exports[1228] = 'ER_LOCAL_VARIABLE';
-exports[1229] = 'ER_GLOBAL_VARIABLE';
-exports[1230] = 'ER_NO_DEFAULT';
-exports[1231] = 'ER_WRONG_VALUE_FOR_VAR';
-exports[1232] = 'ER_WRONG_TYPE_FOR_VAR';
-exports[1233] = 'ER_VAR_CANT_BE_READ';
-exports[1234] = 'ER_CANT_USE_OPTION_HERE';
-exports[1235] = 'ER_NOT_SUPPORTED_YET';
-exports[1236] = 'ER_MASTER_FATAL_ERROR_READING_BINLOG';
-exports[1237] = 'ER_SLAVE_IGNORED_TABLE';
-exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR';
-exports[1239] = 'ER_WRONG_FK_DEF';
-exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF';
-exports[1241] = 'ER_OPERAND_COLUMNS';
-exports[1242] = 'ER_SUBQUERY_NO_1_ROW';
-exports[1243] = 'ER_UNKNOWN_STMT_HANDLER';
-exports[1244] = 'ER_CORRUPT_HELP_DB';
-exports[1245] = 'ER_CYCLIC_REFERENCE';
-exports[1246] = 'ER_AUTO_CONVERT';
-exports[1247] = 'ER_ILLEGAL_REFERENCE';
-exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS';
-exports[1249] = 'ER_SELECT_REDUCED';
-exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE';
-exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE';
-exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL';
-exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH';
-exports[1254] = 'ER_SLAVE_WAS_RUNNING';
-exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING';
-exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS';
-exports[1257] = 'ER_ZLIB_Z_MEM_ERROR';
-exports[1258] = 'ER_ZLIB_Z_BUF_ERROR';
-exports[1259] = 'ER_ZLIB_Z_DATA_ERROR';
-exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT';
-exports[1261] = 'ER_WARN_TOO_FEW_RECORDS';
-exports[1262] = 'ER_WARN_TOO_MANY_RECORDS';
-exports[1263] = 'ER_WARN_NULL_TO_NOTNULL';
-exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE';
-exports[1265] = 'WARN_DATA_TRUNCATED';
-exports[1266] = 'ER_WARN_USING_OTHER_HANDLER';
-exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS';
-exports[1268] = 'ER_DROP_USER';
-exports[1269] = 'ER_REVOKE_GRANTS';
-exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS';
-exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS';
-exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT';
-exports[1273] = 'ER_UNKNOWN_COLLATION';
-exports[1274] = 'ER_SLAVE_IGNORED_SSL_PARAMS';
-exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE';
-exports[1276] = 'ER_WARN_FIELD_RESOLVED';
-exports[1277] = 'ER_BAD_SLAVE_UNTIL_COND';
-exports[1278] = 'ER_MISSING_SKIP_SLAVE';
-exports[1279] = 'ER_UNTIL_COND_IGNORED';
-exports[1280] = 'ER_WRONG_NAME_FOR_INDEX';
-exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG';
-exports[1282] = 'ER_WARN_QC_RESIZE';
-exports[1283] = 'ER_BAD_FT_COLUMN';
-exports[1284] = 'ER_UNKNOWN_KEY_CACHE';
-exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK';
-exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE';
-exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX';
-exports[1288] = 'ER_NON_UPDATABLE_TABLE';
-exports[1289] = 'ER_FEATURE_DISABLED';
-exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT';
-exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE';
-exports[1292] = 'ER_TRUNCATED_WRONG_VALUE';
-exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS';
-exports[1294] = 'ER_INVALID_ON_UPDATE';
-exports[1295] = 'ER_UNSUPPORTED_PS';
-exports[1296] = 'ER_GET_ERRMSG';
-exports[1297] = 'ER_GET_TEMPORARY_ERRMSG';
-exports[1298] = 'ER_UNKNOWN_TIME_ZONE';
-exports[1299] = 'ER_WARN_INVALID_TIMESTAMP';
-exports[1300] = 'ER_INVALID_CHARACTER_STRING';
-exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED';
-exports[1302] = 'ER_CONFLICTING_DECLARATIONS';
-exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE';
-exports[1304] = 'ER_SP_ALREADY_EXISTS';
-exports[1305] = 'ER_SP_DOES_NOT_EXIST';
-exports[1306] = 'ER_SP_DROP_FAILED';
-exports[1307] = 'ER_SP_STORE_FAILED';
-exports[1308] = 'ER_SP_LILABEL_MISMATCH';
-exports[1309] = 'ER_SP_LABEL_REDEFINE';
-exports[1310] = 'ER_SP_LABEL_MISMATCH';
-exports[1311] = 'ER_SP_UNINIT_VAR';
-exports[1312] = 'ER_SP_BADSELECT';
-exports[1313] = 'ER_SP_BADRETURN';
-exports[1314] = 'ER_SP_BADSTATEMENT';
-exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED';
-exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED';
-exports[1317] = 'ER_QUERY_INTERRUPTED';
-exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS';
-exports[1319] = 'ER_SP_COND_MISMATCH';
-exports[1320] = 'ER_SP_NORETURN';
-exports[1321] = 'ER_SP_NORETURNEND';
-exports[1322] = 'ER_SP_BAD_CURSOR_QUERY';
-exports[1323] = 'ER_SP_BAD_CURSOR_SELECT';
-exports[1324] = 'ER_SP_CURSOR_MISMATCH';
-exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN';
-exports[1326] = 'ER_SP_CURSOR_NOT_OPEN';
-exports[1327] = 'ER_SP_UNDECLARED_VAR';
-exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS';
-exports[1329] = 'ER_SP_FETCH_NO_DATA';
-exports[1330] = 'ER_SP_DUP_PARAM';
-exports[1331] = 'ER_SP_DUP_VAR';
-exports[1332] = 'ER_SP_DUP_COND';
-exports[1333] = 'ER_SP_DUP_CURS';
-exports[1334] = 'ER_SP_CANT_ALTER';
-exports[1335] = 'ER_SP_SUBSELECT_NYI';
-exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG';
-exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR';
-exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER';
-exports[1339] = 'ER_SP_CASE_NOT_FOUND';
-exports[1340] = 'ER_FPARSER_TOO_BIG_FILE';
-exports[1341] = 'ER_FPARSER_BAD_HEADER';
-exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT';
-exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER';
-exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER';
-exports[1345] = 'ER_VIEW_NO_EXPLAIN';
-exports[1346] = 'ER_FRM_UNKNOWN_TYPE';
-exports[1347] = 'ER_WRONG_OBJECT';
-exports[1348] = 'ER_NONUPDATEABLE_COLUMN';
-exports[1349] = 'ER_VIEW_SELECT_DERIVED';
-exports[1350] = 'ER_VIEW_SELECT_CLAUSE';
-exports[1351] = 'ER_VIEW_SELECT_VARIABLE';
-exports[1352] = 'ER_VIEW_SELECT_TMPTABLE';
-exports[1353] = 'ER_VIEW_WRONG_LIST';
-exports[1354] = 'ER_WARN_VIEW_MERGE';
-exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY';
-exports[1356] = 'ER_VIEW_INVALID';
-exports[1357] = 'ER_SP_NO_DROP_SP';
-exports[1358] = 'ER_SP_GOTO_IN_HNDLR';
-exports[1359] = 'ER_TRG_ALREADY_EXISTS';
-exports[1360] = 'ER_TRG_DOES_NOT_EXIST';
-exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE';
-exports[1362] = 'ER_TRG_CANT_CHANGE_ROW';
-exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG';
-exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD';
-exports[1365] = 'ER_DIVISION_BY_ZERO';
-exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD';
-exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE';
-exports[1368] = 'ER_VIEW_NONUPD_CHECK';
-exports[1369] = 'ER_VIEW_CHECK_FAILED';
-exports[1370] = 'ER_PROCACCESS_DENIED_ERROR';
-exports[1371] = 'ER_RELAY_LOG_FAIL';
-exports[1372] = 'ER_PASSWD_LENGTH';
-exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG';
-exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ';
-exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED';
-exports[1376] = 'ER_FSEEK_FAIL';
-exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR';
-exports[1378] = 'ER_LOG_IN_USE';
-exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR';
-exports[1380] = 'ER_RELAY_LOG_INIT';
-exports[1381] = 'ER_NO_BINARY_LOGGING';
-exports[1382] = 'ER_RESERVED_SYNTAX';
-exports[1383] = 'ER_WSAS_FAILED';
-exports[1384] = 'ER_DIFF_GROUPS_PROC';
-exports[1385] = 'ER_NO_GROUP_FOR_PROC';
-exports[1386] = 'ER_ORDER_WITH_PROC';
-exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF';
-exports[1388] = 'ER_NO_FILE_MAPPING';
-exports[1389] = 'ER_WRONG_MAGIC';
-exports[1390] = 'ER_PS_MANY_PARAM';
-exports[1391] = 'ER_KEY_PART_0';
-exports[1392] = 'ER_VIEW_CHECKSUM';
-exports[1393] = 'ER_VIEW_MULTIUPDATE';
-exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST';
-exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW';
-exports[1396] = 'ER_CANNOT_USER';
-exports[1397] = 'ER_XAER_NOTA';
-exports[1398] = 'ER_XAER_INVAL';
-exports[1399] = 'ER_XAER_RMFAIL';
-exports[1400] = 'ER_XAER_OUTSIDE';
-exports[1401] = 'ER_XAER_RMERR';
-exports[1402] = 'ER_XA_RBROLLBACK';
-exports[1403] = 'ER_NONEXISTING_PROC_GRANT';
-exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL';
-exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL';
-exports[1406] = 'ER_DATA_TOO_LONG';
-exports[1407] = 'ER_SP_BAD_SQLSTATE';
-exports[1408] = 'ER_STARTUP';
-exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR';
-exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT';
-exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE';
-exports[1412] = 'ER_TABLE_DEF_CHANGED';
-exports[1413] = 'ER_SP_DUP_HANDLER';
-exports[1414] = 'ER_SP_NOT_VAR_ARG';
-exports[1415] = 'ER_SP_NO_RETSET';
-exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT';
-exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG';
-exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE';
-exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER';
-exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR';
-exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR';
-exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG';
-exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD';
-exports[1424] = 'ER_SP_NO_RECURSION';
-exports[1425] = 'ER_TOO_BIG_SCALE';
-exports[1426] = 'ER_TOO_BIG_PRECISION';
-exports[1427] = 'ER_M_BIGGER_THAN_D';
-exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE';
-exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE';
-exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE';
-exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST';
-exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE';
-exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID';
-exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE';
-exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA';
-exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE';
-exports[1437] = 'ER_TOO_LONG_BODY';
-exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE';
-exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH';
-exports[1440] = 'ER_XAER_DUPID';
-exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW';
-exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG';
-exports[1443] = 'ER_VIEW_PREVENT_UPDATE';
-exports[1444] = 'ER_PS_NO_RECURSION';
-exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT';
-exports[1446] = 'ER_MALFORMED_DEFINER';
-exports[1447] = 'ER_VIEW_FRM_NO_USER';
-exports[1448] = 'ER_VIEW_OTHER_USER';
-exports[1449] = 'ER_NO_SUCH_USER';
-exports[1450] = 'ER_FORBID_SCHEMA_CHANGE';
-exports[1451] = 'ER_ROW_IS_REFERENCED_2';
-exports[1452] = 'ER_NO_REFERENCED_ROW_2';
-exports[1453] = 'ER_SP_BAD_VAR_SHADOW';
-exports[1454] = 'ER_TRG_NO_DEFINER';
-exports[1455] = 'ER_OLD_FILE_FORMAT';
-exports[1456] = 'ER_SP_RECURSION_LIMIT';
-exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT';
-exports[1458] = 'ER_SP_WRONG_NAME';
-exports[1459] = 'ER_TABLE_NEEDS_UPGRADE';
-exports[1460] = 'ER_SP_NO_AGGREGATE';
-exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED';
-exports[1462] = 'ER_VIEW_RECURSIVE';
-exports[1463] = 'ER_NON_GROUPING_FIELD_USED';
-exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS';
-exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA';
-exports[1466] = 'ER_REMOVED_SPACES';
-exports[1467] = 'ER_AUTOINC_READ_FAILED';
-exports[1468] = 'ER_USERNAME';
-exports[1469] = 'ER_HOSTNAME';
-exports[1470] = 'ER_WRONG_STRING_LENGTH';
-exports[1471] = 'ER_NON_INSERTABLE_TABLE';
-exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE';
-exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT';
-exports[1474] = 'ER_NAME_BECOMES_EMPTY';
-exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM';
-exports[1476] = 'ER_FOREIGN_SERVER_EXISTS';
-exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST';
-exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION';
-exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR';
-exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR';
-exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR';
-exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR';
-exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR';
-exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR';
-exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR';
-exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR';
-exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR';
-exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR';
-exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR';
-exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR';
-exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR';
-exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR';
-exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR';
-exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR';
-exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR';
-exports[1496] = 'ER_PARTITION_ENTRY_ERROR';
-exports[1497] = 'ER_MIX_HANDLER_ERROR';
-exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR';
-exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR';
-exports[1500] = 'ER_SUBPARTITION_ERROR';
-exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE';
-exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR';
-exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF';
-exports[1504] = 'ER_NO_PARTS_ERROR';
-exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED';
-exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED';
-exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT';
-exports[1508] = 'ER_DROP_LAST_PARTITION';
-exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION';
-exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO';
-exports[1511] = 'ER_REORG_NO_PARAM_ERROR';
-exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION';
-exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR';
-exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION';
-exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION';
-exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST';
-exports[1517] = 'ER_SAME_NAME_PARTITION';
-exports[1518] = 'ER_NO_BINLOG_ERROR';
-exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS';
-exports[1520] = 'ER_REORG_OUTSIDE_RANGE';
-exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE';
-exports[1522] = 'ER_PART_STATE_ERROR';
-exports[1523] = 'ER_LIMITED_PART_RANGE';
-exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED';
-exports[1525] = 'ER_WRONG_VALUE';
-exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE';
-exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE';
-exports[1528] = 'ER_CREATE_FILEGROUP_FAILED';
-exports[1529] = 'ER_DROP_FILEGROUP_FAILED';
-exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR';
-exports[1531] = 'ER_WRONG_SIZE_NUMBER';
-exports[1532] = 'ER_SIZE_OVERFLOW_ERROR';
-exports[1533] = 'ER_ALTER_FILEGROUP_FAILED';
-exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED';
-exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF';
-exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR';
-exports[1537] = 'ER_EVENT_ALREADY_EXISTS';
-exports[1538] = 'ER_EVENT_STORE_FAILED';
-exports[1539] = 'ER_EVENT_DOES_NOT_EXIST';
-exports[1540] = 'ER_EVENT_CANT_ALTER';
-exports[1541] = 'ER_EVENT_DROP_FAILED';
-exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG';
-exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS';
-exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST';
-exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED';
-exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT';
-exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED';
-exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE';
-exports[1549] = 'ER_EVENT_CANNOT_DELETE';
-exports[1550] = 'ER_EVENT_COMPILE_ERROR';
-exports[1551] = 'ER_EVENT_SAME_NAME';
-exports[1552] = 'ER_EVENT_DATA_TOO_LONG';
-exports[1553] = 'ER_DROP_INDEX_FK';
-exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER';
-exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE';
-exports[1556] = 'ER_CANT_LOCK_LOG_TABLE';
-exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY';
-exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE';
-exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR';
-exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT';
-exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT';
-exports[1562] = 'ER_PARTITION_NO_TEMPORARY';
-exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR';
-exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED';
-exports[1565] = 'ER_DDL_LOG_ERROR';
-exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN';
-exports[1567] = 'ER_WRONG_PARTITION_NAME';
-exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS';
-exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE';
-exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR';
-exports[1571] = 'ER_EVENT_SET_VAR_ERROR';
-exports[1572] = 'ER_PARTITION_MERGE_ERROR';
-exports[1573] = 'ER_CANT_ACTIVATE_LOG';
-exports[1574] = 'ER_RBR_NOT_AVAILABLE';
-exports[1575] = 'ER_BASE64_DECODE_ERROR';
-exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN';
-exports[1577] = 'ER_EVENTS_DB_ERROR';
-exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED';
-exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE';
-exports[1580] = 'ER_BAD_LOG_STATEMENT';
-exports[1581] = 'ER_CANT_RENAME_LOG_TABLE';
-exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT';
-exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT';
-exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT';
-exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION';
-exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME';
-exports[1587] = 'ER_BINLOG_PURGE_EMFILE';
-exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST';
-exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST';
-exports[1590] = 'ER_SLAVE_INCIDENT';
-exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT';
-exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT';
-exports[1593] = 'ER_SLAVE_FATAL_ERROR';
-exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE';
-exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE';
-exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE';
-exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE';
-exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE';
-exports[1599] = 'ER_VIEW_NO_CREATION_CTX';
-exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX';
-exports[1601] = 'ER_SR_INVALID_CREATION_CTX';
-exports[1602] = 'ER_TRG_CORRUPTED_FILE';
-exports[1603] = 'ER_TRG_NO_CREATION_CTX';
-exports[1604] = 'ER_TRG_INVALID_CREATION_CTX';
-exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX';
-exports[1606] = 'ER_TRG_CANT_OPEN_TABLE';
-exports[1607] = 'ER_CANT_CREATE_SROUTINE';
-exports[1608] = 'ER_NEVER_USED';
-exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT';
-exports[1610] = 'ER_SLAVE_CORRUPT_EVENT';
-exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN';
-exports[1612] = 'ER_LOG_PURGE_NO_FILE';
-exports[1613] = 'ER_XA_RBTIMEOUT';
-exports[1614] = 'ER_XA_RBDEADLOCK';
-exports[1615] = 'ER_NEED_REPREPARE';
-exports[1616] = 'ER_DELAYED_NOT_SUPPORTED';
-exports[1617] = 'WARN_NO_MASTER_INFO';
-exports[1618] = 'WARN_OPTION_IGNORED';
-exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN';
-exports[1620] = 'WARN_PLUGIN_BUSY';
-exports[1621] = 'ER_VARIABLE_IS_READONLY';
-exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK';
-exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE';
-exports[1624] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE';
-exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR';
-exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR';
-exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR';
-exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT';
-exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT';
-exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION';
-exports[1631] = 'ER_DATABASE_NAME';
-exports[1632] = 'ER_TABLE_NAME';
-exports[1633] = 'ER_PARTITION_NAME';
-exports[1634] = 'ER_SUBPARTITION_NAME';
-exports[1635] = 'ER_TEMPORARY_NAME';
-exports[1636] = 'ER_RENAMED_NAME';
-exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS';
-exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED';
-exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT';
-exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT';
-exports[1641] = 'ER_DUP_SIGNAL_SET';
-exports[1642] = 'ER_SIGNAL_WARN';
-exports[1643] = 'ER_SIGNAL_NOT_FOUND';
-exports[1644] = 'ER_SIGNAL_EXCEPTION';
-exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER';
-exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE';
-exports[1647] = 'WARN_COND_ITEM_TRUNCATED';
-exports[1648] = 'ER_COND_ITEM_TOO_LONG';
-exports[1649] = 'ER_UNKNOWN_LOCALE';
-exports[1650] = 'ER_SLAVE_IGNORE_SERVER_IDS';
-exports[1651] = 'ER_QUERY_CACHE_DISABLED';
-exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD';
-exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR';
-exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR';
-exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR';
-exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN';
-exports[1657] = 'ER_TOO_MANY_VALUES_ERROR';
-exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR';
-exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD';
-exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG';
-exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE';
-exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE';
-exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE';
-exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE';
-exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE';
-exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE';
-exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
-exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT';
-exports[1669] = 'ER_BINLOG_UNSAFE_INSERT_DELAYED';
-exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE';
-exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS';
-exports[1672] = 'ER_BINLOG_UNSAFE_UDF';
-exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE';
-exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION';
-exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS';
-exports[1676] = 'ER_MESSAGE_AND_STATEMENT';
-exports[1677] = 'ER_SLAVE_CONVERSION_FAILED';
-exports[1678] = 'ER_SLAVE_CANT_CREATE_CONVERSION';
-exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT';
-exports[1680] = 'ER_PATH_LENGTH';
-exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT';
-exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE';
-exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE';
-exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE';
-exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT';
-exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT';
-exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL';
-exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT';
-exports[1689] = 'ER_LOCK_ABORTED';
-exports[1690] = 'ER_DATA_OUT_OF_RANGE';
-exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT';
-exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
-exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT';
-exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN';
-exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN';
-exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE';
-exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR';
-exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR';
-exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN';
-exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS';
-exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK';
-exports[1702] = 'ER_PLUGIN_IS_PERMANENT';
-exports[1703] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN';
-exports[1704] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX';
-exports[1705] = 'ER_STMT_CACHE_FULL';
-exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT';
-exports[1707] = 'ER_TABLE_NEEDS_REBUILD';
-exports[1708] = 'WARN_OPTION_BELOW_LIMIT';
-exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG';
-exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY';
-exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY';
-exports[1712] = 'ER_INDEX_CORRUPT';
-exports[1713] = 'ER_UNDO_RECORD_TOO_BIG';
-exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT';
-exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE';
-exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT';
-exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT';
-exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT';
-exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE';
-exports[1720] = 'ER_PLUGIN_NO_UNINSTALL';
-exports[1721] = 'ER_PLUGIN_NO_INSTALL';
-exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT';
-exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC';
-exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS';
-exports[1725] = 'ER_TABLE_IN_FK_CHECK';
-exports[1726] = 'ER_UNSUPPORTED_ENGINE';
-exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST';
-exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2';
-exports[1729] = 'ER_MASTER_DELAY_VALUE_OUT_OF_RANGE';
-exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT';
-exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION';
-exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE';
-exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE';
-exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION';
-exports[1735] = 'ER_UNKNOWN_PARTITION';
-exports[1736] = 'ER_TABLES_DIFFERENT_METADATA';
-exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION';
-exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX';
-exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE';
-exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY';
-exports[1741] = 'ER_NO_SUCH_KEY_VALUE';
-exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG';
-exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE';
-exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE';
-exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX';
-exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT';
-exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED';
-exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET';
-exports[1749] = 'ER_NO_SUCH_PARTITION';
-exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE';
-exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE';
-exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE';
-exports[1753] = 'ER_MTS_FEATURE_IS_NOT_SUPPORTED';
-exports[1754] = 'ER_MTS_UPDATED_DBS_GREATER_MAX';
-exports[1755] = 'ER_MTS_CANT_PARALLEL';
-exports[1756] = 'ER_MTS_INCONSISTENT_DATA';
-exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING';
-exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER';
-exports[1759] = 'ER_INSECURE_PLAIN_TEXT';
-exports[1760] = 'ER_INSECURE_CHANGE_MASTER';
-exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO';
-exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO';
-exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_SLAVE';
-exports[1764] = 'ER_TABLE_HAS_NO_FT';
-exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER';
-exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION';
-exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST';
-exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION';
-exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION';
-exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL';
-exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION';
-exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION';
-exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING';
-exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION';
-exports[1775] = 'ER_GNO_EXHAUSTED';
-exports[1776] = 'ER_BAD_SLAVE_AUTO_POSITION';
-exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF';
-exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET';
-exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON';
-exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG';
-exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF';
-exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON';
-exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF';
-exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF';
-exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE';
-exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT';
-exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION';
-exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME';
-exports[1789] = 'ER_MASTER_HAS_PURGED_REQUIRED_GTIDS';
-exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID';
-exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT';
-exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION';
-exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT';
-exports[1794] = 'ER_SLAVE_CONFIGURATION';
-exports[1795] = 'ER_INNODB_FT_LIMIT';
-exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE';
-exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN';
-exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX';
-exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG';
-exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM';
-exports[1801] = 'ER_UNKNOWN_ALTER_LOCK';
-exports[1802] = 'ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS';
-exports[1803] = 'ER_MTS_RECOVERY_FAILURE';
-exports[1804] = 'ER_MTS_RESET_WORKERS';
-exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2';
-exports[1806] = 'ER_SLAVE_SILENT_RETRY_TRANSACTION';
-exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING';
-exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH';
-exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE';
-exports[1810] = 'ER_IO_READ_ERROR';
-exports[1811] = 'ER_IO_WRITE_ERROR';
-exports[1812] = 'ER_TABLESPACE_MISSING';
-exports[1813] = 'ER_TABLESPACE_EXISTS';
-exports[1814] = 'ER_TABLESPACE_DISCARDED';
-exports[1815] = 'ER_INTERNAL_ERROR';
-exports[1816] = 'ER_INNODB_IMPORT_ERROR';
-exports[1817] = 'ER_INNODB_INDEX_CORRUPT';
-exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH';
-exports[1819] = 'ER_NOT_VALID_PASSWORD';
-exports[1820] = 'ER_MUST_CHANGE_PASSWORD';
-exports[1821] = 'ER_FK_NO_INDEX_CHILD';
-exports[1822] = 'ER_FK_NO_INDEX_PARENT';
-exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM';
-exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT';
-exports[1825] = 'ER_FK_INCORRECT_OPTION';
-exports[1826] = 'ER_FK_DUP_NAME';
-exports[1827] = 'ER_PASSWORD_FORMAT';
-exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP';
-exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD';
-exports[1830] = 'ER_FK_COLUMN_NOT_NULL';
-exports[1831] = 'ER_DUP_INDEX';
-exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE';
-exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD';
-exports[1834] = 'ER_FK_CANNOT_DELETE_PARENT';
-exports[1835] = 'ER_MALFORMED_PACKET';
-exports[1836] = 'ER_READ_ONLY_MODE';
-exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GROUP';
-exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP';
-exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF';
-exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY';
-exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY';
-exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED';
-exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED';
-exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES';
-exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED';
-exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON';
-exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY';
-exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION';
-exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME';
-exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE';
-exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK';
-exports[1852] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE';
-exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK';
-exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC';
-exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS';
-exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS';
-exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS';
-exports[1858] = 'ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE';
-exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX';
-exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH';
-exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL';
-exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN';
-exports[1863] = 'ER_ROW_IN_WRONG_PARTITION';
-exports[1864] = 'ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX';
-exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER';
-exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION';
-exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE';
-exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE';
-exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT';
-exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR';
-exports[1871] = 'ER_SLAVE_MI_INIT_REPOSITORY';
-exports[1872] = 'ER_SLAVE_RLI_INIT_REPOSITORY';
-exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR';
-exports[1874] = 'ER_INNODB_READ_ONLY';
-exports[1875] = 'ER_STOP_SLAVE_SQL_THREAD_TIMEOUT';
-exports[1876] = 'ER_STOP_SLAVE_IO_THREAD_TIMEOUT';
-exports[1877] = 'ER_TABLE_CORRUPT';
-exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE';
-exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID';
-exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED';
-exports[1881] = 'ER_INNODB_FORCED_RECOVERY';
-exports[1882] = 'ER_AES_INVALID_IV';
-exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED';
-exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP';
-exports[1885] = 'ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER';
-exports[1886] = 'ER_MISSING_KEY';
-exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE';
-exports[1888] = 'ER_FOUND_MISSING_GTIDS';
-exports[3000] = 'ER_FILE_CORRUPT';
-exports[3001] = 'ER_ERROR_ON_MASTER';
-exports[3002] = 'ER_INCONSISTENT_ERROR';
-exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED';
-exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER';
-exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED';
-exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN';
-exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE';
-exports[3008] = 'ER_FK_DEPTH_EXCEEDED';
-exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2';
-exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED';
-exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST';
-exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED';
-exports[3013] = 'ER_INVALID_FIELD_SIZE';
-exports[3014] = 'ER_MISSING_HA_CREATE_OPTION';
-exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY';
-exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER';
-exports[3017] = 'ER_SLAVE_SQL_THREAD_MUST_STOP';
-exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY';
-exports[3019] = 'ER_INNODB_UNDO_LOG_FULL';
-exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM';
-exports[3021] = 'ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP';
-exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO';
-exports[3023] = 'ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS';
-exports[3024] = 'ER_QUERY_TIMEOUT';
-exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER';
-exports[3026] = 'ER_DUP_LIST_ENTRY';
-exports[3027] = 'ER_SQL_MODE_NO_EFFECT';
-exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION';
-exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY';
-exports[3030] = 'ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR';
-exports[3031] = 'ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER';
-exports[3032] = 'ER_SERVER_OFFLINE_MODE';
-exports[3033] = 'ER_GIS_DIFFERENT_SRIDS';
-exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT';
-exports[3035] = 'ER_GIS_UNKNOWN_ERROR';
-exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION';
-exports[3037] = 'ER_GIS_INVALID_DATA';
-exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION';
-exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION';
-exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION';
-exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION';
-exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION';
-exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION';
-exports[3044] = 'ER_STD_BAD_ALLOC_ERROR';
-exports[3045] = 'ER_STD_DOMAIN_ERROR';
-exports[3046] = 'ER_STD_LENGTH_ERROR';
-exports[3047] = 'ER_STD_INVALID_ARGUMENT';
-exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR';
-exports[3049] = 'ER_STD_OVERFLOW_ERROR';
-exports[3050] = 'ER_STD_RANGE_ERROR';
-exports[3051] = 'ER_STD_UNDERFLOW_ERROR';
-exports[3052] = 'ER_STD_LOGIC_ERROR';
-exports[3053] = 'ER_STD_RUNTIME_ERROR';
-exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION';
-exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS';
-exports[3056] = 'ER_CHANGE_MASTER_PASSWORD_LENGTH';
-exports[3057] = 'ER_USER_LOCK_WRONG_NAME';
-exports[3058] = 'ER_USER_LOCK_DEADLOCK';
-exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS';
-exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS';
-exports[3061] = 'ER_ILLEGAL_USER_VAR';
-exports[3062] = 'ER_GTID_MODE_OFF';
-exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD';
-exports[3064] = 'ER_INCORRECT_TYPE';
-exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT';
-exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT';
-exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN';
-exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE';
-exports[3069] = 'ER_INVALID_JSON_DATA';
-exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER';
-exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE';
-exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED';
-exports[3073] = 'ER_DIMENSION_UNSUPPORTED';
-exports[3074] = 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST';
-exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT';
-exports[3076] = 'ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG';
-exports[3077] = 'ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY';
-exports[3078] = 'ER_SLAVE_CHANNEL_DELETE';
-exports[3079] = 'ER_SLAVE_MULTIPLE_CHANNELS_CMD';
-exports[3080] = 'ER_SLAVE_MAX_CHANNELS_EXCEEDED';
-exports[3081] = 'ER_SLAVE_CHANNEL_MUST_STOP';
-exports[3082] = 'ER_SLAVE_CHANNEL_NOT_RUNNING';
-exports[3083] = 'ER_SLAVE_CHANNEL_WAS_RUNNING';
-exports[3084] = 'ER_SLAVE_CHANNEL_WAS_NOT_RUNNING';
-exports[3085] = 'ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP';
-exports[3086] = 'ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER';
-exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2';
-exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2';
-exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE';
-exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE';
-exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID';
-exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION';
-exports[3093] = 'ER_GROUP_REPLICATION_RUNNING';
-exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR';
-exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT';
-exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR';
-exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR';
-exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR';
-exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR';
-exports[3100] = 'ER_RUN_HOOK_ERROR';
-exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT';
-exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED';
-exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN';
-exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN';
-exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN';
-exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN';
-exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR';
-exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN';
-exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC';
-exports[3110] = 'ER_FEATURE_NOT_AVAILABLE';
-exports[3111] = 'ER_CANT_SET_GTID_MODE';
-exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF';
-exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION';
-exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON';
-exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF';
-exports[3116] = 'ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS';
-exports[3117] = 'ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS';
-exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED';
-exports[3119] = 'ER_WRONG_TABLESPACE_NAME';
-exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY';
-exports[3121] = 'ER_WRONG_FILE_NAME';
-exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION';
-exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR';
-exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME';
-exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME';
-exports[3126] = 'ER_WARN_CONFLICTING_HINT';
-exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME';
-exports[3128] = 'ER_UNRESOLVED_HINT_NAME';
-exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE';
-exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED';
-exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME';
-exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK';
-exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT';
-exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED';
-exports[3135] = 'ER_SQL_MODE_MERGED';
-exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH';
-exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND';
-exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID';
-exports[3139] = 'ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED';
-exports[3140] = 'ER_INVALID_JSON_TEXT';
-exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM';
-exports[3142] = 'ER_INVALID_JSON_BINARY_DATA';
-exports[3143] = 'ER_INVALID_JSON_PATH';
-exports[3144] = 'ER_INVALID_JSON_CHARSET';
-exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION';
-exports[3146] = 'ER_INVALID_TYPE_FOR_JSON';
-exports[3147] = 'ER_INVALID_CAST_TO_JSON';
-exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET';
-exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD';
-exports[3150] = 'ER_JSON_VALUE_TOO_BIG';
-exports[3151] = 'ER_JSON_KEY_TOO_BIG';
-exports[3152] = 'ER_JSON_USED_AS_KEY';
-exports[3153] = 'ER_JSON_VACUOUS_PATH';
-exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG';
-exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE';
-exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST';
-exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP';
-exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY';
-exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED';
-exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED';
-exports[3161] = 'ER_DISABLED_STORAGE_ENGINE';
-exports[3162] = 'ER_USER_DOES_NOT_EXIST';
-exports[3163] = 'ER_USER_ALREADY_EXISTS';
-exports[3164] = 'ER_AUDIT_API_ABORT';
-exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL';
-exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS';
-exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC';
-exports[3168] = 'ER_SERVER_ISNT_AVAILABLE';
-exports[3169] = 'ER_SESSION_WAS_KILLED';
-exports[3170] = 'ER_CAPACITY_EXCEEDED';
-exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER';
-exports[3172] = 'ER_TABLE_NEEDS_UPG_PART';
-exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID';
-exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL';
-exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT';
-exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE';
-exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE';
-exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN';
-exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE';
-exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE';
-exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED';
-exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE';
-exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT';
-exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION';
-exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING';
-exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER';
-exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE';
-exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR';
-exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH';
-exports[3190] = 'ER_CANT_RESET_MASTER';
-exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE';
-exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED';
-exports[3193] = 'ER_TABLE_REFERENCED';
-exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE';
-exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO';
-exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID';
-exports[3197] = 'ER_XA_RETRY';
-exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR';
-exports[3199] = 'ER_BINLOG_UNSAFE_XA';
-exports[3200] = 'ER_UDF_ERROR';
-exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE';
-exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR';
-exports[3203] = 'ER_KEYRING_MIGRATION_STATUS';
-exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES';
-exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE';
-exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED';
-exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET';
-exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY';
-exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED';
-exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED';
-exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE';
-exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED';
-exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS';
-exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE';
-exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT';
-exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED';
-exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE';
-exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE';
-exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR';
-exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY';
-exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY';
-exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS';
-exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC';
-exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER';
-exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER';
-exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP';
-exports[3227] = 'ER_XA_REPLICATION_FILTERS';
-exports[3228] = 'ER_CANT_OPEN_ERROR_LOG';
-exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST';
-exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE';
-
-
-/***/ }),
-
-/***/ 64563:
-/***/ ((__unused_webpack_module, exports) => {
-
-// Manually extracted from mysql-5.5.23/include/mysql_com.h
-
-/**
- Is raised when a multi-statement transaction
- has been started, either explicitly, by means
- of BEGIN or COMMIT AND CHAIN, or
- implicitly, by the first transactional
- statement, when autocommit=off.
-*/
-exports.SERVER_STATUS_IN_TRANS = 1;
-exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */
-exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */
-exports.SERVER_QUERY_NO_GOOD_INDEX_USED = 16;
-exports.SERVER_QUERY_NO_INDEX_USED = 32;
-/**
- The server was able to fulfill the clients request and opened a
- read-only non-scrollable cursor for a query. This flag comes
- in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
-*/
-exports.SERVER_STATUS_CURSOR_EXISTS = 64;
-/**
- This flag is sent when a read-only cursor is exhausted, in reply to
- COM_STMT_FETCH command.
-*/
-exports.SERVER_STATUS_LAST_ROW_SENT = 128;
-exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */
-exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512;
-/**
- Sent to the client if after a prepared statement reprepare
- we discovered that the new statement returns a different
- number of result set columns.
-*/
-exports.SERVER_STATUS_METADATA_CHANGED = 1024;
-exports.SERVER_QUERY_WAS_SLOW = 2048;
-
-/**
- To mark ResultSet containing output parameter values.
-*/
-exports.SERVER_PS_OUT_PARAMS = 4096;
-
-
-/***/ }),
-
-/***/ 3061:
-/***/ ((__unused_webpack_module, exports) => {
-
-// Certificates for Amazon RDS
-exports["Amazon RDS"] = {
- ca: [
- /**
- * Amazon RDS global certificate 2010 to 2015
- *
- * CN = aws.amazon.com/rds/
- * OU = RDS
- * O = Amazon.com
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2010-04-05T22:44:31Z/2015-04-04T22:41:31Z
- * F = 7F:09:8D:A5:7D:BB:A6:EF:7C:70:D8:CA:4E:49:11:55:7E:89:A7:D3
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIDQzCCAqygAwIBAgIJAOd1tlfiGoEoMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV\n'
- + 'BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRMw\n'
- + 'EQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNSRFMxHDAaBgNVBAMTE2F3cy5h\n'
- + 'bWF6b24uY29tL3Jkcy8wHhcNMTAwNDA1MjI0NDMxWhcNMTUwNDA0MjI0NDMxWjB1\n'
- + 'MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh\n'
- + 'dHRsZTETMBEGA1UEChMKQW1hem9uLmNvbTEMMAoGA1UECxMDUkRTMRwwGgYDVQQD\n'
- + 'ExNhd3MuYW1hem9uLmNvbS9yZHMvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n'
- + 'gQDKhXGU7tizxUR5WaFoMTFcxNxa05PEjZaIOEN5ctkWrqYSRov0/nOMoZjqk8bC\n'
- + 'med9vPFoQGD0OTakPs0jVe3wwmR735hyVwmKIPPsGlaBYj1O6llIpZeQVyupNx56\n'
- + 'UzqtiLaDzh1KcmfqP3qP2dInzBfJQKjiRudo1FWnpPt33QIDAQABo4HaMIHXMB0G\n'
- + 'A1UdDgQWBBT/H3x+cqSkR/ePSIinPtc4yWKe3DCBpwYDVR0jBIGfMIGcgBT/H3x+\n'
- + 'cqSkR/ePSIinPtc4yWKe3KF5pHcwdTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh\n'
- + 'c2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgNVBAoTCkFtYXpvbi5jb20x\n'
- + 'DDAKBgNVBAsTA1JEUzEcMBoGA1UEAxMTYXdzLmFtYXpvbi5jb20vcmRzL4IJAOd1\n'
- + 'tlfiGoEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAvguZy/BDT66x\n'
- + 'GfgnJlyQwnFSeVLQm9u/FIvz4huGjbq9dqnD6h/Gm56QPFdyMEyDiZWaqY6V08lY\n'
- + 'LTBNb4kcIc9/6pc0/ojKciP5QJRm6OiZ4vgG05nF4fYjhU7WClUx7cxq1fKjNc2J\n'
- + 'UCmmYqgiVkAGWRETVo+byOSDZ4swb10=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS global root CA 2015 to 2020
- *
- * CN = Amazon RDS Root CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T09:11:31Z/2020-03-05T09:11:31Z
- * F = E8:11:88:56:E7:A7:CE:3E:5E:DC:9A:31:25:1B:93:AC:DC:43:CE:B0
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUwOTExMzFaFw0y\n'
- + 'MDAzMDUwOTExMzFaMIGKMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEbMBkGA1UEAwwSQW1hem9uIFJE\n'
- + 'UyBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuD8nrZ8V\n'
- + 'u+VA8yVlUipCZIKPTDcOILYpUe8Tct0YeQQr0uyl018StdBsa3CjBgvwpDRq1HgF\n'
- + 'Ji2N3+39+shCNspQeE6aYU+BHXhKhIIStt3r7gl/4NqYiDDMWKHxHq0nsGDFfArf\n'
- + 'AOcjZdJagOMqb3fF46flc8k2E7THTm9Sz4L7RY1WdABMuurpICLFE3oHcGdapOb9\n'
- + 'T53pQR+xpHW9atkcf3pf7gbO0rlKVSIoUenBlZipUlp1VZl/OD/E+TtRhDDNdI2J\n'
- + 'P/DSMM3aEsq6ZQkfbz/Ilml+Lx3tJYXUDmp+ZjzMPLk/+3beT8EhrwtcG3VPpvwp\n'
- + 'BIOqsqVVTvw/CwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n'
- + 'AwEB/zAdBgNVHQ4EFgQUTgLurD72FchM7Sz1BcGPnIQISYMwHwYDVR0jBBgwFoAU\n'
- + 'TgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQEFBQADggEBAHZcgIio8pAm\n'
- + 'MjHD5cl6wKjXxScXKtXygWH2BoDMYBJF9yfyKO2jEFxYKbHePpnXB1R04zJSWAw5\n'
- + '2EUuDI1pSBh9BA82/5PkuNlNeSTB3dXDD2PEPdzVWbSKvUB8ZdooV+2vngL0Zm4r\n'
- + '47QPyd18yPHrRIbtBtHR/6CwKevLZ394zgExqhnekYKIqqEX41xsUV0Gm6x4vpjf\n'
- + '2u6O/+YE2U+qyyxHE5Wd5oqde0oo9UUpFETJPVb6Q2cEeQib8PBAyi0i6KnF+kIV\n'
- + 'A9dY7IHSubtCK/i8wxMVqfd5GtbA8mmpeJFwnDvm9rBEsHybl08qlax9syEwsUYr\n'
- + '/40NawZfTUU=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS global root CA 2019 to 2024
- *
- * CN = Amazon RDS Root 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-08-22T17:08:50Z/2024-08-22T17:08:50Z
- * F = D4:0D:DB:29:E3:75:0D:FF:A6:71:C3:14:0B:BF:5F:47:8D:1C:80:96
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBjCCAu6gAwIBAgIJAMc0ZzaSUK51MA0GCSqGSIb3DQEBCwUAMIGPMQswCQYD\n'
- + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
- + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
- + 'em9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkw\n'
- + 'ODIyMTcwODUwWhcNMjQwODIyMTcwODUwWjCBjzELMAkGA1UEBhMCVVMxEDAOBgNV\n'
- + 'BAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoMGUFtYXpv\n'
- + 'biBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxIDAeBgNV\n'
- + 'BAMMF0FtYXpvbiBSRFMgUm9vdCAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\n'
- + 'AQ8AMIIBCgKCAQEArXnF/E6/Qh+ku3hQTSKPMhQQlCpoWvnIthzX6MK3p5a0eXKZ\n'
- + 'oWIjYcNNG6UwJjp4fUXl6glp53Jobn+tWNX88dNH2n8DVbppSwScVE2LpuL+94vY\n'
- + '0EYE/XxN7svKea8YvlrqkUBKyxLxTjh+U/KrGOaHxz9v0l6ZNlDbuaZw3qIWdD/I\n'
- + '6aNbGeRUVtpM6P+bWIoxVl/caQylQS6CEYUk+CpVyJSkopwJlzXT07tMoDL5WgX9\n'
- + 'O08KVgDNz9qP/IGtAcRduRcNioH3E9v981QO1zt/Gpb2f8NqAjUUCUZzOnij6mx9\n'
- + 'McZ+9cWX88CRzR0vQODWuZscgI08NvM69Fn2SQIDAQABo2MwYTAOBgNVHQ8BAf8E\n'
- + 'BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUc19g2LzLA5j0Kxc0LjZa\n'
- + 'pmD/vB8wHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJKoZIhvcN\n'
- + 'AQELBQADggEBAHAG7WTmyjzPRIM85rVj+fWHsLIvqpw6DObIjMWokpliCeMINZFV\n'
- + 'ynfgBKsf1ExwbvJNzYFXW6dihnguDG9VMPpi2up/ctQTN8tm9nDKOy08uNZoofMc\n'
- + 'NUZxKCEkVKZv+IL4oHoeayt8egtv3ujJM6V14AstMQ6SwvwvA93EP/Ug2e4WAXHu\n'
- + 'cbI1NAbUgVDqp+DRdfvZkgYKryjTWd/0+1fS8X1bBZVWzl7eirNVnHbSH2ZDpNuY\n'
- + '0SBd8dj5F6ld3t58ydZbrTHze7JJOd8ijySAp4/kiu9UfZWuTPABzDa/DSdz9Dk/\n'
- + 'zPW4CXXvhLmE02TA9/HeCw3KEHIwicNuEfw=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS ap-northeast-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:06Z/2020-03-05T22:03:06Z
- * F = 4B:2D:8A:E0:C1:A3:A9:AF:A7:BB:65:0C:5A:16:8A:39:3C:03:F2:C5
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEATCCAumgAwIBAgIBRDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMDZaFw0y\n'
- + 'MDAzMDUyMjAzMDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
- + 'UyBhcC1ub3J0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
- + 'ggEBAMmM2B4PfTXCZjbZMWiDPyxvk/eeNwIRJAhfzesiGUiLozX6CRy3rwC1ZOPV\n'
- + 'AcQf0LB+O8wY88C/cV+d4Q2nBDmnk+Vx7o2MyMh343r5rR3Na+4izd89tkQVt0WW\n'
- + 'vO21KRH5i8EuBjinboOwAwu6IJ+HyiQiM0VjgjrmEr/YzFPL8MgHD/YUHehqjACn\n'
- + 'C0+B7/gu7W4qJzBL2DOf7ub2qszGtwPE+qQzkCRDwE1A4AJmVE++/FLH2Zx78Egg\n'
- + 'fV1sUxPtYgjGH76VyyO6GNKM6rAUMD/q5mnPASQVIXgKbupr618bnH+SWHFjBqZq\n'
- + 'HvDGPMtiiWII41EmGUypyt5AbysCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
- + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIiKM0Q6n1K4EmLxs3ZXxINbwEwR\n'
- + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
- + 'A4IBAQBezGbE9Rw/k2e25iGjj5n8r+M3dlye8ORfCE/dijHtxqAKasXHgKX8I9Tw\n'
- + 'JkBiGWiuzqn7gO5MJ0nMMro1+gq29qjZnYX1pDHPgsRjUX8R+juRhgJ3JSHijRbf\n'
- + '4qNJrnwga7pj94MhcLq9u0f6dxH6dXbyMv21T4TZMTmcFduf1KgaiVx1PEyJjC6r\n'
- + 'M+Ru+A0eM+jJ7uCjUoZKcpX8xkj4nmSnz9NMPog3wdOSB9cAW7XIc5mHa656wr7I\n'
- + 'WJxVcYNHTXIjCcng2zMKd1aCcl2KSFfy56sRfT7J5Wp69QSr+jq8KM55gw8uqAwi\n'
- + 'VPrXn2899T1rcTtFYFP16WXjGuc0\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-2 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS ap-northeast-2 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-11-06T00:05:46Z/2020-03-05T00:05:46Z
- * F = 77:D9:33:4E:CE:56:FC:42:7B:29:57:8D:67:59:ED:29:4E:18:CB:6B
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEATCCAumgAwIBAgIBTDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTExMDYwMDA1NDZaFw0y\n'
- + 'MDAzMDUwMDA1NDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
- + 'UyBhcC1ub3J0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
- + 'ggEBAKSwd+RVUzTRH0FgnbwoTK8TMm/zMT4+2BvALpAUe6YXbkisg2goycWuuWLg\n'
- + 'jOpFBB3GtyvXZnkqi7MkDWUmj1a2kf8l2oLyoaZ+Hm9x/sV+IJzOqPvj1XVUGjP6\n'
- + 'yYYnPJmUYqvZeI7fEkIGdFkP2m4/sgsSGsFvpD9FK1bL1Kx2UDpYX0kHTtr18Zm/\n'
- + '1oN6irqWALSmXMDydb8hE0FB2A1VFyeKE6PnoDj/Y5cPHwPPdEi6/3gkDkSaOG30\n'
- + 'rWeQfL3pOcKqzbHaWTxMphd0DSL/quZ64Nr+Ly65Q5PRcTrtr55ekOUziuqXwk+o\n'
- + '9QpACMwcJ7ROqOznZTqTzSFVXFECAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
- + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFM6Nox/QWbhzWVvzoJ/y0kGpNPK+\n'
- + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
- + 'A4IBAQCTkWBqNvyRf3Y/W21DwFx3oT/AIWrHt0BdGZO34tavummXemTH9LZ/mqv9\n'
- + 'aljt6ZuDtf5DEQjdsAwXMsyo03ffnP7doWm8iaF1+Mui77ot0TmTsP/deyGwukvJ\n'
- + 'tkxX8bZjDh+EaNauWKr+CYnniNxCQLfFtXYJsfOdVBzK3xNL+Z3ucOQRhr2helWc\n'
- + 'CDQgwfhP1+3pRVKqHvWCPC4R3fT7RZHuRmZ38kndv476GxRntejh+ePffif78bFI\n'
- + '3rIZCPBGobrrUMycafSbyXteoGca/kA+/IqrAPlk0pWQ4aEL0yTWN2h2dnjoD7oX\n'
- + 'byIuL/g9AGRh97+ssn7D6bDRPTbW\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-southeast-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS ap-southeast-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:19Z/2020-03-05T22:03:19Z
- * F = 0E:EC:5D:BD:F9:80:EE:A9:A0:8D:81:AC:37:D9:8D:34:1C:CD:27:D1
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEATCCAumgAwIBAgIBRTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMTlaFw0y\n'
- + 'MDAzMDUyMjAzMTlaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
- + 'UyBhcC1zb3V0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
- + 'ggEBANaXElmSEYt/UtxHFsARFhSUahTf1KNJzR0Dmay6hqOXQuRVbKRwPd19u5vx\n'
- + 'DdF1sLT7D69IK3VDnUiQScaCv2Dpu9foZt+rLx+cpx1qiQd1UHrvqq8xPzQOqCdC\n'
- + 'RFStq6yVYZ69yfpfoI67AjclMOjl2Vph3ftVnqP0IgVKZdzeC7fd+umGgR9xY0Qr\n'
- + 'Ubhd/lWdsbNvzK3f1TPWcfIKQnpvSt85PIEDJir6/nuJUKMtmJRwTymJf0i+JZ4x\n'
- + '7dJa341p2kHKcHMgOPW7nJQklGBA70ytjUV6/qebS3yIugr/28mwReflg3TJzVDl\n'
- + 'EOvi6pqbqNbkMuEwGDCmEQIVqgkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
- + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFAu93/4k5xbWOsgdCdn+/KdiRuit\n'
- + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
- + 'A4IBAQBlcjSyscpPjf5+MgzMuAsCxByqUt+WFspwcMCpwdaBeHOPSQrXNqX2Sk6P\n'
- + 'kth6oCivA64trWo8tFMvPYlUA1FYVD5WpN0kCK+P5pD4KHlaDsXhuhClJzp/OP8t\n'
- + 'pOyUr5109RHLxqoKB5J5m1XA7rgcFjnMxwBSWFe3/4uMk/+4T53YfCVXuc6QV3i7\n'
- + 'I/2LAJwFf//pTtt6fZenYfCsahnr2nvrNRNyAxcfvGZ/4Opn/mJtR6R/AjvQZHiR\n'
- + 'bkRNKF2GW0ueK5W4FkZVZVhhX9xh1Aj2Ollb+lbOqADaVj+AT3PoJPZ3MPQHKCXm\n'
- + 'xwG0LOLlRr/TfD6li1AfOVTAJXv9\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-southeast-2 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS ap-southeast-2 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:24Z/2020-03-05T22:03:24Z
- * F = 20:D9:A8:82:23:AB:B9:E5:C5:24:10:D3:4D:0F:3D:B1:31:DF:E5:14
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEATCCAumgAwIBAgIBRjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMjRaFw0y\n'
- + 'MDAzMDUyMjAzMjRaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
- + 'UyBhcC1zb3V0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
- + 'ggEBAJqBAJutz69hFOh3BtLHZTbwE8eejGGKayn9hu98YMDPzWzGXWCmW+ZYWELA\n'
- + 'cY3cNWNF8K4FqKXFr2ssorBYim1UtYFX8yhydT2hMD5zgQ2sCGUpuidijuPA6zaq\n'
- + 'Z3tdhVR94f0q8mpwpv2zqR9PcqaGDx2VR1x773FupRPRo7mEW1vC3IptHCQlP/zE\n'
- + '7jQiLl28bDIH2567xg7e7E9WnZToRnhlYdTaDaJsHTzi5mwILi4cihSok7Shv/ME\n'
- + 'hnukvxeSPUpaVtFaBhfBqq055ePq9I+Ns4KGreTKMhU0O9fkkaBaBmPaFgmeX/XO\n'
- + 'n2AX7gMouo3mtv34iDTZ0h6YCGkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
- + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIlQnY0KHYWn1jYumSdJYfwj/Nfw\n'
- + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
- + 'A4IBAQA0wVU6/l41cTzHc4azc4CDYY2Wd90DFWiH9C/mw0SgToYfCJ/5Cfi0NT/Y\n'
- + 'PRnk3GchychCJgoPA/k9d0//IhYEAIiIDjyFVgjbTkKV3sh4RbdldKVOUB9kumz/\n'
- + 'ZpShplsGt3z4QQiVnKfrAgqxWDjR0I0pQKkxXa6Sjkicos9LQxVtJ0XA4ieG1E7z\n'
- + 'zJr+6t80wmzxvkInSaWP3xNJK9azVRTrgQZQlvkbpDbExl4mNTG66VD3bAp6t3Wa\n'
- + 'B49//uDdfZmPkqqbX+hsxp160OH0rxJppwO3Bh869PkDnaPEd/Pxw7PawC+li0gi\n'
- + 'NRV8iCEx85aFxcyOhqn0WZOasxee\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-central-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS eu-central-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:31Z/2020-03-05T22:03:31Z
- * F = 94:B4:DF:B9:6D:7E:F7:C3:B7:BF:51:E9:A6:B7:44:A0:D0:82:11:84
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/zCCAuegAwIBAgIBRzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzFaFw0y\n'
- + 'MDAzMDUyMjAzMzFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE\n'
- + 'UyBldS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n'
- + 'AQDFtP2dhSLuaPOI4ZrrPWsK4OY9ocQBp3yApH1KJYmI9wpQKZG/KCH2E6Oo7JAw\n'
- + 'QORU519r033T+FO2Z7pFPlmz1yrxGXyHpJs8ySx3Yo5S8ncDCdZJCLmtPiq/hahg\n'
- + '5/0ffexMFUCQaYicFZsrJ/cStdxUV+tSw2JQLD7UxS9J97LQWUPyyG+ZrjYVTVq+\n'
- + 'zudnFmNSe4QoecXMhAFTGJFQXxP7nhSL9Ao5FGgdXy7/JWeWdQIAj8ku6cBDKPa6\n'
- + 'Y6kP+ak+In+Lye8z9qsCD/afUozfWjPR2aA4JoIZVF8dNRShIMo8l0XfgfM2q0+n\n'
- + 'ApZWZ+BjhIO5XuoUgHS3D2YFAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV\n'
- + 'HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRm4GsWIA/M6q+tK8WGHWDGh2gcyTAf\n'
- + 'BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOC\n'
- + 'AQEAHpMmeVQNqcxgfQdbDIi5UIy+E7zZykmtAygN1XQrvga9nXTis4kOTN6g5/+g\n'
- + 'HCx7jIXeNJzAbvg8XFqBN84Quqgpl/tQkbpco9Jh1HDs558D5NnZQxNqH5qXQ3Mm\n'
- + 'uPgCw0pYcPOa7bhs07i+MdVwPBsX27CFDtsgAIru8HvKxY1oTZrWnyIRo93tt/pk\n'
- + 'WuItVMVHjaQZVfTCow0aDUbte6Vlw82KjUFq+n2NMSCJDiDKsDDHT6BJc4AJHIq3\n'
- + '/4Z52MSC9KMr0yAaaoWfW/yMEj9LliQauAgwVjArF4q78rxpfKTG9Rfd8U1BZANP\n'
- + '7FrFMN0ThjfA1IvmOYcgskY5bQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS eu-west-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:35Z/2020-03-05T22:03:35Z
- * F = 1A:95:F0:43:82:D2:5D:A6:AD:F5:13:27:0B:40:8A:72:D9:92:F3:E0
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBSDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzVaFw0y\n'
- + 'MDAzMDUyMjAzMzVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyBldS13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx\n'
- + 'PdbqQ0HKRj79Pmocxvjc+P6i4Ux24kgFIl+ckiir1vzkmesc3a58gjrMlCksEObt\n'
- + 'Yihs5IhzEq1ePT0gbfS9GYFp34Uj/MtPwlrfCBWG4d2TcrsKRHr1/EXUYhWqmdrb\n'
- + 'RhX8XqoRhVkbF/auzFSBhTzcGGvZpQ2KIaxRcQfcXlMVhj/pxxAjh8U4F350Fb0h\n'
- + 'nX1jw4/KvEreBL0Xb2lnlGTkwVxaKGSgXEnOgIyOFdOQc61vdome0+eeZsP4jqeR\n'
- + 'TGYJA9izJsRbe2YJxHuazD+548hsPlM3vFzKKEVURCha466rAaYAHy3rKur3HYQx\n'
- + 'Yt+SoKcEz9PXuSGj96ejAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBTebg//h2oeXbZjQ4uuoiuLYzuiPDAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
- + 'TikPaGeZasTPw+4RBemlsyPAjtFFQLo7ddaFdORLgdEysVf8aBqndvbA6MT/v4lj\n'
- + 'GtEtUdF59ZcbWOrVm+fBZ2h/jYJ59dYF/xzb09nyRbdMSzB9+mkSsnOMqluq5y8o\n'
- + 'DY/PfP2vGhEg/2ZncRC7nlQU1Dm8F4lFWEiQ2fi7O1cW852Vmbq61RIfcYsH/9Ma\n'
- + 'kpgk10VZ75b8m3UhmpZ/2uRY+JEHImH5WpcTJ7wNiPNJsciZMznGtrgOnPzYco8L\n'
- + 'cDleOASIZifNMQi9PKOJKvi0ITz0B/imr8KBsW0YjZVJ54HMa7W1lwugSM7aMAs+\n'
- + 'E3Sd5lS+SHwWaOCHwhOEVA==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS sa-east-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS sa-east-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:40Z/2020-03-05T22:03:40Z
- * F = 32:10:3D:FA:6D:42:F5:35:98:40:15:F4:4C:74:74:27:CB:CE:D4:B5
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBSTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDBaFw0y\n'
- + 'MDAzMDUyMjAzNDBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyBzYS1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCU\n'
- + 'X4OBnQ5xA6TLJAiFEI6l7bUWjoVJBa/VbMdCCSs2i2dOKmqUaXu2ix2zcPILj3lZ\n'
- + 'GMk3d/2zvTK/cKhcFrewHUBamTeVHdEmynhMQamqNmkM4ptYzFcvEUw1TGxHT4pV\n'
- + 'Q6gSN7+/AJewQvyHexHo8D0+LDN0/Wa9mRm4ixCYH2CyYYJNKaZt9+EZfNu+PPS4\n'
- + '8iB0TWH0DgQkbWMBfCRgolLLitAZklZ4dvdlEBS7evN1/7ttBxUK6SvkeeSx3zBl\n'
- + 'ww3BlXqc3bvTQL0A+RRysaVyFbvtp9domFaDKZCpMmDFAN/ntx215xmQdrSt+K3F\n'
- + 'cXdGQYHx5q410CAclGnbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT6iVWnm/uakS+tEX2mzIfw+8JL0zAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
- + 'FmDD+QuDklXn2EgShwQxV13+txPRuVdOSrutHhoCgMwFWCMtPPtBAKs6KPY7Guvw\n'
- + 'DpJoZSehDiOfsgMirjOWjvfkeWSNvKfjWTVneX7pZD9W5WPnsDBvTbCGezm+v87z\n'
- + 'b+ZM2ZMo98m/wkMcIEAgdSKilR2fuw8rLkAjhYFfs0A7tDgZ9noKwgHvoE4dsrI0\n'
- + 'KZYco6DlP/brASfHTPa2puBLN9McK3v+h0JaSqqm5Ro2Bh56tZkQh8AWy/miuDuK\n'
- + '3+hNEVdxosxlkM1TPa1DGj0EzzK0yoeerXuH2HX7LlCrrxf6/wdKnjR12PMrLQ4A\n'
- + 'pCqkcWw894z6bV9MAvKe6A==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-east-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS us-east-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T21:54:04Z/2020-03-05T21:54:04Z
- * F = 34:47:8A:90:8A:83:AE:45:DC:B6:16:76:D2:35:EC:E9:75:C6:2C:63
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBQzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMTU0MDRaFw0y\n'
- + 'MDAzMDUyMTU0MDRaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyB1cy1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI\n'
- + 'UIuwh8NusKHk1SqPXcP7OqxY3S/M2ZyQWD3w7Bfihpyyy/fc1w0/suIpX3kbMhAV\n'
- + '2ESwged2/2zSx4pVnjp/493r4luhSqQYzru78TuPt9bhJIJ51WXunZW2SWkisSaf\n'
- + 'USYUzVN9ezR/bjXTumSUQaLIouJt3OHLX49s+3NAbUyOI8EdvgBQWD68H1epsC0n\n'
- + 'CI5s+pIktyOZ59c4DCDLQcXErQ+tNbDC++oct1ANd/q8p9URonYwGCGOBy7sbCYq\n'
- + '9eVHh1Iy2M+SNXddVOGw5EuruvHoCIQyOz5Lz4zSuZA9dRbrfztNOpezCNYu6NKM\n'
- + 'n+hzcvdiyxv77uNm8EaxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQSQG3TmMe6Sa3KufaPBa72v4QFDzAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
- + 'L/mOZfB3187xTmjOHMqN2G2oSKHBKiQLM9uv8+97qT+XR+TVsBT6b3yoPpMAGhHA\n'
- + 'Pc7nxAF5gPpuzatx0OTLPcmYucFmfqT/1qA5WlgCnMNtczyNMH97lKFTNV7Njtek\n'
- + 'jWEzAEQSyEWrkNpNlC4j6kMYyPzVXQeXUeZTgJ9FNnVZqmvfjip2N22tawMjrCn5\n'
- + '7KN/zN65EwY2oO9XsaTwwWmBu3NrDdMbzJnbxoWcFWj4RBwanR1XjQOVNhDwmCOl\n'
- + '/1Et13b8CPyj69PC8BOVU6cfTSx8WUVy0qvYOKHNY9Bqa5BDnIL3IVmUkeTlM1mt\n'
- + 'enRpyBj+Bk9rh/ICdiRKmA==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-west-1 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS us-west-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:45Z/2020-03-05T22:03:45Z
- * F = EF:94:2F:E3:58:0E:09:D6:79:C2:16:97:91:FB:37:EA:D7:70:A8:4B
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBSjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDVaFw0y\n'
- + 'MDAzMDUyMjAzNDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyB1cy13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDE\n'
- + 'Dhw+uw/ycaiIhhyu2pXFRimq0DlB8cNtIe8hdqndH8TV/TFrljNgR8QdzOgZtZ9C\n'
- + 'zzQ2GRpInN/qJF6slEd6wO+6TaDBQkPY+07TXNt52POFUhdVkhJXHpE2BS7Xn6J7\n'
- + '7RFAOeG1IZmc2DDt+sR1BgXzUqHslQGfFYNS0/MBO4P+ya6W7IhruB1qfa4HiYQS\n'
- + 'dbe4MvGWnv0UzwAqdR7OF8+8/5c58YXZIXCO9riYF2ql6KNSL5cyDPcYK5VK0+Q9\n'
- + 'VI6vuJHSMYcF7wLePw8jtBktqAFE/wbdZiIHhZvNyiNWPPNTGUmQbaJ+TzQEHDs5\n'
- + '8en+/W7JKnPyBOkxxENbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBS0nw/tFR9bCjgqWTPJkyy4oOD8bzAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
- + 'CXGAY3feAak6lHdqj6+YWjy6yyUnLK37bRxZDsyDVXrPRQaXRzPTzx79jvDwEb/H\n'
- + 'Q/bdQ7zQRWqJcbivQlwhuPJ4kWPUZgSt3JUUuqkMsDzsvj/bwIjlrEFDOdHGh0mi\n'
- + 'eVIngFEjUXjMh+5aHPEF9BlQnB8LfVtKj18e15UDTXFa+xJPFxUR7wDzCfo4WI1m\n'
- + 'sUMG4q1FkGAZgsoyFPZfF8IVvgCuGdR8z30VWKklFxttlK0eGLlPAyIO0CQxPQlo\n'
- + 'saNJrHf4tLOgZIWk+LpDhNd9Et5EzvJ3aURUsKY4pISPPF5WdvM9OE59bERwUErd\n'
- + 'nuOuQWQeeadMceZnauRzJQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-west-2 certificate CA 2015 to 2020
- *
- * CN = Amazon RDS us-west-2 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2015-02-05T22:03:50Z/2020-03-05T22:03:50Z
- * F = 94:2C:A8:B0:23:48:17:F0:CD:2F:19:7F:C1:E0:21:7C:65:79:13:3A
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBSzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNTBaFw0y\n'
- + 'MDAzMDUyMjAzNTBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyB1cy13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM\n'
- + 'H58SR48U6jyERC1vYTnub34smf5EQVXyzaTmspWGWGzT31NLNZGSDFaa7yef9kdO\n'
- + 'mzJsgebR5tXq6LdwlIoWkKYQ7ycUaadtVKVYdI40QcI3cHn0qLFlg2iBXmWp/B+i\n'
- + 'Z34VuVlCh31Uj5WmhaBoz8t/GRqh1V/aCsf3Wc6jCezH3QfuCjBpzxdOOHN6Ie2v\n'
- + 'xX09O5qmZTvMoRBAvPkxdaPg/Mi7fxueWTbEVk78kuFbF1jHYw8U1BLILIAhcqlq\n'
- + 'x4u8nl73t3O3l/soNUcIwUDK0/S+Kfqhwn9yQyPlhb4Wy3pfnZLJdkyHldktnQav\n'
- + '9TB9u7KH5Lk0aAYslMLxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT8roM4lRnlFHWMPWRz0zkwFZog1jAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
- + 'JwrxwgwmPtcdaU7O7WDdYa4hprpOMamI49NDzmE0s10oGrqmLwZygcWU0jT+fJ+Y\n'
- + 'pJe1w0CVfKaeLYNsOBVW3X4ZPmffYfWBheZiaiEflq/P6t7/Eg81gaKYnZ/x1Dfa\n'
- + 'sUYkzPvCkXe9wEz5zdUTOCptDt89rBR9CstL9vE7WYUgiVVmBJffWbHQLtfjv6OF\n'
- + 'NMb0QME981kGRzc2WhgP71YS2hHd1kXtsoYP1yTu4vThSKsoN4bkiHsaC1cRkLoy\n'
- + '0fFA4wpB3WloMEvCDaUvvH1LZlBXTNlwi9KtcwD4tDxkkBt4tQczKLGpQ/nF/W9n\n'
- + '8YDWk3IIc1sd0bkZqoau2Q==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-south-1 certificate CA 2016 to 2020
- *
- * CN = Amazon RDS ap-south-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2016-05-03T21:29:22Z/2020-03-05T21:29:22Z
- * F = F3:A3:C2:52:D9:82:20:AC:8C:62:31:2A:8C:AD:5D:7B:1C:31:F1:DD
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/TCCAuWgAwIBAgIBTTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA1MDMyMTI5MjJaFw0y\n'
- + 'MDAzMDUyMTI5MjJaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEhMB8GA1UEAwwYQW1hem9uIFJE\n'
- + 'UyBhcC1zb3V0aC0xIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n'
- + '06eWGLE0TeqL9kyWOLkS8q0fXO97z+xyBV3DKSB2lg2GkgBz3B98MkmkeB0SZy3G\n'
- + 'Ce4uCpCPbFKiFEdiUclOlhZsrBuCeaimxLM3Ig2wuenElO/7TqgaYHYUbT3d+VQW\n'
- + 'GUbLn5GRZJZe1OAClYdOWm7A1CKpuo+cVV1vxbY2nGUQSJPpVn2sT9gnwvjdE60U\n'
- + 'JGYU/RLCTm8zmZBvlWaNIeKDnreIc4rKn6gUnJ2cQn1ryCVleEeyc3xjYDSrjgdn\n'
- + 'FLYGcp9mphqVT0byeQMOk0c7RHpxrCSA0V5V6/CreFV2LteK50qcDQzDSM18vWP/\n'
- + 'p09FoN8O7QrtOeZJzH/lmwIDAQABo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0T\n'
- + 'AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU2i83QHuEl/d0keXF+69HNJph7cMwHwYD\n'
- + 'VR0jBBgwFoAUTgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQELBQADggEB\n'
- + 'ACqnH2VjApoDqoSQOky52QBwsGaj+xWYHW5Gm7EvCqvQuhWMkeBuD6YJmMvNyA9G\n'
- + 'I2lh6/o+sUk/RIsbYbxPRdhNPTOgDR9zsNRw6qxaHztq/CEC+mxDCLa3O1hHBaDV\n'
- + 'BmB3nCZb93BvO0EQSEk7aytKq/f+sjyxqOcs385gintdHGU9uM7gTZHnU9vByJsm\n'
- + '/TL07Miq67X0NlhIoo3jAk+xHaeKJdxdKATQp0448P5cY20q4b8aMk1twcNaMvCP\n'
- + 'dG4M5doaoUA8OQ/0ukLLae/LBxLeTw04q1/a2SyFaVUX2Twbb1S3xVWwLA8vsyGr\n'
- + 'igXx7B5GgP+IHb6DTjPJAi0=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-east-2 certificate CA 2016 to 2020
- *
- * CN = Amazon RDS us-east-2 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2016-08-11T19:58:45Z/2020-03-05T19:58:45Z
- * F = 9B:78:E3:64:7F:74:BC:B2:52:18:CF:13:C3:62:B8:35:9D:3D:5F:B6
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBTjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA4MTExOTU4NDVaFw0y\n'
- + 'MDAzMDUxOTU4NDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyB1cy1lYXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCp\n'
- + 'WnnUX7wM0zzstccX+4iXKJa9GR0a2PpvB1paEX4QRCgfhEdQWDaSqyrWNgdVCKkt\n'
- + '1aQkWu5j6VAC2XIG7kKoonm1ZdBVyBLqW5lXNywlaiU9yhJkwo8BR+/OqgE+PLt/\n'
- + 'EO1mlN0PQudja/XkExCXTO29TG2j7F/O7hox6vTyHNHc0H88zS21uPuBE+jivViS\n'
- + 'yzj/BkyoQ85hnkues3f9R6gCGdc+J51JbZnmgzUkvXjAEuKhAm9JksVOxcOKUYe5\n'
- + 'ERhn0U9zjzpfbAITIkul97VVa5IxskFFTHIPJbvRKHJkiF6wTJww/tc9wm+fSCJ1\n'
- + '+DbQTGZgkQ3bJrqRN29/AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBSAHQzUYYZbepwKEMvGdHp8wzHnfDAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
- + 'MbaEzSYZ+aZeTBxf8yi0ta8K4RdwEJsEmP6IhFFQHYUtva2Cynl4Q9tZg3RMsybT\n'
- + '9mlnSQQlbN/wqIIXbkrcgFcHoXG9Odm/bDtUwwwDaiEhXVfeQom3G77QHOWMTCGK\n'
- + 'qadwuh5msrb17JdXZoXr4PYHDKP7j0ONfAyFNER2+uecblHfRSpVq5UeF3L6ZJb8\n'
- + 'fSw/GtAV6an+/0r+Qm+PiI2H5XuZ4GmRJYnGMhqWhBYrY7p3jtVnKcsh39wgfUnW\n'
- + 'AvZEZG/yhFyAZW0Essa39LiL5VSq14Y1DOj0wgnhSY/9WHxaAo1HB1T9OeZknYbD\n'
- + 'fl/EGSZ0TEvZkENrXcPlVA==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ca-central-1 certificate CA 2016 to 2020
- *
- * CN = Amazon RDS ca-central-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2016-09-15T00:10:11Z/2020-03-05T00:10:11Z
- * F = D7:E0:16:AB:8A:0B:63:9F:67:1F:16:87:42:F4:0A:EE:73:A6:FC:04
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/zCCAuegAwIBAgIBTzANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA5MTUwMDEwMTFaFw0y\n'
- + 'MDAzMDUwMDEwMTFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE\n'
- + 'UyBjYS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n'
- + 'AQCZYI/iQ6DrS3ny3t1EwX1wAD+3LMgh7Fd01EW5LIuaK2kYIIQpsVKhxLCit/V5\n'
- + 'AGc/1qiJS1Qz9ODLTh0Na6bZW6EakRzuHJLe32KJtoFYPC7Z09UqzXrpA/XL+1hM\n'
- + 'P0ZmCWsU7Nn/EmvfBp9zX3dZp6P6ATrvDuYaVFr+SA7aT3FXpBroqBS1fyzUPs+W\n'
- + 'c6zTR6+yc4zkHX0XQxC5RH6xjgpeRkoOajA/sNo7AQF7KlWmKHbdVF44cvvAhRKZ\n'
- + 'XaoVs/C4GjkaAEPTCbopYdhzg+KLx9eB2BQnYLRrIOQZtRfbQI2Nbj7p3VsRuOW1\n'
- + 'tlcks2w1Gb0YC6w6SuIMFkl1AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV\n'
- + 'HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBToYWxE1lawl6Ks6NsvpbHQ3GKEtzAf\n'
- + 'BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOC\n'
- + 'AQEAG/8tQ0ooi3hoQpa5EJz0/E5VYBsAz3YxA2HoIonn0jJyG16bzB4yZt4vNQMA\n'
- + 'KsNlQ1uwDWYL1nz63axieUUFIxqxl1KmwfhsmLgZ0Hd2mnTPIl2Hw3uj5+wdgGBg\n'
- + 'agnAZ0bajsBYgD2VGQbqjdk2Qn7Fjy3LEWIvGZx4KyZ99OJ2QxB7JOPdauURAtWA\n'
- + 'DKYkP4LLJxtj07DSzG8kuRWb9B47uqUD+eKDIyjfjbnzGtd9HqqzYFau7EX3HVD9\n'
- + '9Qhnjl7bTZ6YfAEZ3nH2t3Vc0z76XfGh47rd0pNRhMV+xpok75asKf/lNh5mcUrr\n'
- + 'VKwflyMkQpSbDCmcdJ90N2xEXQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-2 certificate CA 2016 to 2020
- *
- * CN = Amazon RDS eu-west-2 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2016-10-10T17:44:42Z/2020-03-05T17:44:42Z
- * F = 47:79:51:9F:FF:07:D3:F4:27:D3:AB:64:56:7F:00:45:BB:84:C1:71
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBUDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjEwMTAxNzQ0NDJaFw0y\n'
- + 'MDAzMDUxNzQ0NDJaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyBldS13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDO\n'
- + 'cttLJfubB4XMMIGWNfJISkIdCMGJyOzLiMJaiWB5GYoXKhEl7YGotpy0qklwW3BQ\n'
- + 'a0fmVdcCLX+dIuVQ9iFK+ZcK7zwm7HtdDTCHOCKeOh2IcnU4c/VIokFi6Gn8udM6\n'
- + 'N/Zi5M5OGpVwLVALQU7Yctsn3c95el6MdVx6mJiIPVu7tCVZn88Z2koBQ2gq9P4O\n'
- + 'Sb249SHFqOb03lYDsaqy1NDsznEOhaRBw7DPJFpvmw1lA3/Y6qrExRI06H2VYR2i\n'
- + '7qxwDV50N58fs10n7Ye1IOxTVJsgEA7X6EkRRXqYaM39Z76R894548WHfwXWjUsi\n'
- + 'MEX0RS0/t1GmnUQjvevDAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQBxmcuRSxERYCtNnSr5xNfySokHjAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
- + 'UyCUQjsF3nUAABjfEZmpksTuUo07aT3KGYt+EMMFdejnBQ0+2lJJFGtT+CDAk1SD\n'
- + 'RSgfEBon5vvKEtlnTf9a3pv8WXOAkhfxnryr9FH6NiB8obISHNQNPHn0ljT2/T+I\n'
- + 'Y6ytfRvKHa0cu3V0NXbJm2B4KEOt4QCDiFxUIX9z6eB4Kditwu05OgQh6KcogOiP\n'
- + 'JesWxBMXXGoDC1rIYTFO7szwDyOHlCcVXJDNsTJhc32oDWYdeIbW7o/5I+aQsrXZ\n'
- + 'C96HykZcgWzz6sElrQxUaT3IoMw/5nmw4uWKKnZnxgI9bY4fpQwMeBZ96iHfFxvH\n'
- + 'mqfEEuC7uUoPofXdBp2ObQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-gov-west-1 CA 2017 to 2022
- *
- * CN = Amazon RDS us-gov-west-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2017-05-19T22:31:19Z/2022-05-18T12:00:00Z
- * F = 77:55:8C:C4:5E:71:1F:1B:57:E3:DA:6E:5B:74:27:12:4E:E8:69:E8
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECjCCAvKgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZMxCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSQwIgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwHhcNMTcwNTE5\n'
- + 'MjIzMTE5WhcNMjIwNTE4MTIwMDAwWjCBkzELMAkGA1UEBhMCVVMxEzARBgNVBAgM\n'
- + 'Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBX\n'
- + 'ZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJDAiBgNVBAMM\n'
- + 'G0FtYXpvbiBSRFMgdXMtZ292LXdlc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
- + 'ggEPADCCAQoCggEBAM8YZLKAzzOdNnoi7Klih26Zkj+OCpDfwx4ZYB6f8L8UoQi5\n'
- + '8z9ZtIwMjiJ/kO08P1yl4gfc7YZcNFvhGruQZNat3YNpxwUpQcr4mszjuffbL4uz\n'
- + '+/8FBxALdqCVOJ5Q0EVSfz3d9Bd1pUPL7ARtSpy7bn/tUPyQeI+lODYO906C0TQ3\n'
- + 'b9bjOsgAdBKkHfjLdsknsOZYYIzYWOJyFJJa0B11XjDUNBy/3IuC0KvDl6At0V5b\n'
- + '8M6cWcKhte2hgjwTYepV+/GTadeube1z5z6mWsN5arOAQUtYDLH6Aztq9mCJzLHm\n'
- + 'RccBugnGl3fRLJ2VjioN8PoGoN9l9hFBy5fnFgsCAwEAAaNmMGQwDgYDVR0PAQH/\n'
- + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEG7+br8KkvwPd5g\n'
- + '71Rvh2stclJbMB8GA1UdIwQYMBaAFEkQz6S4NS5lOYKcDjBSuCcVpdzjMA0GCSqG\n'
- + 'SIb3DQEBCwUAA4IBAQBMA327u5ABmhX+aPxljoIbxnydmAFWxW6wNp5+rZrvPig8\n'
- + 'zDRqGQWWr7wWOIjfcWugSElYtf/m9KZHG/Z6+NG7nAoUrdcd1h/IQhb+lFQ2b5g9\n'
- + 'sVzQv/H2JNkfZA8fL/Ko/Tm/f9tcqe0zrGCtT+5u0Nvz35Wl8CEUKLloS5xEb3k5\n'
- + '7D9IhG3fsE3vHWlWrGCk1cKry3j12wdPG5cUsug0vt34u6rdhP+FsM0tHI15Kjch\n'
- + 'RuUCvyQecy2ZFNAa3jmd5ycNdL63RWe8oayRBpQBxPPCbHfILxGZEdJbCH9aJ2D/\n'
- + 'l8oHIDnvOLdv7/cBjyYuvmprgPtu3QEkbre5Hln/\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-3 certificate CA 2017 to 2020
- *
- * CN = Amazon RDS eu-west-3 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2017-08-25T21:39:26Z/2020-03-05T21:39:26Z
- * F = FD:35:A7:84:60:68:98:00:12:54:ED:34:26:8C:66:0F:72:DD:B2:F4
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIID/DCCAuSgAwIBAgIBUTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzA4MjUyMTM5MjZaFw0y\n'
- + 'MDAzMDUyMTM5MjZaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
- + 'UyBldS13ZXN0LTMgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+\n'
- + 'xmlEC/3a4cJH+UPwXCE02lC7Zq5NHd0dn6peMeLN8agb6jW4VfSY0NydjRj2DJZ8\n'
- + 'K7wV6sub5NUGT1NuFmvSmdbNR2T59KX0p2dVvxmXHHtIpQ9Y8Aq3ZfhmC5q5Bqgw\n'
- + 'tMA1xayDi7HmoPX3R8kk9ktAZQf6lDeksCvok8idjTu9tiSpDiMwds5BjMsWfyjZ\n'
- + 'd13PTGGNHYVdP692BSyXzSP1Vj84nJKnciW8tAqwIiadreJt5oXyrCXi8ekUMs80\n'
- + 'cUTuGm3aA3Q7PB5ljJMPqz0eVddaiIvmTJ9O3Ez3Du/HpImyMzXjkFaf+oNXf/Hx\n'
- + '/EW5jCRR6vEiXJcDRDS7AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
- + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBRZ9mRtS5fHk3ZKhG20Oack4cAqMTAfBgNV\n'
- + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
- + 'F/u/9L6ExQwD73F/bhCw7PWcwwqsK1mypIdrjdIsu0JSgwWwGCXmrIspA3n3Dqxq\n'
- + 'sMhAJD88s9Em7337t+naar2VyLO63MGwjj+vA4mtvQRKq8ScIpiEc7xN6g8HUMsd\n'
- + 'gPG9lBGfNjuAZsrGJflrko4HyuSM7zHExMjXLH+CXcv/m3lWOZwnIvlVMa4x0Tz0\n'
- + 'A4fklaawryngzeEjuW6zOiYCzjZtPlP8Fw0SpzppJ8VpQfrZ751RDo4yudmPqoPK\n'
- + '5EUe36L8U+oYBXnC5TlYs9bpVv9o5wJQI5qA9oQE2eFWxF1E0AyZ4V5sgGUBStaX\n'
- + 'BjDDWul0wSo7rt1Tq7XpnA==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-3 certificate CA 2017 to 2020
- *
- * CN = Amazon RDS ap-northeast-3 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2017-12-01T00:55:42Z/2020-03-05T00:55:42Z
- * F = C0:C7:D4:B3:91:40:A0:77:43:28:BF:AF:77:57:DF:FD:98:FB:10:3F
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEATCCAumgAwIBAgIBTjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
- + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzEyMDEwMDU1NDJaFw0y\n'
- + 'MDAzMDUwMDU1NDJaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
- + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
- + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
- + 'UyBhcC1ub3J0aGVhc3QtMyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
- + 'ggEBAMZtQNnm/XT19mTa10ftHLzg5UhajoI65JHv4TQNdGXdsv+CQdGYU49BJ9Eu\n'
- + '3bYgiEtTzR2lQe9zGMvtuJobLhOWuavzp7IixoIQcHkFHN6wJ1CvqrxgvJfBq6Hy\n'
- + 'EuCDCiU+PPDLUNA6XM6Qx3IpHd1wrJkjRB80dhmMSpxmRmx849uFafhN+P1QybsM\n'
- + 'TI0o48VON2+vj+mNuQTyLMMP8D4odSQHjaoG+zyJfJGZeAyqQyoOUOFEyQaHC3TT\n'
- + '3IDSNCQlpxb9LerbCoKu79WFBBq3CS5cYpg8/fsnV2CniRBFFUumBt5z4dhw9RJU\n'
- + 'qlUXXO1ZyzpGd+c5v6FtrfXtnIUCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
- + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFETv7ELNplYy/xTeIOInl6nzeiHg\n'
- + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
- + 'A4IBAQCpKxOQcd0tEKb3OtsOY8q/MPwTyustGk2Rt7t9G68idADp8IytB7M0SDRo\n'
- + 'wWZqynEq7orQVKdVOanhEWksNDzGp0+FPAf/KpVvdYCd7ru3+iI+V4ZEp2JFdjuZ\n'
- + 'Zz0PIjS6AgsZqE5Ri1J+NmfmjGZCPhsHnGZiBaenX6K5VRwwwmLN6xtoqrrfR5zL\n'
- + 'QfBeeZNJG6KiM3R/DxJ5rAa6Fz+acrhJ60L7HprhB7SFtj1RCijau3+ZwiGmUOMr\n'
- + 'yKlMv+VgmzSw7o4Hbxy1WVrA6zQsTHHSGf+vkQn2PHvnFMUEu/ZLbTDYFNmTLK91\n'
- + 'K6o4nMsEvhBKgo4z7H1EqqxXhvN2\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS GovCloud Root CA 2017 to 2022
- *
- * CN = Amazon RDS GovCloud Root CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2017-05-19T22:29:11Z/2022-05-18T22:29:11Z
- * F = A3:61:F9:C9:A2:5B:91:FE:73:A6:52:E3:59:14:8E:CE:35:12:0F:FD
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDjCCAvagAwIBAgIJAMM61RQn3/kdMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD\n'
- + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
- + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
- + 'em9uIFJEUzEkMCIGA1UEAwwbQW1hem9uIFJEUyBHb3ZDbG91ZCBSb290IENBMB4X\n'
- + 'DTE3MDUxOTIyMjkxMVoXDTIyMDUxODIyMjkxMVowgZMxCzAJBgNVBAYTAlVTMRAw\n'
- + 'DgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQKDBlB\n'
- + 'bWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSQw\n'
- + 'IgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwggEiMA0GCSqGSIb3\n'
- + 'DQEBAQUAA4IBDwAwggEKAoIBAQDGS9bh1FGiJPT+GRb3C5aKypJVDC1H2gbh6n3u\n'
- + 'j8cUiyMXfmm+ak402zdLpSYMaxiQ7oL/B3wEmumIpRDAsQrSp3B/qEeY7ipQGOfh\n'
- + 'q2TXjXGIUjiJ/FaoGqkymHRLG+XkNNBtb7MRItsjlMVNELXECwSiMa3nJL2/YyHW\n'
- + 'nTr1+11/weeZEKgVbCUrOugFkMXnfZIBSn40j6EnRlO2u/NFU5ksK5ak2+j8raZ7\n'
- + 'xW7VXp9S1Tgf1IsWHjGZZZguwCkkh1tHOlHC9gVA3p63WecjrIzcrR/V27atul4m\n'
- + 'tn56s5NwFvYPUIx1dbC8IajLUrepVm6XOwdQCfd02DmOyjWJAgMBAAGjYzBhMA4G\n'
- + 'A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRJEM+kuDUu\n'
- + 'ZTmCnA4wUrgnFaXc4zAfBgNVHSMEGDAWgBRJEM+kuDUuZTmCnA4wUrgnFaXc4zAN\n'
- + 'BgkqhkiG9w0BAQsFAAOCAQEAcfA7uirXsNZyI2j4AJFVtOTKOZlQwqbyNducnmlg\n'
- + '/5nug9fAkwM4AgvF5bBOD1Hw6khdsccMwIj+1S7wpL+EYb/nSc8G0qe1p/9lZ/mZ\n'
- + 'ff5g4JOa26lLuCrZDqAk4TzYnt6sQKfa5ZXVUUn0BK3okhiXS0i+NloMyaBCL7vk\n'
- + 'kDwkHwEqflRKfZ9/oFTcCfoiHPA7AdBtaPVr0/Kj9L7k+ouz122huqG5KqX0Zpo8\n'
- + 'S0IGvcd2FZjNSNPttNAK7YuBVsZ0m2nIH1SLp//00v7yAHIgytQwwB17PBcp4NXD\n'
- + 'pCfTa27ng9mMMC2YLqWQpW4TkqjDin2ZC+5X/mbrjzTvVg==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-east-1 certificate CA 2019 to 2022
- *
- * CN = Amazon RDS ap-east-1 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-02-17T02:47:00Z/2022-06-01T12:00:00Z
- * F = BC:F8:70:75:1F:93:3F:A7:82:86:67:63:A8:86:1F:A4:E8:07:CE:06
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSUwIwYDVQQDDBxBbWF6b24gUkRTIGFwLWVhc3QtMSBSb290IENBMB4XDTE5MDIx\n'
- + 'NzAyNDcwMFoXDTIyMDYwMTEyMDAwMFowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQI\n'
- + 'DApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMSIwIAYDVQQKDBlBbWF6b24g\n'
- + 'V2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSAwHgYDVQQD\n'
- + 'DBdBbWF6b24gUkRTIGFwLWVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBAOcJAUofyJuBuPr5ISHi/Ha5ed8h3eGdzn4MBp6rytPOg9NVGRQs\n'
- + 'O93fNGCIKsUT6gPuk+1f1ncMTV8Y0Fdf4aqGWme+Khm3ZOP3V1IiGnVq0U2xiOmn\n'
- + 'SQ4Q7LoeQC4lC6zpoCHVJyDjZ4pAknQQfsXb77Togdt/tK5ahev0D+Q3gCwAoBoO\n'
- + 'DHKJ6t820qPi63AeGbJrsfNjLKiXlFPDUj4BGir4dUzjEeH7/hx37na1XG/3EcxP\n'
- + '399cT5k7sY/CR9kctMlUyEEUNQOmhi/ly1Lgtihm3QfjL6K9aGLFNwX35Bkh9aL2\n'
- + 'F058u+n8DP/dPeKUAcJKiQZUmzuen5n57x8CAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFlqgF4FQlb9yP6c+Q3E\n'
- + 'O3tXv+zOMB8GA1UdIwQYMBaAFK9T6sY/PBZVbnHcNcQXf58P4OuPMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQDeXiS3v1z4jWAo1UvVyKDeHjtrtEH1Rida1eOXauFuEQa5tuOk\n'
- + 'E53Os4haZCW4mOlKjigWs4LN+uLIAe1aFXGo92nGIqyJISHJ1L+bopx/JmIbHMCZ\n'
- + '0lTNJfR12yBma5VQy7vzeFku/SisKwX0Lov1oHD4MVhJoHbUJYkmAjxorcIHORvh\n'
- + 'I3Vj5XrgDWtLDPL8/Id/roul/L+WX5ir+PGScKBfQIIN2lWdZoqdsx8YWqhm/ikL\n'
- + 'C6qNieSwcvWL7C03ri0DefTQMY54r5wP33QU5hJ71JoaZI3YTeT0Nf+NRL4hM++w\n'
- + 'Q0veeNzBQXg1f/JxfeA39IDIX1kiCf71tGlT\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-northeast-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-18T16:56:20Z/2024-08-22T17:08:50Z
- * F = 47:A3:F9:20:64:5C:9F:9D:48:8C:7D:E6:0B:86:D6:05:13:00:16:A1
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDDCCAvSgAwIBAgICcEUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNjU2\n'
- + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
- + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
- + 'AAOCAQ8AMIIBCgKCAQEAndtkldmHtk4TVQAyqhAvtEHSMb6pLhyKrIFved1WO3S7\n'
- + '+I+bWwv9b2W/ljJxLq9kdT43bhvzonNtI4a1LAohS6bqyirmk8sFfsWT3akb+4Sx\n'
- + '1sjc8Ovc9eqIWJCrUiSvv7+cS7ZTA9AgM1PxvHcsqrcUXiK3Jd/Dax9jdZE1e15s\n'
- + 'BEhb2OEPE+tClFZ+soj8h8Pl2Clo5OAppEzYI4LmFKtp1X/BOf62k4jviXuCSst3\n'
- + 'UnRJzE/CXtjmN6oZySVWSe0rQYuyqRl6//9nK40cfGKyxVnimB8XrrcxUN743Vud\n'
- + 'QQVU0Esm8OVTX013mXWQXJHP2c0aKkog8LOga0vobQIDAQABo2YwZDAOBgNVHQ8B\n'
- + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQULmoOS1mFSjj+\n'
- + 'snUPx4DgS3SkLFYwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
- + 'KoZIhvcNAQELBQADggEBAAkVL2P1M2/G9GM3DANVAqYOwmX0Xk58YBHQu6iiQg4j\n'
- + 'b4Ky/qsZIsgT7YBsZA4AOcPKQFgGTWhe9pvhmXqoN3RYltN8Vn7TbUm/ZVDoMsrM\n'
- + 'gwv0+TKxW1/u7s8cXYfHPiTzVSJuOogHx99kBW6b2f99GbP7O1Sv3sLq4j6lVvBX\n'
- + 'Fiacf5LAWC925nvlTzLlBgIc3O9xDtFeAGtZcEtxZJ4fnGXiqEnN4539+nqzIyYq\n'
- + 'nvlgCzyvcfRAxwltrJHuuRu6Maw5AGcd2Y0saMhqOVq9KYKFKuD/927BTrbd2JVf\n'
- + '2sGWyuPZPCk3gq+5pCjbD0c6DkhcMGI6WwxvM5V/zSM=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-2 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-northeast-2 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-10T17:46:21Z/2024-08-22T17:08:50Z
- * F = 8E:1C:70:C1:64:BD:FC:F9:93:9B:A2:67:CA:CF:52:F0:E1:F7:B4:F0
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDDCCAvSgAwIBAgICOFAwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAxNzQ2\n'
- + 'MjFaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
- + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
- + 'AAOCAQ8AMIIBCgKCAQEAzU72e6XbaJbi4HjJoRNjKxzUEuChKQIt7k3CWzNnmjc5\n'
- + '8I1MjCpa2W1iw1BYVysXSNSsLOtUsfvBZxi/1uyMn5ZCaf9aeoA9UsSkFSZBjOCN\n'
- + 'DpKPCmfV1zcEOvJz26+1m8WDg+8Oa60QV0ou2AU1tYcw98fOQjcAES0JXXB80P2s\n'
- + '3UfkNcnDz+l4k7j4SllhFPhH6BQ4lD2NiFAP4HwoG6FeJUn45EPjzrydxjq6v5Fc\n'
- + 'cQ8rGuHADVXotDbEhaYhNjIrsPL+puhjWfhJjheEw8c4whRZNp6gJ/b6WEes/ZhZ\n'
- + 'h32DwsDsZw0BfRDUMgUn8TdecNexHUw8vQWeC181hwIDAQABo2YwZDAOBgNVHQ8B\n'
- + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwW9bWgkWkr0U\n'
- + 'lrOsq2kvIdrECDgwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
- + 'KoZIhvcNAQELBQADggEBAEugF0Gj7HVhX0ehPZoGRYRt3PBuI2YjfrrJRTZ9X5wc\n'
- + '9T8oHmw07mHmNy1qqWvooNJg09bDGfB0k5goC2emDiIiGfc/kvMLI7u+eQOoMKj6\n'
- + 'mkfCncyRN3ty08Po45vTLBFZGUvtQmjM6yKewc4sXiASSBmQUpsMbiHRCL72M5qV\n'
- + 'obcJOjGcIdDTmV1BHdWT+XcjynsGjUqOvQWWhhLPrn4jWe6Xuxll75qlrpn3IrIx\n'
- + 'CRBv/5r7qbcQJPOgwQsyK4kv9Ly8g7YT1/vYBlR3cRsYQjccw5ceWUj2DrMVWhJ4\n'
- + 'prf+E3Aa4vYmLLOUUvKnDQ1k3RGNu56V0tonsQbfsaM=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-northeast-3 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-northeast-3 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-17T20:05:29Z/2024-08-22T17:08:50Z
- * F = D1:08:B1:40:6D:6C:80:8E:F4:C1:2C:8A:1F:66:17:01:54:CD:1A:4E
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDDCCAvSgAwIBAgICOYIwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTcyMDA1\n'
- + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
- + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMyAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
- + 'AAOCAQ8AMIIBCgKCAQEA4dMak8W+XW8y/2F6nRiytFiA4XLwePadqWebGtlIgyCS\n'
- + 'kbug8Jv5w7nlMkuxOxoUeD4WhI6A9EkAn3r0REM/2f0aYnd2KPxeqS2MrtdxxHw1\n'
- + 'xoOxk2x0piNSlOz6yog1idsKR5Wurf94fvM9FdTrMYPPrDabbGqiBMsZZmoHLvA3\n'
- + 'Z+57HEV2tU0Ei3vWeGIqnNjIekS+E06KhASxrkNU5vi611UsnYZlSi0VtJsH4UGV\n'
- + 'LhnHl53aZL0YFO5mn/fzuNG/51qgk/6EFMMhaWInXX49Dia9FnnuWXwVwi6uX1Wn\n'
- + '7kjoHi5VtmC8ZlGEHroxX2DxEr6bhJTEpcLMnoQMqwIDAQABo2YwZDAOBgNVHQ8B\n'
- + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUsUI5Cb3SWB8+\n'
- + 'gv1YLN/ABPMdxSAwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
- + 'KoZIhvcNAQELBQADggEBAJAF3E9PM1uzVL8YNdzb6fwJrxxqI2shvaMVmC1mXS+w\n'
- + 'G0zh4v2hBZOf91l1EO0rwFD7+fxoI6hzQfMxIczh875T6vUXePKVOCOKI5wCrDad\n'
- + 'zQbVqbFbdhsBjF4aUilOdtw2qjjs9JwPuB0VXN4/jY7m21oKEOcnpe36+7OiSPjN\n'
- + 'xngYewCXKrSRqoj3mw+0w/+exYj3Wsush7uFssX18av78G+ehKPIVDXptOCP/N7W\n'
- + '8iKVNeQ2QGTnu2fzWsGUSvMGyM7yqT+h1ILaT//yQS8er511aHMLc142bD4D9VSy\n'
- + 'DgactwPDTShK/PXqhvNey9v/sKXm4XatZvwcc8KYlW4=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-south-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-south-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-04T17:13:04Z/2024-08-22T17:08:50Z
- * F = D6:AD:45:A9:54:36:E4:BA:9C:B7:9B:06:8C:0C:CD:CC:1E:81:B5:00
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECDCCAvCgAwIBAgICVIYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDQxNzEz\n'
- + 'MDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h\n'
- + 'em9uIFJEUyBhcC1zb3V0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
- + 'DwAwggEKAoIBAQDUYOz1hGL42yUCrcsMSOoU8AeD/3KgZ4q7gP+vAz1WnY9K/kim\n'
- + 'eWN/2Qqzlo3+mxSFQFyD4MyV3+CnCPnBl9Sh1G/F6kThNiJ7dEWSWBQGAB6HMDbC\n'
- + 'BaAsmUc1UIz8sLTL3fO+S9wYhA63Wun0Fbm/Rn2yk/4WnJAaMZcEtYf6e0KNa0LM\n'
- + 'p/kN/70/8cD3iz3dDR8zOZFpHoCtf0ek80QqTich0A9n3JLxR6g6tpwoYviVg89e\n'
- + 'qCjQ4axxOkWWeusLeTJCcY6CkVyFvDAKvcUl1ytM5AiaUkXblE7zDFXRM4qMMRdt\n'
- + 'lPm8d3pFxh0fRYk8bIKnpmtOpz3RIctDrZZxAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
- + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBT99wKJftD3jb4sHoHG\n'
- + 'i3uGlH6W6TAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
- + '9w0BAQsFAAOCAQEAZ17hhr3dII3hUfuHQ1hPWGrpJOX/G9dLzkprEIcCidkmRYl+\n'
- + 'hu1Pe3caRMh/17+qsoEErmnVq5jNY9X1GZL04IZH8YbHc7iRHw3HcWAdhN8633+K\n'
- + 'jYEB2LbJ3vluCGnCejq9djDb6alOugdLMJzxOkHDhMZ6/gYbECOot+ph1tQuZXzD\n'
- + 'tZ7prRsrcuPBChHlPjmGy8M9z8u+kF196iNSUGC4lM8vLkHM7ycc1/ZOwRq9aaTe\n'
- + 'iOghbQQyAEe03MWCyDGtSmDfr0qEk+CHN+6hPiaL8qKt4s+V9P7DeK4iW08ny8Ox\n'
- + 'AVS7u0OK/5+jKMAMrKwpYrBydOjTUTHScocyNw==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-southeast-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-southeast-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-13T20:11:42Z/2024-08-22T17:08:50Z
- * F = 0D:20:FB:91:DE:BE:D2:CF:F3:F8:F8:43:AF:68:C6:03:76:F3:DD:B8
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDDCCAvSgAwIBAgICY4kwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTMyMDEx\n'
- + 'NDJaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
- + 'em9uIFJEUyBhcC1zb3V0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
- + 'AAOCAQ8AMIIBCgKCAQEAr5u9OuLL/OF/fBNUX2kINJLzFl4DnmrhnLuSeSnBPgbb\n'
- + 'qddjf5EFFJBfv7IYiIWEFPDbDG5hoBwgMup5bZDbas+ZTJTotnnxVJTQ6wlhTmns\n'
- + 'eHECcg2pqGIKGrxZfbQhlj08/4nNAPvyYCTS0bEcmQ1emuDPyvJBYDDLDU6AbCB5\n'
- + '6Z7YKFQPTiCBblvvNzchjLWF9IpkqiTsPHiEt21sAdABxj9ityStV3ja/W9BfgxH\n'
- + 'wzABSTAQT6FbDwmQMo7dcFOPRX+hewQSic2Rn1XYjmNYzgEHisdUsH7eeXREAcTw\n'
- + '61TRvaLH8AiOWBnTEJXPAe6wYfrcSd1pD0MXpoB62wIDAQABo2YwZDAOBgNVHQ8B\n'
- + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUytwMiomQOgX5\n'
- + 'Ichd+2lDWRUhkikwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
- + 'KoZIhvcNAQELBQADggEBACf6lRDpfCD7BFRqiWM45hqIzffIaysmVfr+Jr+fBTjP\n'
- + 'uYe/ba1omSrNGG23bOcT9LJ8hkQJ9d+FxUwYyICQNWOy6ejicm4z0C3VhphbTPqj\n'
- + 'yjpt9nG56IAcV8BcRJh4o/2IfLNzC/dVuYJV8wj7XzwlvjysenwdrJCoLadkTr1h\n'
- + 'eIdG6Le07sB9IxrGJL9e04afk37h7c8ESGSE4E+oS4JQEi3ATq8ne1B9DQ9SasXi\n'
- + 'IRmhNAaISDzOPdyLXi9N9V9Lwe/DHcja7hgLGYx3UqfjhLhOKwp8HtoZORixAmOI\n'
- + 'HfILgNmwyugAbuZoCazSKKBhQ0wgO0WZ66ZKTMG8Oho=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ap-southeast-2 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ap-southeast-2 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-16T19:53:47Z/2024-08-22T17:08:50Z
- * F = D5:D4:51:83:D9:A3:AC:47:B0:0A:5A:77:D8:A0:79:A9:6A:3F:6D:96
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEDDCCAvSgAwIBAgICEkYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxOTUz\n'
- + 'NDdaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
- + 'em9uIFJEUyBhcC1zb3V0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
- + 'AAOCAQ8AMIIBCgKCAQEAufodI2Flker8q7PXZG0P0vmFSlhQDw907A6eJuF/WeMo\n'
- + 'GHnll3b4S6nC3oRS3nGeRMHbyU2KKXDwXNb3Mheu+ox+n5eb/BJ17eoj9HbQR1cd\n'
- + 'gEkIciiAltf8gpMMQH4anP7TD+HNFlZnP7ii3geEJB2GGXSxgSWvUzH4etL67Zmn\n'
- + 'TpGDWQMB0T8lK2ziLCMF4XAC/8xDELN/buHCNuhDpxpPebhct0T+f6Arzsiswt2j\n'
- + '7OeNeLLZwIZvVwAKF7zUFjC6m7/VmTQC8nidVY559D6l0UhhU0Co/txgq3HVsMOH\n'
- + 'PbxmQUwJEKAzQXoIi+4uZzHFZrvov/nDTNJUhC6DqwIDAQABo2YwZDAOBgNVHQ8B\n'
- + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwaZpaCme+EiV\n'
- + 'M5gcjeHZSTgOn4owHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
- + 'KoZIhvcNAQELBQADggEBAAR6a2meCZuXO2TF9bGqKGtZmaah4pH2ETcEVUjkvXVz\n'
- + 'sl+ZKbYjrun+VkcMGGKLUjS812e7eDF726ptoku9/PZZIxlJB0isC/0OyixI8N4M\n'
- + 'NsEyvp52XN9QundTjkl362bomPnHAApeU0mRbMDRR2JdT70u6yAzGLGsUwMkoNnw\n'
- + '1VR4XKhXHYGWo7KMvFrZ1KcjWhubxLHxZWXRulPVtGmyWg/MvE6KF+2XMLhojhUL\n'
- + '+9jB3Fpn53s6KMx5tVq1x8PukHmowcZuAF8k+W4gk8Y68wIwynrdZrKRyRv6CVtR\n'
- + 'FZ8DeJgoNZT3y/GT254VqMxxfuy2Ccb/RInd16tEvVk=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS ca-central-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS ca-central-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-10T20:52:25Z/2024-08-22T17:08:50Z
- * F = A1:03:46:F2:BB:29:BF:4F:EC:04:7E:82:9A:A6:C0:11:4D:AB:82:25
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECjCCAvKgAwIBAgICEzUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAyMDUy\n'
- + 'MjVaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h\n'
- + 'em9uIFJEUyBjYS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
- + 'ggEPADCCAQoCggEBAOxHqdcPSA2uBjsCP4DLSlqSoPuQ/X1kkJLusVRKiQE2zayB\n'
- + 'viuCBt4VB9Qsh2rW3iYGM+usDjltGnI1iUWA5KHcvHszSMkWAOYWLiMNKTlg6LCp\n'
- + 'XnE89tvj5dIH6U8WlDvXLdjB/h30gW9JEX7S8supsBSci2GxEzb5mRdKaDuuF/0O\n'
- + 'qvz4YE04pua3iZ9QwmMFuTAOYzD1M72aOpj+7Ac+YLMM61qOtU+AU6MndnQkKoQi\n'
- + 'qmUN2A9IFaqHFzRlSdXwKCKUA4otzmz+/N3vFwjb5F4DSsbsrMfjeHMo6o/nb6Nh\n'
- + 'YDb0VJxxPee6TxSuN7CQJ2FxMlFUezcoXqwqXD0CAwEAAaNmMGQwDgYDVR0PAQH/\n'
- + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFDGGpon9WfIpsggE\n'
- + 'CxHq8hZ7E2ESMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG\n'
- + 'SIb3DQEBCwUAA4IBAQAvpeQYEGZvoTVLgV9rd2+StPYykMsmFjWQcyn3dBTZRXC2\n'
- + 'lKq7QhQczMAOhEaaN29ZprjQzsA2X/UauKzLR2Uyqc2qOeO9/YOl0H3qauo8C/W9\n'
- + 'r8xqPbOCDLEXlOQ19fidXyyEPHEq5WFp8j+fTh+s8WOx2M7IuC0ANEetIZURYhSp\n'
- + 'xl9XOPRCJxOhj7JdelhpweX0BJDNHeUFi0ClnFOws8oKQ7sQEv66d5ddxqqZ3NVv\n'
- + 'RbCvCtEutQMOUMIuaygDlMn1anSM8N7Wndx8G6+Uy67AnhjGx7jw/0YPPxopEj6x\n'
- + 'JXP8j0sJbcT9K/9/fPVLNT25RvQ/93T2+IQL4Ca2\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-central-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS eu-central-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-11T19:36:20Z/2024-08-22T17:08:50Z
- * F = 53:46:18:4A:42:65:A2:8C:5F:5B:0A:AD:E2:2C:80:E5:E6:8A:6D:2F
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECjCCAvKgAwIBAgICV2YwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExOTM2\n'
- + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h\n'
- + 'em9uIFJEUyBldS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
- + 'ggEPADCCAQoCggEBAMEx54X2pHVv86APA0RWqxxRNmdkhAyp2R1cFWumKQRofoFv\n'
- + 'n+SPXdkpIINpMuEIGJANozdiEz7SPsrAf8WHyD93j/ZxrdQftRcIGH41xasetKGl\n'
- + 'I67uans8d+pgJgBKGb/Z+B5m+UsIuEVekpvgpwKtmmaLFC/NCGuSsJoFsRqoa6Gh\n'
- + 'm34W6yJoY87UatddCqLY4IIXaBFsgK9Q/wYzYLbnWM6ZZvhJ52VMtdhcdzeTHNW0\n'
- + '5LGuXJOF7Ahb4JkEhoo6TS2c0NxB4l4MBfBPgti+O7WjR3FfZHpt18A6Zkq6A2u6\n'
- + 'D/oTSL6c9/3sAaFTFgMyL3wHb2YlW0BPiljZIqECAwEAAaNmMGQwDgYDVR0PAQH/\n'
- + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFOcAToAc6skWffJa\n'
- + 'TnreaswAfrbcMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG\n'
- + 'SIb3DQEBCwUAA4IBAQA1d0Whc1QtspK496mFWfFEQNegLh0a9GWYlJm+Htcj5Nxt\n'
- + 'DAIGXb+8xrtOZFHmYP7VLCT5Zd2C+XytqseK/+s07iAr0/EPF+O2qcyQWMN5KhgE\n'
- + 'cXw2SwuP9FPV3i+YAm11PBVeenrmzuk9NrdHQ7TxU4v7VGhcsd2C++0EisrmquWH\n'
- + 'mgIfmVDGxphwoES52cY6t3fbnXmTkvENvR+h3rj+fUiSz0aSo+XZUGHPgvuEKM/W\n'
- + 'CBD9Smc9CBoBgvy7BgHRgRUmwtABZHFUIEjHI5rIr7ZvYn+6A0O6sogRfvVYtWFc\n'
- + 'qpyrW1YX8mD0VlJ8fGKM3G+aCOsiiPKDV/Uafrm+\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-north-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS eu-north-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-12T18:19:44Z/2024-08-22T17:08:50Z
- * F = D0:CA:9C:6E:47:4C:4F:DB:85:28:03:4A:60:AC:14:E0:E6:DF:D4:42
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECDCCAvCgAwIBAgICGAcwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIxODE5\n'
- + 'NDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h\n'
- + 'em9uIFJEUyBldS1ub3J0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
- + 'DwAwggEKAoIBAQCiIYnhe4UNBbdBb/nQxl5giM0XoVHWNrYV5nB0YukA98+TPn9v\n'
- + 'Aoj1RGYmtryjhrf01Kuv8SWO+Eom95L3zquoTFcE2gmxCfk7bp6qJJ3eHOJB+QUO\n'
- + 'XsNRh76fwDzEF1yTeZWH49oeL2xO13EAx4PbZuZpZBttBM5zAxgZkqu4uWQczFEs\n'
- + 'JXfla7z2fvWmGcTagX10O5C18XaFroV0ubvSyIi75ue9ykg/nlFAeB7O0Wxae88e\n'
- + 'uhiBEFAuLYdqWnsg3459NfV8Yi1GnaitTym6VI3tHKIFiUvkSiy0DAlAGV2iiyJE\n'
- + 'q+DsVEO4/hSINJEtII4TMtysOsYPpINqeEzRAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
- + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRR0UpnbQyjnHChgmOc\n'
- + 'hnlc0PogzTAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
- + '9w0BAQsFAAOCAQEAKJD4xVzSf4zSGTBJrmamo86jl1NHQxXUApAZuBZEc8tqC6TI\n'
- + 'T5CeoSr9CMuVC8grYyBjXblC4OsM5NMvmsrXl/u5C9dEwtBFjo8mm53rOOIm1fxl\n'
- + 'I1oYB/9mtO9ANWjkykuLzWeBlqDT/i7ckaKwalhLODsRDO73vRhYNjsIUGloNsKe\n'
- + 'pxw3dzHwAZx4upSdEVG4RGCZ1D0LJ4Gw40OfD69hfkDfRVVxKGrbEzqxXRvovmDc\n'
- + 'tKLdYZO/6REoca36v4BlgIs1CbUXJGLSXUwtg7YXGLSVBJ/U0+22iGJmBSNcoyUN\n'
- + 'cjPFD9JQEhDDIYYKSGzIYpvslvGc4T5ISXFiuQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS eu-west-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-11T17:31:48Z/2024-08-22T17:08:50Z
- * F = 2D:1A:A6:3E:0D:EB:D6:26:03:3E:A1:8A:0A:DF:14:80:78:EC:B6:63
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICYpgwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExNzMx\n'
- + 'NDhaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyBldS13ZXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBAMk3YdSZ64iAYp6MyyKtYJtNzv7zFSnnNf6vv0FB4VnfITTMmOyZ\n'
- + 'LXqKAT2ahZ00hXi34ewqJElgU6eUZT/QlzdIu359TEZyLVPwURflL6SWgdG01Q5X\n'
- + 'O++7fSGcBRyIeuQWs9FJNIIqK8daF6qw0Rl5TXfu7P9dBc3zkgDXZm2DHmxGDD69\n'
- + '7liQUiXzoE1q2Z9cA8+jirDioJxN9av8hQt12pskLQumhlArsMIhjhHRgF03HOh5\n'
- + 'tvi+RCfihVOxELyIRTRpTNiIwAqfZxxTWFTgfn+gijTmd0/1DseAe82aYic8JbuS\n'
- + 'EMbrDduAWsqrnJ4GPzxHKLXX0JasCUcWyMECAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPLtsq1NrwJXO13C9eHt\n'
- + 'sLY11AGwMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQAnWBKj5xV1A1mYd0kIgDdkjCwQkiKF5bjIbGkT3YEFFbXoJlSP\n'
- + '0lZZ/hDaOHI8wbLT44SzOvPEEmWF9EE7SJzkvSdQrUAWR9FwDLaU427ALI3ngNHy\n'
- + 'lGJ2hse1fvSRNbmg8Sc9GBv8oqNIBPVuw+AJzHTacZ1OkyLZrz1c1QvwvwN2a+Jd\n'
- + 'vH0V0YIhv66llKcYDMUQJAQi4+8nbRxXWv6Gq3pvrFoorzsnkr42V3JpbhnYiK+9\n'
- + 'nRKd4uWl62KRZjGkfMbmsqZpj2fdSWMY1UGyN1k+kDmCSWYdrTRDP0xjtIocwg+A\n'
- + 'J116n4hV/5mbA0BaPiS2krtv17YAeHABZcvz\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-2 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS eu-west-2 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-12T21:32:32Z/2024-08-22T17:08:50Z
- * F = 60:65:44:F4:74:6E:2E:29:50:19:38:7C:4B:BE:18:B9:5B:D4:CD:23
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICZIEwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIyMTMy\n'
- + 'MzJaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyBldS13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBALGiwqjiF7xIjT0Sx7zB3764K2T2a1DHnAxEOr+/EIftWKxWzT3u\n'
- + 'PFwS2eEZcnKqSdRQ+vRzonLBeNLO4z8aLjQnNbkizZMBuXGm4BqRm1Kgq3nlLDQn\n'
- + '7YqdijOq54SpShvR/8zsO4sgMDMmHIYAJJOJqBdaus2smRt0NobIKc0liy7759KB\n'
- + '6kmQ47Gg+kfIwxrQA5zlvPLeQImxSoPi9LdbRoKvu7Iot7SOa+jGhVBh3VdqndJX\n'
- + '7tm/saj4NE375csmMETFLAOXjat7zViMRwVorX4V6AzEg1vkzxXpA9N7qywWIT5Y\n'
- + 'fYaq5M8i6vvLg0CzrH9fHORtnkdjdu1y+0MCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFOhOx1yt3Z7mvGB9jBv\n'
- + '2ymdZwiOMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQBehqY36UGDvPVU9+vtaYGr38dBbp+LzkjZzHwKT1XJSSUc2wqM\n'
- + 'hnCIQKilonrTIvP1vmkQi8qHPvDRtBZKqvz/AErW/ZwQdZzqYNFd+BmOXaeZWV0Q\n'
- + 'oHtDzXmcwtP8aUQpxN0e1xkWb1E80qoy+0uuRqb/50b/R4Q5qqSfJhkn6z8nwB10\n'
- + '7RjLtJPrK8igxdpr3tGUzfAOyiPrIDncY7UJaL84GFp7WWAkH0WG3H8Y8DRcRXOU\n'
- + 'mqDxDLUP3rNuow3jnGxiUY+gGX5OqaZg4f4P6QzOSmeQYs6nLpH0PiN00+oS1BbD\n'
- + 'bpWdZEttILPI+vAYkU4QuBKKDjJL6HbSd+cn\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS eu-west-3 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS eu-west-3 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-18T17:03:15Z/2024-08-22T17:08:50Z
- * F = 6F:79:56:B0:74:9C:C6:3E:3B:50:26:C8:51:55:08:F0:BB:7E:32:04
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICJDQwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNzAz\n'
- + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyBldS13ZXN0LTMgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBAL9bL7KE0n02DLVtlZ2PL+g/BuHpMYFq2JnE2RgompGurDIZdjmh\n'
- + '1pxfL3nT+QIVMubuAOy8InRfkRxfpxyjKYdfLJTPJG+jDVL+wDcPpACFVqoV7Prg\n'
- + 'pVYEV0lc5aoYw4bSeYFhdzgim6F8iyjoPnObjll9mo4XsHzSoqJLCd0QC+VG9Fw2\n'
- + 'q+GDRZrLRmVM2oNGDRbGpGIFg77aRxRapFZa8SnUgs2AqzuzKiprVH5i0S0M6dWr\n'
- + 'i+kk5epmTtkiDHceX+dP/0R1NcnkCPoQ9TglyXyPdUdTPPRfKCq12dftqll+u4mV\n'
- + 'ARdN6WFjovxax8EAP2OAUTi1afY+1JFMj+sCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLfhrbrO5exkCVgxW0x3\n'
- + 'Y2mAi8lNMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQAigQ5VBNGyw+OZFXwxeJEAUYaXVoP/qrhTOJ6mCE2DXUVEoJeV\n'
- + 'SxScy/TlFA9tJXqmit8JH8VQ/xDL4ubBfeMFAIAo4WzNWDVoeVMqphVEcDWBHsI1\n'
- + 'AETWzfsapRS9yQekOMmxg63d/nV8xewIl8aNVTHdHYXMqhhik47VrmaVEok1UQb3\n'
- + 'O971RadLXIEbVd9tjY5bMEHm89JsZDnDEw1hQXBb67Elu64OOxoKaHBgUH8AZn/2\n'
- + 'zFsL1ynNUjOhCSAA15pgd1vjwc0YsBbAEBPcHBWYBEyME6NLNarjOzBl4FMtATSF\n'
- + 'wWCKRGkvqN8oxYhwR2jf2rR5Mu4DWkK5Q8Ep\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS me-south-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS me-south-1 Root CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-05-10T21:48:27Z/2024-05-08T21:48:27Z
- * F = 8A:69:D7:00:FB:5D:62:9C:B0:D1:75:6F:B7:B6:38:AA:76:C4:BD:1F
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEEjCCAvqgAwIBAgIJANew34ehz5l8MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD\n'
- + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
- + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
- + 'em9uIFJEUzEmMCQGA1UEAwwdQW1hem9uIFJEUyBtZS1zb3V0aC0xIFJvb3QgQ0Ew\n'
- + 'HhcNMTkwNTEwMjE0ODI3WhcNMjQwNTA4MjE0ODI3WjCBlTELMAkGA1UEBhMCVVMx\n'
- + 'EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoM\n'
- + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
- + 'JjAkBgNVBAMMHUFtYXpvbiBSRFMgbWUtc291dGgtMSBSb290IENBMIIBIjANBgkq\n'
- + 'hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp7BYV88MukcY+rq0r79+C8UzkT30fEfT\n'
- + 'aPXbx1d6M7uheGN4FMaoYmL+JE1NZPaMRIPTHhFtLSdPccInvenRDIatcXX+jgOk\n'
- + 'UA6lnHQ98pwN0pfDUyz/Vph4jBR9LcVkBbe0zdoKKp+HGbMPRU0N2yNrog9gM5O8\n'
- + 'gkU/3O2csJ/OFQNnj4c2NQloGMUpEmedwJMOyQQfcUyt9CvZDfIPNnheUS29jGSw\n'
- + 'ERpJe/AENu8Pxyc72jaXQuD+FEi2Ck6lBkSlWYQFhTottAeGvVFNCzKszCntrtqd\n'
- + 'rdYUwurYsLTXDHv9nW2hfDUQa0mhXf9gNDOBIVAZugR9NqNRNyYLHQIDAQABo2Mw\n'
- + 'YTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU54cf\n'
- + 'DjgwBx4ycBH8+/r8WXdaiqYwHwYDVR0jBBgwFoAU54cfDjgwBx4ycBH8+/r8WXda\n'
- + 'iqYwDQYJKoZIhvcNAQELBQADggEBAIIMTSPx/dR7jlcxggr+O6OyY49Rlap2laKA\n'
- + 'eC/XI4ySP3vQkIFlP822U9Kh8a9s46eR0uiwV4AGLabcu0iKYfXjPkIprVCqeXV7\n'
- + 'ny9oDtrbflyj7NcGdZLvuzSwgl9SYTJp7PVCZtZutsPYlbJrBPHwFABvAkMvRtDB\n'
- + 'hitIg4AESDGPoCl94sYHpfDfjpUDMSrAMDUyO6DyBdZH5ryRMAs3lGtsmkkNUrso\n'
- + 'aTW6R05681Z0mvkRdb+cdXtKOSuDZPoe2wJJIaz3IlNQNSrB5TImMYgmt6iAsFhv\n'
- + '3vfTSTKrZDNTJn4ybG6pq1zWExoXsktZPylJly6R3RBwV6nwqBM=\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS sa-east-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS sa-east-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-05T18:46:29Z/2024-08-22T17:08:50Z
- * F = 8C:34:0F:AA:FB:10:80:9C:05:CE:D7:BF:0B:12:4D:07:42:39:74:7A
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICQ2QwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDUxODQ2\n'
- + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyBzYS1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBAMMvR+ReRnOzqJzoaPipNTt1Z2VA968jlN1+SYKUrYM3No+Vpz0H\n'
- + 'M6Tn0oYB66ByVsXiGc28ulsqX1HbHsxqDPwvQTKvO7SrmDokoAkjJgLocOLUAeld\n'
- + '5AwvUjxGRP6yY90NV7X786MpnYb2Il9DIIaV9HjCmPt+rjy2CZjS0UjPjCKNfB8J\n'
- + 'bFjgW6GGscjeyGb/zFwcom5p4j0rLydbNaOr9wOyQrtt3ZQWLYGY9Zees/b8pmcc\n'
- + 'Jt+7jstZ2UMV32OO/kIsJ4rMUn2r/uxccPwAc1IDeRSSxOrnFKhW3Cu69iB3bHp7\n'
- + 'JbawY12g7zshE4I14sHjv3QoXASoXjx4xgMCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFI1Fc/Ql2jx+oJPgBVYq\n'
- + 'ccgP0pQ8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQB4VVVabVp70myuYuZ3vltQIWqSUMhkaTzehMgGcHjMf9iLoZ/I\n'
- + '93KiFUSGnek5cRePyS9wcpp0fcBT3FvkjpUdCjVtdttJgZFhBxgTd8y26ImdDDMR\n'
- + '4+BUuhI5msvjL08f+Vkkpu1GQcGmyFVPFOy/UY8iefu+QyUuiBUnUuEDd49Hw0Fn\n'
- + '/kIPII6Vj82a2mWV/Q8e+rgN8dIRksRjKI03DEoP8lhPlsOkhdwU6Uz9Vu6NOB2Q\n'
- + 'Ls1kbcxAc7cFSyRVJEhh12Sz9d0q/CQSTFsVJKOjSNQBQfVnLz1GwO/IieUEAr4C\n'
- + 'jkTntH0r1LX5b/GwN4R887LvjAEdTbg1his7\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-east-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS us-east-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-19T18:16:53Z/2024-08-22T17:08:50Z
- * F = F0:ED:82:3E:D1:44:47:BA:B5:57:FD:F3:E4:92:74:66:98:8C:1C:78
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICJVUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTkxODE2\n'
- + 'NTNaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyB1cy1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBAM3i/k2u6cqbMdcISGRvh+m+L0yaSIoOXjtpNEoIftAipTUYoMhL\n'
- + 'InXGlQBVA4shkekxp1N7HXe1Y/iMaPEyb3n+16pf3vdjKl7kaSkIhjdUz3oVUEYt\n'
- + 'i8Z/XeJJ9H2aEGuiZh3kHixQcZczn8cg3dA9aeeyLSEnTkl/npzLf//669Ammyhs\n'
- + 'XcAo58yvT0D4E0D/EEHf2N7HRX7j/TlyWvw/39SW0usiCrHPKDLxByLojxLdHzso\n'
- + 'QIp/S04m+eWn6rmD+uUiRteN1hI5ncQiA3wo4G37mHnUEKo6TtTUh+sd/ku6a8HK\n'
- + 'glMBcgqudDI90s1OpuIAWmuWpY//8xEG2YECAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPqhoWZcrVY9mU7tuemR\n'
- + 'RBnQIj1jMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQB6zOLZ+YINEs72heHIWlPZ8c6WY8MDU+Be5w1M+BK2kpcVhCUK\n'
- + 'PJO4nMXpgamEX8DIiaO7emsunwJzMSvavSPRnxXXTKIc0i/g1EbiDjnYX9d85DkC\n'
- + 'E1LaAUCmCZBVi9fIe0H2r9whIh4uLWZA41oMnJx/MOmo3XyMfQoWcqaSFlMqfZM4\n'
- + '0rNoB/tdHLNuV4eIdaw2mlHxdWDtF4oH+HFm+2cVBUVC1jXKrFv/euRVtsTT+A6i\n'
- + 'h2XBHKxQ1Y4HgAn0jACP2QSPEmuoQEIa57bEKEcZsBR8SDY6ZdTd2HLRIApcCOSF\n'
- + 'MRM8CKLeF658I0XgF8D5EsYoKPsA+74Z+jDH\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-east-2 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS us-east-2 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-13T17:06:41Z/2024-08-22T17:08:50Z
- * F = E9:FE:27:2A:A0:0F:CE:DF:AD:51:03:A6:94:F7:1F:6F:BD:1E:28:D3
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECDCCAvCgAwIBAgIDAIVCMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n'
- + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n'
- + 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n'
- + 'UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTEzMTcw\n'
- + 'NjQxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh\n'
- + 'c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg\n'
- + 'U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt\n'
- + 'YXpvbiBSRFMgdXMtZWFzdC0yIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
- + 'DwAwggEKAoIBAQDE+T2xYjUbxOp+pv+gRA3FO24+1zCWgXTDF1DHrh1lsPg5k7ht\n'
- + '2KPYzNc+Vg4E+jgPiW0BQnA6jStX5EqVh8BU60zELlxMNvpg4KumniMCZ3krtMUC\n'
- + 'au1NF9rM7HBh+O+DYMBLK5eSIVt6lZosOb7bCi3V6wMLA8YqWSWqabkxwN4w0vXI\n'
- + '8lu5uXXFRemHnlNf+yA/4YtN4uaAyd0ami9+klwdkZfkrDOaiy59haOeBGL8EB/c\n'
- + 'dbJJlguHH5CpCscs3RKtOOjEonXnKXldxarFdkMzi+aIIjQ8GyUOSAXHtQHb3gZ4\n'
- + 'nS6Ey0CMlwkB8vUObZU9fnjKJcL5QCQqOfwvAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
- + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBQUPuRHohPxx4VjykmH\n'
- + '6usGrLL1ETAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
- + '9w0BAQsFAAOCAQEAUdR9Vb3y33Yj6X6KGtuthZ08SwjImVQPtknzpajNE5jOJAh8\n'
- + 'quvQnU9nlnMO85fVDU1Dz3lLHGJ/YG1pt1Cqq2QQ200JcWCvBRgdvH6MjHoDQpqZ\n'
- + 'HvQ3vLgOGqCLNQKFuet9BdpsHzsctKvCVaeBqbGpeCtt3Hh/26tgx0rorPLw90A2\n'
- + 'V8QSkZJjlcKkLa58N5CMM8Xz8KLWg3MZeT4DmlUXVCukqK2RGuP2L+aME8dOxqNv\n'
- + 'OnOz1zrL5mR2iJoDpk8+VE/eBDmJX40IJk6jBjWoxAO/RXq+vBozuF5YHN1ujE92\n'
- + 'tO8HItgTp37XT8bJBAiAnt5mxw+NLSqtxk2QdQ==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-west-1 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS us-west-1 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-06T17:40:21Z/2024-08-22T17:08:50Z
- * F = 1C:9F:DF:84:E6:13:32:F3:91:12:2D:0D:A5:9A:16:5D:AC:DC:E8:93
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIECDCCAvCgAwIBAgIDAIkHMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n'
- + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n'
- + 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n'
- + 'UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTA2MTc0\n'
- + 'MDIxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh\n'
- + 'c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg\n'
- + 'U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt\n'
- + 'YXpvbiBSRFMgdXMtd2VzdC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
- + 'DwAwggEKAoIBAQDD2yzbbAl77OofTghDMEf624OvU0eS9O+lsdO0QlbfUfWa1Kd6\n'
- + '0WkgjkLZGfSRxEHMCnrv4UPBSK/Qwn6FTjkDLgemhqBtAnplN4VsoDL+BkRX4Wwq\n'
- + '/dSQJE2b+0hm9w9UMVGFDEq1TMotGGTD2B71eh9HEKzKhGzqiNeGsiX4VV+LJzdH\n'
- + 'uM23eGisNqmd4iJV0zcAZ+Gbh2zK6fqTOCvXtm7Idccv8vZZnyk1FiWl3NR4WAgK\n'
- + 'AkvWTIoFU3Mt7dIXKKClVmvssG8WHCkd3Xcb4FHy/G756UZcq67gMMTX/9fOFM/v\n'
- + 'l5C0+CHl33Yig1vIDZd+fXV1KZD84dEJfEvHAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
- + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBR+ap20kO/6A7pPxo3+\n'
- + 'T3CfqZpQWjAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
- + '9w0BAQsFAAOCAQEAHCJky2tPjPttlDM/RIqExupBkNrnSYnOK4kr9xJ3sl8UF2DA\n'
- + 'PAnYsjXp3rfcjN/k/FVOhxwzi3cXJF/2Tjj39Bm/OEfYTOJDNYtBwB0VVH4ffa/6\n'
- + 'tZl87jaIkrxJcreeeHqYMnIxeN0b/kliyA+a5L2Yb0VPjt9INq34QDc1v74FNZ17\n'
- + '4z8nr1nzg4xsOWu0Dbjo966lm4nOYIGBRGOKEkHZRZ4mEiMgr3YLkv8gSmeitx57\n'
- + 'Z6dVemNtUic/LVo5Iqw4n3TBS0iF2C1Q1xT/s3h+0SXZlfOWttzSluDvoMv5PvCd\n'
- + 'pFjNn+aXLAALoihL1MJSsxydtsLjOBro5eK0Vw==\n'
- + '-----END CERTIFICATE-----\n',
-
- /**
- * Amazon RDS us-west-2 certificate CA 2019 to 2024
- *
- * CN = Amazon RDS us-west-2 2019 CA
- * OU = Amazon RDS
- * O = Amazon Web Services, Inc.
- * L = Seattle
- * ST = Washington
- * C = US
- * P = 2019-09-16T18:21:15Z/2024-08-22T17:08:50Z
- * F = C8:DE:1D:13:AD:35:9B:3D:EA:18:2A:DC:B4:79:6D:22:47:75:3C:4A
- */
- '-----BEGIN CERTIFICATE-----\n'
- + 'MIIEBzCCAu+gAwIBAgICUYkwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
- + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
- + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
- + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxODIx\n'
- + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
- + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
- + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
- + 'em9uIFJEUyB1cy13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
- + 'ADCCAQoCggEBANCEZBZyu6yJQFZBJmSUZfSZd3Ui2gitczMKC4FLr0QzkbxY+cLa\n'
- + 'uVONIOrPt4Rwi+3h/UdnUg917xao3S53XDf1TDMFEYp4U8EFPXqCn/GXBIWlU86P\n'
- + 'PvBN+gzw3nS+aco7WXb+woTouvFVkk8FGU7J532llW8o/9ydQyDIMtdIkKTuMfho\n'
- + 'OiNHSaNc+QXQ32TgvM9A/6q7ksUoNXGCP8hDOkSZ/YOLiI5TcdLh/aWj00ziL5bj\n'
- + 'pvytiMZkilnc9dLY9QhRNr0vGqL0xjmWdoEXz9/OwjmCihHqJq+20MJPsvFm7D6a\n'
- + '2NKybR9U+ddrjb8/iyLOjURUZnj5O+2+OPcCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
- + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEBxMBdv81xuzqcK5TVu\n'
- + 'pHj+Aor8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
- + 'DQEBCwUAA4IBAQBZkfiVqGoJjBI37aTlLOSjLcjI75L5wBrwO39q+B4cwcmpj58P\n'
- + '3sivv+jhYfAGEbQnGRzjuFoyPzWnZ1DesRExX+wrmHsLLQbF2kVjLZhEJMHF9eB7\n'
- + 'GZlTPdTzHErcnuXkwA/OqyXMpj9aghcQFuhCNguEfnROY9sAoK2PTfnTz9NJHL+Q\n'
- + 'UpDLEJEUfc0GZMVWYhahc0x38ZnSY2SKacIPECQrTI0KpqZv/P+ijCEcMD9xmYEb\n'
- + 'jL4en+XKS1uJpw5fIU5Sj0MxhdGstH6S84iAE5J3GM3XHklGSFwwqPYvuTXvANH6\n'
- + 'uboynxRgSae59jIlAK6Jrr6GWMwQRbgcaAlW\n'
- + '-----END CERTIFICATE-----\n'
- ]
-};
-
-
-/***/ }),
-
-/***/ 81699:
-/***/ ((__unused_webpack_module, exports) => {
-
-/**
- * MySQL type constants
- *
- * Extracted from version 5.7.29
- *
- * !! Generated by generate-type-constants.js, do not modify by hand !!
- */
-
-exports.DECIMAL = 0;
-exports.TINY = 1;
-exports.SHORT = 2;
-exports.LONG = 3;
-exports.FLOAT = 4;
-exports.DOUBLE = 5;
-exports.NULL = 6;
-exports.TIMESTAMP = 7;
-exports.LONGLONG = 8;
-exports.INT24 = 9;
-exports.DATE = 10;
-exports.TIME = 11;
-exports.DATETIME = 12;
-exports.YEAR = 13;
-exports.NEWDATE = 14;
-exports.VARCHAR = 15;
-exports.BIT = 16;
-exports.TIMESTAMP2 = 17;
-exports.DATETIME2 = 18;
-exports.TIME2 = 19;
-exports.JSON = 245;
-exports.NEWDECIMAL = 246;
-exports.ENUM = 247;
-exports.SET = 248;
-exports.TINY_BLOB = 249;
-exports.MEDIUM_BLOB = 250;
-exports.LONG_BLOB = 251;
-exports.BLOB = 252;
-exports.VAR_STRING = 253;
-exports.STRING = 254;
-exports.GEOMETRY = 255;
-
-// Lookup-by-number table
-exports[0] = 'DECIMAL';
-exports[1] = 'TINY';
-exports[2] = 'SHORT';
-exports[3] = 'LONG';
-exports[4] = 'FLOAT';
-exports[5] = 'DOUBLE';
-exports[6] = 'NULL';
-exports[7] = 'TIMESTAMP';
-exports[8] = 'LONGLONG';
-exports[9] = 'INT24';
-exports[10] = 'DATE';
-exports[11] = 'TIME';
-exports[12] = 'DATETIME';
-exports[13] = 'YEAR';
-exports[14] = 'NEWDATE';
-exports[15] = 'VARCHAR';
-exports[16] = 'BIT';
-exports[17] = 'TIMESTAMP2';
-exports[18] = 'DATETIME2';
-exports[19] = 'TIME2';
-exports[245] = 'JSON';
-exports[246] = 'NEWDECIMAL';
-exports[247] = 'ENUM';
-exports[248] = 'SET';
-exports[249] = 'TINY_BLOB';
-exports[250] = 'MEDIUM_BLOB';
-exports[251] = 'LONG_BLOB';
-exports[252] = 'BLOB';
-exports[253] = 'VAR_STRING';
-exports[254] = 'STRING';
-exports[255] = 'GEOMETRY';
-
-
-/***/ }),
-
-/***/ 1117:
-/***/ ((module) => {
-
-module.exports = AuthSwitchRequestPacket;
-function AuthSwitchRequestPacket(options) {
- options = options || {};
-
- this.status = 0xfe;
- this.authMethodName = options.authMethodName;
- this.authMethodData = options.authMethodData;
-}
-
-AuthSwitchRequestPacket.prototype.parse = function parse(parser) {
- this.status = parser.parseUnsignedNumber(1);
- this.authMethodName = parser.parseNullTerminatedString();
- this.authMethodData = parser.parsePacketTerminatedBuffer();
-};
-
-AuthSwitchRequestPacket.prototype.write = function write(writer) {
- writer.writeUnsignedNumber(1, this.status);
- writer.writeNullTerminatedString(this.authMethodName);
- writer.writeBuffer(this.authMethodData);
-};
-
-
-/***/ }),
-
-/***/ 83112:
-/***/ ((module) => {
-
-module.exports = AuthSwitchResponsePacket;
-function AuthSwitchResponsePacket(options) {
- options = options || {};
-
- this.data = options.data;
-}
-
-AuthSwitchResponsePacket.prototype.parse = function parse(parser) {
- this.data = parser.parsePacketTerminatedBuffer();
-};
-
-AuthSwitchResponsePacket.prototype.write = function write(writer) {
- writer.writeBuffer(this.data);
-};
-
-
-/***/ }),
-
-/***/ 72948:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Buffer = __nccwpck_require__(21867).Buffer;
-
-module.exports = ClientAuthenticationPacket;
-function ClientAuthenticationPacket(options) {
- options = options || {};
-
- this.clientFlags = options.clientFlags;
- this.maxPacketSize = options.maxPacketSize;
- this.charsetNumber = options.charsetNumber;
- this.filler = undefined;
- this.user = options.user;
- this.scrambleBuff = options.scrambleBuff;
- this.database = options.database;
- this.protocol41 = options.protocol41;
-}
-
-ClientAuthenticationPacket.prototype.parse = function(parser) {
- if (this.protocol41) {
- this.clientFlags = parser.parseUnsignedNumber(4);
- this.maxPacketSize = parser.parseUnsignedNumber(4);
- this.charsetNumber = parser.parseUnsignedNumber(1);
- this.filler = parser.parseFiller(23);
- this.user = parser.parseNullTerminatedString();
- this.scrambleBuff = parser.parseLengthCodedBuffer();
- this.database = parser.parseNullTerminatedString();
- } else {
- this.clientFlags = parser.parseUnsignedNumber(2);
- this.maxPacketSize = parser.parseUnsignedNumber(3);
- this.user = parser.parseNullTerminatedString();
- this.scrambleBuff = parser.parseBuffer(8);
- this.database = parser.parseLengthCodedBuffer();
- }
-};
-
-ClientAuthenticationPacket.prototype.write = function(writer) {
- if (this.protocol41) {
- writer.writeUnsignedNumber(4, this.clientFlags);
- writer.writeUnsignedNumber(4, this.maxPacketSize);
- writer.writeUnsignedNumber(1, this.charsetNumber);
- writer.writeFiller(23);
- writer.writeNullTerminatedString(this.user);
- writer.writeLengthCodedBuffer(this.scrambleBuff);
- writer.writeNullTerminatedString(this.database);
- } else {
- writer.writeUnsignedNumber(2, this.clientFlags);
- writer.writeUnsignedNumber(3, this.maxPacketSize);
- writer.writeNullTerminatedString(this.user);
- writer.writeBuffer(this.scrambleBuff);
- if (this.database && this.database.length) {
- writer.writeFiller(1);
- writer.writeBuffer(Buffer.from(this.database));
- }
- }
-};
-
-
-/***/ }),
-
-/***/ 77942:
-/***/ ((module) => {
-
-module.exports = ComChangeUserPacket;
-function ComChangeUserPacket(options) {
- options = options || {};
-
- this.command = 0x11;
- this.user = options.user;
- this.scrambleBuff = options.scrambleBuff;
- this.database = options.database;
- this.charsetNumber = options.charsetNumber;
-}
-
-ComChangeUserPacket.prototype.parse = function(parser) {
- this.command = parser.parseUnsignedNumber(1);
- this.user = parser.parseNullTerminatedString();
- this.scrambleBuff = parser.parseLengthCodedBuffer();
- this.database = parser.parseNullTerminatedString();
- this.charsetNumber = parser.parseUnsignedNumber(1);
-};
-
-ComChangeUserPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.command);
- writer.writeNullTerminatedString(this.user);
- writer.writeLengthCodedBuffer(this.scrambleBuff);
- writer.writeNullTerminatedString(this.database);
- writer.writeUnsignedNumber(2, this.charsetNumber);
-};
-
-
-/***/ }),
-
-/***/ 54368:
-/***/ ((module) => {
-
-module.exports = ComPingPacket;
-function ComPingPacket() {
- this.command = 0x0e;
-}
-
-ComPingPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.command);
-};
-
-ComPingPacket.prototype.parse = function(parser) {
- this.command = parser.parseUnsignedNumber(1);
-};
-
-
-/***/ }),
-
-/***/ 9380:
-/***/ ((module) => {
-
-module.exports = ComQueryPacket;
-function ComQueryPacket(sql) {
- this.command = 0x03;
- this.sql = sql;
-}
-
-ComQueryPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.command);
- writer.writeString(this.sql);
-};
-
-ComQueryPacket.prototype.parse = function(parser) {
- this.command = parser.parseUnsignedNumber(1);
- this.sql = parser.parsePacketTerminatedString();
-};
-
-
-/***/ }),
-
-/***/ 93904:
-/***/ ((module) => {
-
-module.exports = ComQuitPacket;
-function ComQuitPacket() {
- this.command = 0x01;
-}
-
-ComQuitPacket.prototype.parse = function parse(parser) {
- this.command = parser.parseUnsignedNumber(1);
-};
-
-ComQuitPacket.prototype.write = function write(writer) {
- writer.writeUnsignedNumber(1, this.command);
-};
-
-
-/***/ }),
-
-/***/ 52943:
-/***/ ((module) => {
-
-module.exports = ComStatisticsPacket;
-function ComStatisticsPacket() {
- this.command = 0x09;
-}
-
-ComStatisticsPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.command);
-};
-
-ComStatisticsPacket.prototype.parse = function(parser) {
- this.command = parser.parseUnsignedNumber(1);
-};
-
-
-/***/ }),
-
-/***/ 87761:
-/***/ ((module) => {
-
-module.exports = EmptyPacket;
-function EmptyPacket() {
-}
-
-EmptyPacket.prototype.parse = function parse() {
-};
-
-EmptyPacket.prototype.write = function write() {
-};
-
-
-/***/ }),
-
-/***/ 4693:
-/***/ ((module) => {
-
-module.exports = EofPacket;
-function EofPacket(options) {
- options = options || {};
-
- this.fieldCount = undefined;
- this.warningCount = options.warningCount;
- this.serverStatus = options.serverStatus;
- this.protocol41 = options.protocol41;
-}
-
-EofPacket.prototype.parse = function(parser) {
- this.fieldCount = parser.parseUnsignedNumber(1);
- if (this.protocol41) {
- this.warningCount = parser.parseUnsignedNumber(2);
- this.serverStatus = parser.parseUnsignedNumber(2);
- }
-};
-
-EofPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, 0xfe);
- if (this.protocol41) {
- writer.writeUnsignedNumber(2, this.warningCount);
- writer.writeUnsignedNumber(2, this.serverStatus);
- }
-};
-
-
-/***/ }),
-
-/***/ 11627:
-/***/ ((module) => {
-
-module.exports = ErrorPacket;
-function ErrorPacket(options) {
- options = options || {};
-
- this.fieldCount = options.fieldCount;
- this.errno = options.errno;
- this.sqlStateMarker = options.sqlStateMarker;
- this.sqlState = options.sqlState;
- this.message = options.message;
-}
-
-ErrorPacket.prototype.parse = function(parser) {
- this.fieldCount = parser.parseUnsignedNumber(1);
- this.errno = parser.parseUnsignedNumber(2);
-
- // sqlStateMarker ('#' = 0x23) indicates error packet format
- if (parser.peak() === 0x23) {
- this.sqlStateMarker = parser.parseString(1);
- this.sqlState = parser.parseString(5);
- }
-
- this.message = parser.parsePacketTerminatedString();
-};
-
-ErrorPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, 0xff);
- writer.writeUnsignedNumber(2, this.errno);
-
- if (this.sqlStateMarker) {
- writer.writeString(this.sqlStateMarker);
- writer.writeString(this.sqlState);
- }
-
- writer.writeString(this.message);
-};
-
-
-/***/ }),
-
-/***/ 3873:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Types = __nccwpck_require__(81699);
-
-module.exports = Field;
-function Field(options) {
- options = options || {};
-
- this.parser = options.parser;
- this.packet = options.packet;
- this.db = options.packet.db;
- this.table = options.packet.table;
- this.name = options.packet.name;
- this.type = Types[options.packet.type];
- this.length = options.packet.length;
-}
-
-Field.prototype.string = function () {
- return this.parser.parseLengthCodedString();
-};
-
-Field.prototype.buffer = function () {
- return this.parser.parseLengthCodedBuffer();
-};
-
-Field.prototype.geometry = function () {
- return this.parser.parseGeometryValue();
-};
-
-
-/***/ }),
-
-/***/ 78325:
-/***/ ((module) => {
-
-module.exports = FieldPacket;
-function FieldPacket(options) {
- options = options || {};
-
- this.catalog = options.catalog;
- this.db = options.db;
- this.table = options.table;
- this.orgTable = options.orgTable;
- this.name = options.name;
- this.orgName = options.orgName;
- this.charsetNr = options.charsetNr;
- this.length = options.length;
- this.type = options.type;
- this.flags = options.flags;
- this.decimals = options.decimals;
- this.default = options.default;
- this.zeroFill = options.zeroFill;
- this.protocol41 = options.protocol41;
-}
-
-FieldPacket.prototype.parse = function(parser) {
- if (this.protocol41) {
- this.catalog = parser.parseLengthCodedString();
- this.db = parser.parseLengthCodedString();
- this.table = parser.parseLengthCodedString();
- this.orgTable = parser.parseLengthCodedString();
- this.name = parser.parseLengthCodedString();
- this.orgName = parser.parseLengthCodedString();
-
- if (parser.parseLengthCodedNumber() !== 0x0c) {
- var err = new TypeError('Received invalid field length');
- err.code = 'PARSER_INVALID_FIELD_LENGTH';
- throw err;
- }
-
- this.charsetNr = parser.parseUnsignedNumber(2);
- this.length = parser.parseUnsignedNumber(4);
- this.type = parser.parseUnsignedNumber(1);
- this.flags = parser.parseUnsignedNumber(2);
- this.decimals = parser.parseUnsignedNumber(1);
-
- var filler = parser.parseBuffer(2);
- if (filler[0] !== 0x0 || filler[1] !== 0x0) {
- var err = new TypeError('Received invalid filler');
- err.code = 'PARSER_INVALID_FILLER';
- throw err;
- }
-
- // parsed flags
- this.zeroFill = (this.flags & 0x0040 ? true : false);
-
- if (parser.reachedPacketEnd()) {
- return;
- }
-
- this.default = parser.parseLengthCodedString();
- } else {
- this.table = parser.parseLengthCodedString();
- this.name = parser.parseLengthCodedString();
- this.length = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1));
- this.type = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1));
- }
-};
-
-FieldPacket.prototype.write = function(writer) {
- if (this.protocol41) {
- writer.writeLengthCodedString(this.catalog);
- writer.writeLengthCodedString(this.db);
- writer.writeLengthCodedString(this.table);
- writer.writeLengthCodedString(this.orgTable);
- writer.writeLengthCodedString(this.name);
- writer.writeLengthCodedString(this.orgName);
-
- writer.writeLengthCodedNumber(0x0c);
- writer.writeUnsignedNumber(2, this.charsetNr || 0);
- writer.writeUnsignedNumber(4, this.length || 0);
- writer.writeUnsignedNumber(1, this.type || 0);
- writer.writeUnsignedNumber(2, this.flags || 0);
- writer.writeUnsignedNumber(1, this.decimals || 0);
- writer.writeFiller(2);
-
- if (this.default !== undefined) {
- writer.writeLengthCodedString(this.default);
- }
- } else {
- writer.writeLengthCodedString(this.table);
- writer.writeLengthCodedString(this.name);
- writer.writeUnsignedNumber(1, 0x01);
- writer.writeUnsignedNumber(1, this.length);
- writer.writeUnsignedNumber(1, 0x01);
- writer.writeUnsignedNumber(1, this.type);
- }
-};
-
-
-/***/ }),
-
-/***/ 38230:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Buffer = __nccwpck_require__(21867).Buffer;
-var Client = __nccwpck_require__(5427);
-
-module.exports = HandshakeInitializationPacket;
-function HandshakeInitializationPacket(options) {
- options = options || {};
-
- this.protocolVersion = options.protocolVersion;
- this.serverVersion = options.serverVersion;
- this.threadId = options.threadId;
- this.scrambleBuff1 = options.scrambleBuff1;
- this.filler1 = options.filler1;
- this.serverCapabilities1 = options.serverCapabilities1;
- this.serverLanguage = options.serverLanguage;
- this.serverStatus = options.serverStatus;
- this.serverCapabilities2 = options.serverCapabilities2;
- this.scrambleLength = options.scrambleLength;
- this.filler2 = options.filler2;
- this.scrambleBuff2 = options.scrambleBuff2;
- this.filler3 = options.filler3;
- this.pluginData = options.pluginData;
- this.protocol41 = options.protocol41;
-
- if (this.protocol41) {
- // force set the bit in serverCapabilities1
- this.serverCapabilities1 |= Client.CLIENT_PROTOCOL_41;
- }
-}
-
-HandshakeInitializationPacket.prototype.parse = function(parser) {
- this.protocolVersion = parser.parseUnsignedNumber(1);
- this.serverVersion = parser.parseNullTerminatedString();
- this.threadId = parser.parseUnsignedNumber(4);
- this.scrambleBuff1 = parser.parseBuffer(8);
- this.filler1 = parser.parseFiller(1);
- this.serverCapabilities1 = parser.parseUnsignedNumber(2);
- this.serverLanguage = parser.parseUnsignedNumber(1);
- this.serverStatus = parser.parseUnsignedNumber(2);
-
- this.protocol41 = (this.serverCapabilities1 & (1 << 9)) > 0;
-
- if (this.protocol41) {
- this.serverCapabilities2 = parser.parseUnsignedNumber(2);
- this.scrambleLength = parser.parseUnsignedNumber(1);
- this.filler2 = parser.parseFiller(10);
- // scrambleBuff2 should be 0x00 terminated, but sphinx does not do this
- // so we assume scrambleBuff2 to be 12 byte and treat the next byte as a
- // filler byte.
- this.scrambleBuff2 = parser.parseBuffer(12);
- this.filler3 = parser.parseFiller(1);
- } else {
- this.filler2 = parser.parseFiller(13);
- }
-
- if (parser.reachedPacketEnd()) {
- return;
- }
-
- // According to the docs this should be 0x00 terminated, but MariaDB does
- // not do this, so we assume this string to be packet terminated.
- this.pluginData = parser.parsePacketTerminatedString();
-
- // However, if there is a trailing '\0', strip it
- var lastChar = this.pluginData.length - 1;
- if (this.pluginData[lastChar] === '\0') {
- this.pluginData = this.pluginData.substr(0, lastChar);
- }
-};
-
-HandshakeInitializationPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.protocolVersion);
- writer.writeNullTerminatedString(this.serverVersion);
- writer.writeUnsignedNumber(4, this.threadId);
- writer.writeBuffer(this.scrambleBuff1);
- writer.writeFiller(1);
- writer.writeUnsignedNumber(2, this.serverCapabilities1);
- writer.writeUnsignedNumber(1, this.serverLanguage);
- writer.writeUnsignedNumber(2, this.serverStatus);
- if (this.protocol41) {
- writer.writeUnsignedNumber(2, this.serverCapabilities2);
- writer.writeUnsignedNumber(1, this.scrambleLength);
- writer.writeFiller(10);
- }
- writer.writeNullTerminatedBuffer(this.scrambleBuff2);
-
- if (this.pluginData !== undefined) {
- writer.writeNullTerminatedString(this.pluginData);
- }
-};
-
-HandshakeInitializationPacket.prototype.scrambleBuff = function() {
- var buffer = null;
-
- if (typeof this.scrambleBuff2 === 'undefined') {
- buffer = Buffer.from(this.scrambleBuff1);
- } else {
- buffer = Buffer.allocUnsafe(this.scrambleBuff1.length + this.scrambleBuff2.length);
- this.scrambleBuff1.copy(buffer, 0);
- this.scrambleBuff2.copy(buffer, this.scrambleBuff1.length);
- }
-
- return buffer;
-};
-
-
-/***/ }),
-
-/***/ 89171:
-/***/ ((module) => {
-
-module.exports = LocalDataFilePacket;
-
-/**
- * Create a new LocalDataFilePacket
- * @constructor
- * @param {Buffer} data The data contents of the packet
- * @public
- */
-function LocalDataFilePacket(data) {
- this.data = data;
-}
-
-LocalDataFilePacket.prototype.write = function(writer) {
- writer.writeBuffer(this.data);
-};
-
-
-/***/ }),
-
-/***/ 91444:
-/***/ ((module) => {
-
-module.exports = LocalInfileRequestPacket;
-function LocalInfileRequestPacket(options) {
- options = options || {};
-
- this.filename = options.filename;
-}
-
-LocalInfileRequestPacket.prototype.parse = function parse(parser) {
- if (parser.parseLengthCodedNumber() !== null) {
- var err = new TypeError('Received invalid field length');
- err.code = 'PARSER_INVALID_FIELD_LENGTH';
- throw err;
- }
-
- this.filename = parser.parsePacketTerminatedString();
-};
-
-LocalInfileRequestPacket.prototype.write = function write(writer) {
- writer.writeLengthCodedNumber(null);
- writer.writeString(this.filename);
-};
-
-
-/***/ }),
-
-/***/ 69900:
-/***/ ((module) => {
-
-
-// Language-neutral expression to match ER_UPDATE_INFO
-var ER_UPDATE_INFO_REGEXP = /^[^:0-9]+: [0-9]+[^:0-9]+: ([0-9]+)[^:0-9]+: [0-9]+[^:0-9]*$/;
-
-module.exports = OkPacket;
-function OkPacket(options) {
- options = options || {};
-
- this.fieldCount = undefined;
- this.affectedRows = undefined;
- this.insertId = undefined;
- this.serverStatus = undefined;
- this.warningCount = undefined;
- this.message = undefined;
- this.protocol41 = options.protocol41;
-}
-
-OkPacket.prototype.parse = function(parser) {
- this.fieldCount = parser.parseUnsignedNumber(1);
- this.affectedRows = parser.parseLengthCodedNumber();
- this.insertId = parser.parseLengthCodedNumber();
- if (this.protocol41) {
- this.serverStatus = parser.parseUnsignedNumber(2);
- this.warningCount = parser.parseUnsignedNumber(2);
- }
- this.message = parser.parsePacketTerminatedString();
- this.changedRows = 0;
-
- var m = ER_UPDATE_INFO_REGEXP.exec(this.message);
- if (m !== null) {
- this.changedRows = parseInt(m[1], 10);
- }
-};
-
-OkPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, 0x00);
- writer.writeLengthCodedNumber(this.affectedRows || 0);
- writer.writeLengthCodedNumber(this.insertId || 0);
- if (this.protocol41) {
- writer.writeUnsignedNumber(2, this.serverStatus || 0);
- writer.writeUnsignedNumber(2, this.warningCount || 0);
- }
- writer.writeString(this.message);
-};
-
-
-/***/ }),
-
-/***/ 61949:
-/***/ ((module) => {
-
-module.exports = OldPasswordPacket;
-function OldPasswordPacket(options) {
- options = options || {};
-
- this.scrambleBuff = options.scrambleBuff;
-}
-
-OldPasswordPacket.prototype.parse = function(parser) {
- this.scrambleBuff = parser.parsePacketTerminatedBuffer();
-};
-
-OldPasswordPacket.prototype.write = function(writer) {
- writer.writeBuffer(this.scrambleBuff);
-};
-
-
-/***/ }),
-
-/***/ 29828:
-/***/ ((module) => {
-
-module.exports = ResultSetHeaderPacket;
-function ResultSetHeaderPacket(options) {
- options = options || {};
-
- this.fieldCount = options.fieldCount;
-}
-
-ResultSetHeaderPacket.prototype.parse = function(parser) {
- this.fieldCount = parser.parseLengthCodedNumber();
-};
-
-ResultSetHeaderPacket.prototype.write = function(writer) {
- writer.writeLengthCodedNumber(this.fieldCount);
-};
-
-
-/***/ }),
-
-/***/ 96172:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Types = __nccwpck_require__(81699);
-var Charsets = __nccwpck_require__(30124);
-var Field = __nccwpck_require__(3873);
-var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53);
-
-module.exports = RowDataPacket;
-function RowDataPacket() {
-}
-
-Object.defineProperty(RowDataPacket.prototype, 'parse', {
- configurable : true,
- enumerable : false,
- value : parse
-});
-
-Object.defineProperty(RowDataPacket.prototype, '_typeCast', {
- configurable : true,
- enumerable : false,
- value : typeCast
-});
-
-function parse(parser, fieldPackets, typeCast, nestTables, connection) {
- var self = this;
- var next = function () {
- return self._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings);
- };
-
- for (var i = 0; i < fieldPackets.length; i++) {
- var fieldPacket = fieldPackets[i];
- var value;
-
- if (typeof typeCast === 'function') {
- value = typeCast.apply(connection, [ new Field({ packet: fieldPacket, parser: parser }), next ]);
- } else {
- value = (typeCast)
- ? this._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings)
- : ( (fieldPacket.charsetNr === Charsets.BINARY)
- ? parser.parseLengthCodedBuffer()
- : parser.parseLengthCodedString() );
- }
-
- if (typeof nestTables === 'string' && nestTables.length) {
- this[fieldPacket.table + nestTables + fieldPacket.name] = value;
- } else if (nestTables) {
- this[fieldPacket.table] = this[fieldPacket.table] || {};
- this[fieldPacket.table][fieldPacket.name] = value;
- } else {
- this[fieldPacket.name] = value;
- }
- }
-}
-
-function typeCast(field, parser, timeZone, supportBigNumbers, bigNumberStrings, dateStrings) {
- var numberString;
-
- switch (field.type) {
- case Types.TIMESTAMP:
- case Types.TIMESTAMP2:
- case Types.DATE:
- case Types.DATETIME:
- case Types.DATETIME2:
- case Types.NEWDATE:
- var dateString = parser.parseLengthCodedString();
-
- if (typeMatch(field.type, dateStrings)) {
- return dateString;
- }
-
- if (dateString === null) {
- return null;
- }
-
- var originalString = dateString;
- if (field.type === Types.DATE) {
- dateString += ' 00:00:00';
- }
-
- if (timeZone !== 'local') {
- dateString += ' ' + timeZone;
- }
-
- var dt = new Date(dateString);
- if (isNaN(dt.getTime())) {
- return originalString;
- }
-
- return dt;
- case Types.TINY:
- case Types.SHORT:
- case Types.LONG:
- case Types.INT24:
- case Types.YEAR:
- case Types.FLOAT:
- case Types.DOUBLE:
- numberString = parser.parseLengthCodedString();
- return (numberString === null || (field.zeroFill && numberString[0] === '0'))
- ? numberString : Number(numberString);
- case Types.NEWDECIMAL:
- case Types.LONGLONG:
- numberString = parser.parseLengthCodedString();
- return (numberString === null || (field.zeroFill && numberString[0] === '0'))
- ? numberString
- : ((supportBigNumbers && (bigNumberStrings || (Number(numberString) >= IEEE_754_BINARY_64_PRECISION) || Number(numberString) <= -IEEE_754_BINARY_64_PRECISION))
- ? numberString
- : Number(numberString));
- case Types.BIT:
- return parser.parseLengthCodedBuffer();
- case Types.STRING:
- case Types.VAR_STRING:
- case Types.TINY_BLOB:
- case Types.MEDIUM_BLOB:
- case Types.LONG_BLOB:
- case Types.BLOB:
- return (field.charsetNr === Charsets.BINARY)
- ? parser.parseLengthCodedBuffer()
- : parser.parseLengthCodedString();
- case Types.GEOMETRY:
- return parser.parseGeometryValue();
- default:
- return parser.parseLengthCodedString();
- }
-}
-
-function typeMatch(type, list) {
- if (Array.isArray(list)) {
- return list.indexOf(Types[type]) !== -1;
- } else {
- return Boolean(list);
- }
-}
-
-
-/***/ }),
-
-/***/ 27304:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-// http://dev.mysql.com/doc/internals/en/ssl.html
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
-
-var ClientConstants = __nccwpck_require__(5427);
-
-module.exports = SSLRequestPacket;
-
-function SSLRequestPacket(options) {
- options = options || {};
- this.clientFlags = options.clientFlags | ClientConstants.CLIENT_SSL;
- this.maxPacketSize = options.maxPacketSize;
- this.charsetNumber = options.charsetNumber;
-}
-
-SSLRequestPacket.prototype.parse = function(parser) {
- // TODO: check SSLRequest packet v41 vs pre v41
- this.clientFlags = parser.parseUnsignedNumber(4);
- this.maxPacketSize = parser.parseUnsignedNumber(4);
- this.charsetNumber = parser.parseUnsignedNumber(1);
-};
-
-SSLRequestPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(4, this.clientFlags);
- writer.writeUnsignedNumber(4, this.maxPacketSize);
- writer.writeUnsignedNumber(1, this.charsetNumber);
- writer.writeFiller(23);
-};
-
-
-/***/ }),
-
-/***/ 64782:
-/***/ ((module) => {
-
-module.exports = StatisticsPacket;
-function StatisticsPacket() {
- this.message = undefined;
-}
-
-StatisticsPacket.prototype.parse = function(parser) {
- this.message = parser.parsePacketTerminatedString();
-
- var items = this.message.split(/\s\s/);
- for (var i = 0; i < items.length; i++) {
- var m = items[i].match(/^(.+)\:\s+(.+)$/);
- if (m !== null) {
- this[m[1].toLowerCase().replace(/\s/g, '_')] = Number(m[2]);
- }
- }
-};
-
-StatisticsPacket.prototype.write = function(writer) {
- writer.writeString(this.message);
-};
-
-
-/***/ }),
-
-/***/ 86585:
-/***/ ((module) => {
-
-module.exports = UseOldPasswordPacket;
-function UseOldPasswordPacket(options) {
- options = options || {};
-
- this.firstByte = options.firstByte || 0xfe;
-}
-
-UseOldPasswordPacket.prototype.parse = function(parser) {
- this.firstByte = parser.parseUnsignedNumber(1);
-};
-
-UseOldPasswordPacket.prototype.write = function(writer) {
- writer.writeUnsignedNumber(1, this.firstByte);
-};
-
-
-/***/ }),
-
-/***/ 87628:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-exports.AuthSwitchRequestPacket = __nccwpck_require__(1117);
-exports.AuthSwitchResponsePacket = __nccwpck_require__(83112);
-exports.ClientAuthenticationPacket = __nccwpck_require__(72948);
-exports.ComChangeUserPacket = __nccwpck_require__(77942);
-exports.ComPingPacket = __nccwpck_require__(54368);
-exports.ComQueryPacket = __nccwpck_require__(9380);
-exports.ComQuitPacket = __nccwpck_require__(93904);
-exports.ComStatisticsPacket = __nccwpck_require__(52943);
-exports.EmptyPacket = __nccwpck_require__(87761);
-exports.EofPacket = __nccwpck_require__(4693);
-exports.ErrorPacket = __nccwpck_require__(11627);
-exports.Field = __nccwpck_require__(3873);
-exports.FieldPacket = __nccwpck_require__(78325);
-exports.HandshakeInitializationPacket = __nccwpck_require__(38230);
-exports.LocalDataFilePacket = __nccwpck_require__(89171);
-exports.LocalInfileRequestPacket = __nccwpck_require__(91444);
-exports.OkPacket = __nccwpck_require__(69900);
-exports.OldPasswordPacket = __nccwpck_require__(61949);
-exports.ResultSetHeaderPacket = __nccwpck_require__(29828);
-exports.RowDataPacket = __nccwpck_require__(96172);
-exports.SSLRequestPacket = __nccwpck_require__(27304);
-exports.StatisticsPacket = __nccwpck_require__(64782);
-exports.UseOldPasswordPacket = __nccwpck_require__(86585);
-
-
-/***/ }),
-
-/***/ 25000:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Sequence = __nccwpck_require__(80401);
-var Util = __nccwpck_require__(31669);
-var Packets = __nccwpck_require__(87628);
-var Auth = __nccwpck_require__(37806);
-
-module.exports = ChangeUser;
-Util.inherits(ChangeUser, Sequence);
-function ChangeUser(options, callback) {
- Sequence.call(this, options, callback);
-
- this._user = options.user;
- this._password = options.password;
- this._database = options.database;
- this._charsetNumber = options.charsetNumber;
- this._currentConfig = options.currentConfig;
-}
-
-ChangeUser.prototype.determinePacket = function determinePacket(firstByte) {
- switch (firstByte) {
- case 0xfe: return Packets.AuthSwitchRequestPacket;
- case 0xff: return Packets.ErrorPacket;
- default: return undefined;
- }
-};
-
-ChangeUser.prototype.start = function(handshakeInitializationPacket) {
- var scrambleBuff = handshakeInitializationPacket.scrambleBuff();
- scrambleBuff = Auth.token(this._password, scrambleBuff);
-
- var packet = new Packets.ComChangeUserPacket({
- user : this._user,
- scrambleBuff : scrambleBuff,
- database : this._database,
- charsetNumber : this._charsetNumber
- });
-
- this._currentConfig.user = this._user;
- this._currentConfig.password = this._password;
- this._currentConfig.database = this._database;
- this._currentConfig.charsetNumber = this._charsetNumber;
-
- this.emit('packet', packet);
-};
-
-ChangeUser.prototype['AuthSwitchRequestPacket'] = function (packet) {
- var name = packet.authMethodName;
- var data = Auth.auth(name, packet.authMethodData, {
- password: this._password
- });
-
- if (data !== undefined) {
- this.emit('packet', new Packets.AuthSwitchResponsePacket({
- data: data
- }));
- } else {
- var err = new Error('MySQL is requesting the ' + name + ' authentication method, which is not supported.');
- err.code = 'UNSUPPORTED_AUTH_METHOD';
- err.fatal = true;
- this.end(err);
- }
-};
-
-ChangeUser.prototype['ErrorPacket'] = function(packet) {
- var err = this._packetToError(packet);
- err.fatal = true;
- this.end(err);
-};
-
-
-/***/ }),
-
-/***/ 56353:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Sequence = __nccwpck_require__(80401);
-var Util = __nccwpck_require__(31669);
-var Packets = __nccwpck_require__(87628);
-var Auth = __nccwpck_require__(37806);
-var ClientConstants = __nccwpck_require__(5427);
-
-module.exports = Handshake;
-Util.inherits(Handshake, Sequence);
-function Handshake(options, callback) {
- Sequence.call(this, options, callback);
-
- options = options || {};
-
- this._config = options.config;
- this._handshakeInitializationPacket = null;
-}
-
-Handshake.prototype.determinePacket = function determinePacket(firstByte, parser) {
- if (firstByte === 0xff) {
- return Packets.ErrorPacket;
- }
-
- if (!this._handshakeInitializationPacket) {
- return Packets.HandshakeInitializationPacket;
- }
-
- if (firstByte === 0xfe) {
- return (parser.packetLength() === 1)
- ? Packets.UseOldPasswordPacket
- : Packets.AuthSwitchRequestPacket;
- }
-
- return undefined;
-};
-
-Handshake.prototype['AuthSwitchRequestPacket'] = function (packet) {
- var name = packet.authMethodName;
- var data = Auth.auth(name, packet.authMethodData, {
- password: this._config.password
- });
-
- if (data !== undefined) {
- this.emit('packet', new Packets.AuthSwitchResponsePacket({
- data: data
- }));
- } else {
- var err = new Error('MySQL is requesting the ' + name + ' authentication method, which is not supported.');
- err.code = 'UNSUPPORTED_AUTH_METHOD';
- err.fatal = true;
- this.end(err);
- }
-};
-
-Handshake.prototype['HandshakeInitializationPacket'] = function(packet) {
- this._handshakeInitializationPacket = packet;
-
- this._config.protocol41 = packet.protocol41;
-
- var serverSSLSupport = packet.serverCapabilities1 & ClientConstants.CLIENT_SSL;
-
- if (this._config.ssl) {
- if (!serverSSLSupport) {
- var err = new Error('Server does not support secure connection');
-
- err.code = 'HANDSHAKE_NO_SSL_SUPPORT';
- err.fatal = true;
-
- this.end(err);
- return;
- }
-
- this._config.clientFlags |= ClientConstants.CLIENT_SSL;
- this.emit('packet', new Packets.SSLRequestPacket({
- clientFlags : this._config.clientFlags,
- maxPacketSize : this._config.maxPacketSize,
- charsetNumber : this._config.charsetNumber
- }));
- this.emit('start-tls');
- } else {
- this._sendCredentials();
- }
-};
-
-Handshake.prototype._tlsUpgradeCompleteHandler = function() {
- this._sendCredentials();
-};
-
-Handshake.prototype._sendCredentials = function() {
- var packet = this._handshakeInitializationPacket;
- this.emit('packet', new Packets.ClientAuthenticationPacket({
- clientFlags : this._config.clientFlags,
- maxPacketSize : this._config.maxPacketSize,
- charsetNumber : this._config.charsetNumber,
- user : this._config.user,
- database : this._config.database,
- protocol41 : packet.protocol41,
- scrambleBuff : (packet.protocol41)
- ? Auth.token(this._config.password, packet.scrambleBuff())
- : Auth.scramble323(packet.scrambleBuff(), this._config.password)
- }));
-};
-
-Handshake.prototype['UseOldPasswordPacket'] = function() {
- if (!this._config.insecureAuth) {
- var err = new Error(
- 'MySQL server is requesting the old and insecure pre-4.1 auth mechanism. ' +
- 'Upgrade the user password or use the {insecureAuth: true} option.'
- );
-
- err.code = 'HANDSHAKE_INSECURE_AUTH';
- err.fatal = true;
-
- this.end(err);
- return;
- }
-
- this.emit('packet', new Packets.OldPasswordPacket({
- scrambleBuff: Auth.scramble323(this._handshakeInitializationPacket.scrambleBuff(), this._config.password)
- }));
-};
-
-Handshake.prototype['ErrorPacket'] = function(packet) {
- var err = this._packetToError(packet, true);
- err.fatal = true;
- this.end(err);
-};
-
-
-/***/ }),
-
-/***/ 22141:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Sequence = __nccwpck_require__(80401);
-var Util = __nccwpck_require__(31669);
-var Packets = __nccwpck_require__(87628);
-
-module.exports = Ping;
-Util.inherits(Ping, Sequence);
-
-function Ping(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
-
- Sequence.call(this, options, callback);
-}
-
-Ping.prototype.start = function() {
- this.emit('packet', new Packets.ComPingPacket());
-};
-
-
-/***/ }),
-
-/***/ 1352:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var ClientConstants = __nccwpck_require__(5427);
-var fs = __nccwpck_require__(35747);
-var Packets = __nccwpck_require__(87628);
-var ResultSet = __nccwpck_require__(18774);
-var Sequence = __nccwpck_require__(80401);
-var ServerStatus = __nccwpck_require__(64563);
-var Readable = __nccwpck_require__(51642);
-var Util = __nccwpck_require__(31669);
-
-module.exports = Query;
-Util.inherits(Query, Sequence);
-function Query(options, callback) {
- Sequence.call(this, options, callback);
-
- this.sql = options.sql;
- this.values = options.values;
- this.typeCast = (options.typeCast === undefined)
- ? true
- : options.typeCast;
- this.nestTables = options.nestTables || false;
-
- this._resultSet = null;
- this._results = [];
- this._fields = [];
- this._index = 0;
- this._loadError = null;
-}
-
-Query.prototype.start = function() {
- this.emit('packet', new Packets.ComQueryPacket(this.sql));
-};
-
-Query.prototype.determinePacket = function determinePacket(byte, parser) {
- var resultSet = this._resultSet;
-
- if (!resultSet) {
- switch (byte) {
- case 0x00: return Packets.OkPacket;
- case 0xfb: return Packets.LocalInfileRequestPacket;
- case 0xff: return Packets.ErrorPacket;
- default: return Packets.ResultSetHeaderPacket;
- }
- }
-
- if (resultSet.eofPackets.length === 0) {
- return (resultSet.fieldPackets.length < resultSet.resultSetHeaderPacket.fieldCount)
- ? Packets.FieldPacket
- : Packets.EofPacket;
- }
-
- if (byte === 0xff) {
- return Packets.ErrorPacket;
- }
-
- if (byte === 0xfe && parser.packetLength() < 9) {
- return Packets.EofPacket;
- }
-
- return Packets.RowDataPacket;
-};
-
-Query.prototype['OkPacket'] = function(packet) {
- // try...finally for exception safety
- try {
- if (!this._callback) {
- this.emit('result', packet, this._index);
- } else {
- this._results.push(packet);
- this._fields.push(undefined);
- }
- } finally {
- this._index++;
- this._resultSet = null;
- this._handleFinalResultPacket(packet);
- }
-};
-
-Query.prototype['ErrorPacket'] = function(packet) {
- var err = this._packetToError(packet);
-
- var results = (this._results.length > 0)
- ? this._results
- : undefined;
-
- var fields = (this._fields.length > 0)
- ? this._fields
- : undefined;
-
- err.index = this._index;
- err.sql = this.sql;
-
- this.end(err, results, fields);
-};
-
-Query.prototype['LocalInfileRequestPacket'] = function(packet) {
- if (this._connection.config.clientFlags & ClientConstants.CLIENT_LOCAL_FILES) {
- this._sendLocalDataFile(packet.filename);
- } else {
- this._loadError = new Error('Load local files command is disabled');
- this._loadError.code = 'LOCAL_FILES_DISABLED';
- this._loadError.fatal = false;
-
- this.emit('packet', new Packets.EmptyPacket());
- }
-};
-
-Query.prototype['ResultSetHeaderPacket'] = function(packet) {
- this._resultSet = new ResultSet(packet);
-};
-
-Query.prototype['FieldPacket'] = function(packet) {
- this._resultSet.fieldPackets.push(packet);
-};
-
-Query.prototype['EofPacket'] = function(packet) {
- this._resultSet.eofPackets.push(packet);
-
- if (this._resultSet.eofPackets.length === 1 && !this._callback) {
- this.emit('fields', this._resultSet.fieldPackets, this._index);
- }
-
- if (this._resultSet.eofPackets.length !== 2) {
- return;
- }
-
- if (this._callback) {
- this._results.push(this._resultSet.rows);
- this._fields.push(this._resultSet.fieldPackets);
- }
-
- this._index++;
- this._resultSet = null;
- this._handleFinalResultPacket(packet);
-};
-
-Query.prototype._handleFinalResultPacket = function(packet) {
- if (packet.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) {
- return;
- }
-
- var results = (this._results.length > 1)
- ? this._results
- : this._results[0];
-
- var fields = (this._fields.length > 1)
- ? this._fields
- : this._fields[0];
-
- this.end(this._loadError, results, fields);
-};
-
-Query.prototype['RowDataPacket'] = function(packet, parser, connection) {
- packet.parse(parser, this._resultSet.fieldPackets, this.typeCast, this.nestTables, connection);
-
- if (this._callback) {
- this._resultSet.rows.push(packet);
- } else {
- this.emit('result', packet, this._index);
- }
-};
-
-Query.prototype._sendLocalDataFile = function(path) {
- var self = this;
- var localStream = fs.createReadStream(path, {
- flag : 'r',
- encoding : null,
- autoClose : true
- });
-
- this.on('pause', function () {
- localStream.pause();
- });
-
- this.on('resume', function () {
- localStream.resume();
- });
-
- localStream.on('data', function (data) {
- self.emit('packet', new Packets.LocalDataFilePacket(data));
- });
-
- localStream.on('error', function (err) {
- self._loadError = err;
- localStream.emit('end');
- });
-
- localStream.on('end', function () {
- self.emit('packet', new Packets.EmptyPacket());
- });
-};
-
-Query.prototype.stream = function(options) {
- var self = this;
-
- options = options || {};
- options.objectMode = true;
-
- var stream = new Readable(options);
-
- stream._read = function() {
- self._connection && self._connection.resume();
- };
-
- stream.once('end', function() {
- process.nextTick(function () {
- stream.emit('close');
- });
- });
-
- this.on('result', function(row, i) {
- if (!stream.push(row)) self._connection.pause();
- stream.emit('result', row, i); // replicate old emitter
- });
-
- this.on('error', function(err) {
- stream.emit('error', err); // Pass on any errors
- });
-
- this.on('end', function() {
- stream.push(null); // pushing null, indicating EOF
- });
-
- this.on('fields', function(fields, i) {
- stream.emit('fields', fields, i); // replicate old emitter
- });
-
- return stream;
-};
-
-
-/***/ }),
-
-/***/ 78200:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Sequence = __nccwpck_require__(80401);
-var Util = __nccwpck_require__(31669);
-var Packets = __nccwpck_require__(87628);
-
-module.exports = Quit;
-Util.inherits(Quit, Sequence);
-function Quit(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
-
- Sequence.call(this, options, callback);
-
- this._started = false;
-}
-
-Quit.prototype.end = function end(err) {
- if (this._ended) {
- return;
- }
-
- if (!this._started) {
- Sequence.prototype.end.call(this, err);
- return;
- }
-
- if (err && err.code === 'ECONNRESET' && err.syscall === 'read') {
- // Ignore read errors after packet sent
- Sequence.prototype.end.call(this);
- return;
- }
-
- Sequence.prototype.end.call(this, err);
-};
-
-Quit.prototype.start = function() {
- this._started = true;
- this.emit('packet', new Packets.ComQuitPacket());
-};
-
-
-/***/ }),
-
-/***/ 80401:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Util = __nccwpck_require__(31669);
-var EventEmitter = __nccwpck_require__(28614).EventEmitter;
-var Packets = __nccwpck_require__(87628);
-var ErrorConstants = __nccwpck_require__(95847);
-var Timer = __nccwpck_require__(42443);
-
-// istanbul ignore next: Node.js < 0.10 not covered
-var listenerCount = EventEmitter.listenerCount
- || function(emitter, type){ return emitter.listeners(type).length; };
-
-var LONG_STACK_DELIMITER = '\n --------------------\n';
-
-module.exports = Sequence;
-Util.inherits(Sequence, EventEmitter);
-function Sequence(options, callback) {
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
-
- EventEmitter.call(this);
-
- options = options || {};
-
- this._callback = callback;
- this._callSite = null;
- this._ended = false;
- this._timeout = options.timeout;
- this._timer = new Timer(this);
-}
-
-Sequence.determinePacket = function(byte) {
- switch (byte) {
- case 0x00: return Packets.OkPacket;
- case 0xfe: return Packets.EofPacket;
- case 0xff: return Packets.ErrorPacket;
- default: return undefined;
- }
-};
-
-Sequence.prototype.hasErrorHandler = function() {
- return Boolean(this._callback) || listenerCount(this, 'error') > 1;
-};
-
-Sequence.prototype._packetToError = function(packet) {
- var code = ErrorConstants[packet.errno] || 'UNKNOWN_CODE_PLEASE_REPORT';
- var err = new Error(code + ': ' + packet.message);
- err.code = code;
- err.errno = packet.errno;
-
- err.sqlMessage = packet.message;
- err.sqlState = packet.sqlState;
-
- return err;
-};
-
-Sequence.prototype.end = function(err) {
- if (this._ended) {
- return;
- }
-
- this._ended = true;
-
- if (err) {
- this._addLongStackTrace(err);
- }
-
- // Without this we are leaking memory. This problem was introduced in
- // 8189925374e7ce3819bbe88b64c7b15abac96b16. I suspect that the error object
- // causes a cyclic reference that the GC does not detect properly, but I was
- // unable to produce a standalone version of this leak. This would be a great
- // challenge for somebody interested in difficult problems : )!
- this._callSite = null;
-
- // try...finally for exception safety
- try {
- if (err) {
- this.emit('error', err);
- }
- } finally {
- try {
- if (this._callback) {
- this._callback.apply(this, arguments);
- }
- } finally {
- this.emit('end');
- }
- }
-};
-
-Sequence.prototype['OkPacket'] = function(packet) {
- this.end(null, packet);
-};
-
-Sequence.prototype['ErrorPacket'] = function(packet) {
- this.end(this._packetToError(packet));
-};
-
-// Implemented by child classes
-Sequence.prototype.start = function() {};
-
-Sequence.prototype._addLongStackTrace = function _addLongStackTrace(err) {
- var callSiteStack = this._callSite && this._callSite.stack;
-
- if (!callSiteStack || typeof callSiteStack !== 'string') {
- // No recorded call site
- return;
- }
-
- if (err.stack.indexOf(LONG_STACK_DELIMITER) !== -1) {
- // Error stack already looks long
- return;
- }
-
- var index = callSiteStack.indexOf('\n');
-
- if (index !== -1) {
- // Append recorded call site
- err.stack += LONG_STACK_DELIMITER + callSiteStack.substr(index + 1);
- }
-};
-
-Sequence.prototype._onTimeout = function _onTimeout() {
- this.emit('timeout');
-};
-
-
-/***/ }),
-
-/***/ 21827:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var Sequence = __nccwpck_require__(80401);
-var Util = __nccwpck_require__(31669);
-var Packets = __nccwpck_require__(87628);
-
-module.exports = Statistics;
-Util.inherits(Statistics, Sequence);
-function Statistics(options, callback) {
- if (!callback && typeof options === 'function') {
- callback = options;
- options = {};
- }
-
- Sequence.call(this, options, callback);
-}
-
-Statistics.prototype.start = function() {
- this.emit('packet', new Packets.ComStatisticsPacket());
-};
-
-Statistics.prototype['StatisticsPacket'] = function (packet) {
- this.end(null, packet);
-};
-
-Statistics.prototype.determinePacket = function determinePacket(firstByte) {
- if (firstByte === 0x55) {
- return Packets.StatisticsPacket;
- }
-
- return undefined;
-};
-
-
-/***/ }),
-
-/***/ 30794:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-exports.ChangeUser = __nccwpck_require__(25000);
-exports.Handshake = __nccwpck_require__(56353);
-exports.Ping = __nccwpck_require__(22141);
-exports.Query = __nccwpck_require__(1352);
-exports.Quit = __nccwpck_require__(78200);
-exports.Sequence = __nccwpck_require__(80401);
-exports.Statistics = __nccwpck_require__(21827);
-
-
-/***/ }),
-
-/***/ 34266:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-const Duplex = __nccwpck_require__(92413).Duplex;
-
-const kCallback = Symbol('Callback');
-const kOtherSide = Symbol('Other');
-
-class DuplexSocket extends Duplex {
- constructor(options) {
- super(options);
- this[kCallback] = null;
- this[kOtherSide] = null;
- }
-
- _read() {
- const callback = this[kCallback];
- if (callback) {
- this[kCallback] = null;
- callback();
- }
- }
-
- _write(chunk, encoding, callback) {
- this[kOtherSide][kCallback] = callback;
- this[kOtherSide].push(chunk);
- }
-
- _final(callback) {
- this[kOtherSide].on('end', callback);
- this[kOtherSide].push(null);
- }
-}
-
-class DuplexPair {
- constructor(options) {
- this.socket1 = new DuplexSocket(options);
- this.socket2 = new DuplexSocket(options);
- this.socket1[kOtherSide] = this.socket2;
- this.socket2[kOtherSide] = this.socket1;
- }
-}
-
-module.exports = DuplexPair;
-
-
-/***/ }),
-
-/***/ 83533:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-/**
- * Module exports.
- */
-
-module.exports = exports;
-
-/**
- * Module dependencies.
- */
-
-var fs = __nccwpck_require__(35747);
-var path = __nccwpck_require__(85622);
-var nopt = __nccwpck_require__(41743);
-var log = __nccwpck_require__(64314);
-log.disableProgress();
-var napi = __nccwpck_require__(10480);
-
-var EE = __nccwpck_require__(28614).EventEmitter;
-var inherits = __nccwpck_require__(31669).inherits;
-var commands = [
- 'clean',
- 'install',
- 'reinstall',
- 'build',
- 'rebuild',
- 'package',
- 'testpackage',
- 'publish',
- 'unpublish',
- 'info',
- 'testbinary',
- 'reveal',
- 'configure'
- ];
-var aliases = {};
-
-// differentiate node-pre-gyp's logs from npm's
-log.heading = 'node-pre-gyp';
-
-exports.find = __nccwpck_require__(92800).find;
-
-function Run() {
- var self = this;
-
- this.commands = {};
-
- commands.forEach(function (command) {
- self.commands[command] = function (argv, callback) {
- log.verbose('command', command, argv);
- return require('./' + command)(self, argv, callback);
- };
- });
-}
-inherits(Run, EE);
-exports.Run = Run;
-var proto = Run.prototype;
-
-/**
- * Export the contents of the package.json.
- */
-
-proto.package = __nccwpck_require__(16398);
-
-/**
- * nopt configuration definitions
- */
-
-proto.configDefs = {
- help: Boolean, // everywhere
- arch: String, // 'configure'
- debug: Boolean, // 'build'
- directory: String, // bin
- proxy: String, // 'install'
- loglevel: String, // everywhere
-};
-
-/**
- * nopt shorthands
- */
-
-proto.shorthands = {
- release: '--no-debug',
- C: '--directory',
- debug: '--debug',
- j: '--jobs',
- silent: '--loglevel=silent',
- silly: '--loglevel=silly',
- verbose: '--loglevel=verbose',
-};
-
-/**
- * expose the command aliases for the bin file to use.
- */
-
-proto.aliases = aliases;
-
-/**
- * Parses the given argv array and sets the 'opts',
- * 'argv' and 'command' properties.
- */
-
-proto.parseArgv = function parseOpts (argv) {
- this.opts = nopt(this.configDefs, this.shorthands, argv);
- this.argv = this.opts.argv.remain.slice();
- var commands = this.todo = [];
-
- // create a copy of the argv array with aliases mapped
- argv = this.argv.map(function (arg) {
- // is this an alias?
- if (arg in this.aliases) {
- arg = this.aliases[arg];
- }
- return arg;
- }, this);
-
- // process the mapped args into "command" objects ("name" and "args" props)
- argv.slice().forEach(function (arg) {
- if (arg in this.commands) {
- var args = argv.splice(0, argv.indexOf(arg));
- argv.shift();
- if (commands.length > 0) {
- commands[commands.length - 1].args = args;
- }
- commands.push({ name: arg, args: [] });
- }
- }, this);
- if (commands.length > 0) {
- commands[commands.length - 1].args = argv.splice(0);
- }
-
- // expand commands entries for multiple napi builds
- var dir = this.opts.directory;
- if (dir == null) dir = process.cwd();
- var package_json = JSON.parse(fs.readFileSync(path.join(dir,'package.json')));
-
- this.todo = napi.expand_commands (package_json, this.opts, commands);
-
- // support for inheriting config env variables from npm
- var npm_config_prefix = 'npm_config_';
- Object.keys(process.env).forEach(function (name) {
- if (name.indexOf(npm_config_prefix) !== 0) return;
- var val = process.env[name];
- if (name === npm_config_prefix + 'loglevel') {
- log.level = val;
- } else {
- // add the user-defined options to the config
- name = name.substring(npm_config_prefix.length);
- // avoid npm argv clobber already present args
- // which avoids problem of 'npm test' calling
- // script that runs unique npm install commands
- if (name === 'argv') {
- if (this.opts.argv &&
- this.opts.argv.remain &&
- this.opts.argv.remain.length) {
- // do nothing
- } else {
- this.opts[name] = val;
- }
- } else {
- this.opts[name] = val;
- }
- }
- }, this);
-
- if (this.opts.loglevel) {
- log.level = this.opts.loglevel;
- }
- log.resume();
-};
-
-/**
- * Returns the usage instructions for node-pre-gyp.
- */
-
-proto.usage = function usage () {
- var str = [
- '',
- ' Usage: node-pre-gyp [options]',
- '',
- ' where is one of:',
- commands.map(function (c) {
- return ' - ' + c + ' - ' + require('./' + c).usage;
- }).join('\n'),
- '',
- 'node-pre-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'),
- 'node@' + process.versions.node
- ].join('\n');
- return str;
-};
-
-/**
- * Version number getter.
- */
-
-Object.defineProperty(proto, 'version', {
- get: function () {
- return this.package.version;
- },
- enumerable: true
-});
-
-
-
-/***/ }),
-
-/***/ 92800:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var versioning = __nccwpck_require__(10887);
-var napi = __nccwpck_require__(10480);
-var existsSync = __nccwpck_require__(35747).existsSync || __nccwpck_require__(85622).existsSync;
-var path = __nccwpck_require__(85622);
-
-module.exports = exports;
-
-exports.usage = 'Finds the require path for the node-pre-gyp installed module';
-
-exports.validate = function(package_json,opts) {
- versioning.validate_config(package_json,opts);
-};
-
-exports.find = function(package_json_path,opts) {
- if (!existsSync(package_json_path)) {
- throw new Error("package.json does not exist at " + package_json_path);
- }
- var package_json = require(package_json_path);
- versioning.validate_config(package_json,opts);
- var napi_build_version;
- if (napi.get_napi_build_versions (package_json, opts)) {
- napi_build_version = napi.get_best_napi_build_version(package_json, opts);
- }
- opts = opts || {};
- if (!opts.module_root) opts.module_root = path.dirname(package_json_path);
- var meta = versioning.evaluate(package_json,opts,napi_build_version);
- return meta.module;
-};
-
-
-/***/ }),
-
-/***/ 10480:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var fs = __nccwpck_require__(35747);
-var rm = __nccwpck_require__(99120);
-var log = __nccwpck_require__(64314);
-
-module.exports = exports;
-
-var versionArray = process.version
- .substr(1)
- .replace(/-.*$/, '')
- .split('.')
- .map(function(item) {
- return +item;
- });
-
-var napi_multiple_commands = [
- 'build',
- 'clean',
- 'configure',
- 'package',
- 'publish',
- 'reveal',
- 'testbinary',
- 'testpackage',
- 'unpublish'
-];
-
-var napi_build_version_tag = 'napi_build_version=';
-
-module.exports.get_napi_version = function(target) { // target may be undefined
- // returns the non-zero numeric napi version or undefined if napi is not supported.
- // correctly supporting target requires an updated cross-walk
- var version = process.versions.napi; // can be undefined
- if (!version) { // this code should never need to be updated
- if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+
- else if (versionArray[0] === 8) version = 1; // 8.0.0+
- }
- return version;
-};
-
-module.exports.get_napi_version_as_string = function(target) {
- // returns the napi version as a string or an empty string if napi is not supported.
- var version = module.exports.get_napi_version(target);
- return version ? ''+version : '';
-};
-
-module.exports.validate_package_json = function(package_json, opts) { // throws Error
-
- var binary = package_json.binary;
- var module_path_ok = pathOK(binary.module_path);
- var remote_path_ok = pathOK(binary.remote_path);
- var package_name_ok = pathOK(binary.package_name);
- var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true);
- var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json);
-
- if (napi_build_versions) {
- napi_build_versions.forEach(function(napi_build_version){
- if (!(parseInt(napi_build_version,10) === napi_build_version && napi_build_version > 0)) {
- throw new Error("All values specified in napi_versions must be positive integers.");
- }
- });
- }
-
- if (napi_build_versions && (!module_path_ok || (!remote_path_ok && !package_name_ok))) {
- throw new Error("When napi_versions is specified; module_path and either remote_path or " +
- "package_name must contain the substitution string '{napi_build_version}`.");
- }
-
- if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) {
- throw new Error("When the substitution string '{napi_build_version}` is specified in " +
- "module_path, remote_path, or package_name; napi_versions must also be specified.");
- }
-
- if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) &&
- module.exports.build_napi_only(package_json)) {
- throw new Error(
- 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
- 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
- 'This Node instance cannot run this module.');
- }
-
- if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) {
- throw new Error(
- 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
- 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
- 'This Node instance cannot run this module.');
- }
-
-};
-
-function pathOK (path) {
- return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1);
-}
-
-module.exports.expand_commands = function(package_json, opts, commands) {
- var expanded_commands = [];
- var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts);
- commands.forEach(function(command){
- if (napi_build_versions && command.name === 'install') {
- var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts);
- var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ];
- expanded_commands.push ({ name: command.name, args: args });
- } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) {
- napi_build_versions.forEach(function(napi_build_version){
- var args = command.args.slice();
- args.push (napi_build_version_tag+napi_build_version);
- expanded_commands.push ({ name: command.name, args: args });
- });
- } else {
- expanded_commands.push (command);
- }
- });
- return expanded_commands;
-};
-
-module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined
- var napi_build_versions = [];
- var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
- // remove duplicates, verify each napi version can actaully be built
- if (package_json.binary && package_json.binary.napi_versions) {
- package_json.binary.napi_versions.forEach(function(napi_version) {
- var duplicated = napi_build_versions.indexOf(napi_version) !== -1;
- if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) {
- napi_build_versions.push(napi_version);
- } else if (warnings && !duplicated && supported_napi_version) {
- log.info('This Node instance does not support builds for N-API version', napi_version);
- }
- });
- }
- if (opts && opts["build-latest-napi-version-only"]) {
- var latest_version = 0;
- napi_build_versions.forEach(function(napi_version) {
- if (napi_version > latest_version) latest_version = napi_version;
- });
- napi_build_versions = latest_version ? [ latest_version ] : [];
- }
- return napi_build_versions.length ? napi_build_versions : undefined;
-};
-
-module.exports.get_napi_build_versions_raw = function(package_json) {
- var napi_build_versions = [];
- // remove duplicates
- if (package_json.binary && package_json.binary.napi_versions) {
- package_json.binary.napi_versions.forEach(function(napi_version) {
- if (napi_build_versions.indexOf(napi_version) === -1) {
- napi_build_versions.push(napi_version);
- }
- });
- }
- return napi_build_versions.length ? napi_build_versions : undefined;
-};
-
-module.exports.get_command_arg = function(napi_build_version) {
- return napi_build_version_tag + napi_build_version;
-};
-
-module.exports.get_napi_build_version_from_command_args = function(command_args) {
- for (var i = 0; i < command_args.length; i++) {
- var arg = command_args[i];
- if (arg.indexOf(napi_build_version_tag) === 0) {
- return parseInt(arg.substr(napi_build_version_tag.length),10);
- }
- }
- return undefined;
-};
-
-module.exports.swap_build_dir_out = function(napi_build_version) {
- if (napi_build_version) {
- rm.sync(module.exports.get_build_dir(napi_build_version));
- fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
- }
-};
-
-module.exports.swap_build_dir_in = function(napi_build_version) {
- if (napi_build_version) {
- rm.sync('build');
- fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
- }
-};
-
-module.exports.get_build_dir = function(napi_build_version) {
- return 'build-tmp-napi-v'+napi_build_version;
-};
-
-module.exports.get_best_napi_build_version = function(package_json, opts) {
- var best_napi_build_version = 0;
- var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts);
- if (napi_build_versions) {
- var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
- napi_build_versions.forEach(function(napi_build_version){
- if (napi_build_version > best_napi_build_version &&
- napi_build_version <= our_napi_version) {
- best_napi_build_version = napi_build_version;
- }
- });
- }
- return best_napi_build_version === 0 ? undefined : best_napi_build_version;
-};
-
-module.exports.build_napi_only = function(package_json) {
- return package_json.binary && package_json.binary.package_name &&
- package_json.binary.package_name.indexOf('{node_napi_label}') === -1;
-};
-
-/***/ }),
-
-/***/ 10887:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-module.exports = exports;
-
-var path = __nccwpck_require__(85622);
-var semver = __nccwpck_require__(2964);
-var url = __nccwpck_require__(78835);
-var detect_libc = __nccwpck_require__(34889);
-var napi = __nccwpck_require__(10480);
-
-var abi_crosswalk;
-
-// This is used for unit testing to provide a fake
-// ABI crosswalk that emulates one that is not updated
-// for the current version
-if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) {
- abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK);
-} else {
- abi_crosswalk = __nccwpck_require__(60282);
-}
-
-var major_versions = {};
-Object.keys(abi_crosswalk).forEach(function(v) {
- var major = v.split('.')[0];
- if (!major_versions[major]) {
- major_versions[major] = v;
- }
-});
-
-function get_electron_abi(runtime, target_version) {
- if (!runtime) {
- throw new Error("get_electron_abi requires valid runtime arg");
- }
- if (typeof target_version === 'undefined') {
- // erroneous CLI call
- throw new Error("Empty target version is not supported if electron is the target.");
- }
- // Electron guarantees that patch version update won't break native modules.
- var sem_ver = semver.parse(target_version);
- return runtime + '-v' + sem_ver.major + '.' + sem_ver.minor;
-}
-module.exports.get_electron_abi = get_electron_abi;
-
-function get_node_webkit_abi(runtime, target_version) {
- if (!runtime) {
- throw new Error("get_node_webkit_abi requires valid runtime arg");
- }
- if (typeof target_version === 'undefined') {
- // erroneous CLI call
- throw new Error("Empty target version is not supported if node-webkit is the target.");
- }
- return runtime + '-v' + target_version;
-}
-module.exports.get_node_webkit_abi = get_node_webkit_abi;
-
-function get_node_abi(runtime, versions) {
- if (!runtime) {
- throw new Error("get_node_abi requires valid runtime arg");
- }
- if (!versions) {
- throw new Error("get_node_abi requires valid process.versions object");
- }
- var sem_ver = semver.parse(versions.node);
- if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series
- // https://github.com/mapbox/node-pre-gyp/issues/124
- return runtime+'-v'+versions.node;
- } else {
- // process.versions.modules added in >= v0.10.4 and v0.11.7
- // https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e
- return versions.modules ? runtime+'-v' + (+versions.modules) :
- 'v8-' + versions.v8.split('.').slice(0,2).join('.');
- }
-}
-module.exports.get_node_abi = get_node_abi;
-
-function get_runtime_abi(runtime, target_version) {
- if (!runtime) {
- throw new Error("get_runtime_abi requires valid runtime arg");
- }
- if (runtime === 'node-webkit') {
- return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']);
- } else if (runtime === 'electron') {
- return get_electron_abi(runtime, target_version || process.versions.electron);
- } else {
- if (runtime != 'node') {
- throw new Error("Unknown Runtime: '" + runtime + "'");
- }
- if (!target_version) {
- return get_node_abi(runtime,process.versions);
- } else {
- var cross_obj;
- // abi_crosswalk generated with ./scripts/abi_crosswalk.js
- if (abi_crosswalk[target_version]) {
- cross_obj = abi_crosswalk[target_version];
- } else {
- var target_parts = target_version.split('.').map(function(i) { return +i; });
- if (target_parts.length != 3) { // parse failed
- throw new Error("Unknown target version: " + target_version);
- }
- /*
- The below code tries to infer the last known ABI compatible version
- that we have recorded in the abi_crosswalk.json when an exact match
- is not possible. The reasons for this to exist are complicated:
-
- - We support passing --target to be able to allow developers to package binaries for versions of node
- that are not the same one as they are running. This might also be used in combination with the
- --target_arch or --target_platform flags to also package binaries for alternative platforms
- - When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node
- version that is running in memory
- - So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look
- this info up for all versions
- - But we cannot easily predict what the future ABI will be for released versions
- - And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly
- by being fully available at install time.
- - So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release
- need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if
- you want the `--target` flag to keep working for the latest version
- - Which is impractical ^^
- - Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding.
-
- In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that
- only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be
- ABI compatible with v0.10.33).
-
- TODO: use semver module instead of custom version parsing
- */
- var major = target_parts[0];
- var minor = target_parts[1];
- var patch = target_parts[2];
- // io.js: yeah if node.js ever releases 1.x this will break
- // but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616
- if (major === 1) {
- // look for last release that is the same major version
- // e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0
- while (true) {
- if (minor > 0) --minor;
- if (patch > 0) --patch;
- var new_iojs_target = '' + major + '.' + minor + '.' + patch;
- if (abi_crosswalk[new_iojs_target]) {
- cross_obj = abi_crosswalk[new_iojs_target];
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
- console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target');
- break;
- }
- if (minor === 0 && patch === 0) {
- break;
- }
- }
- } else if (major >= 2) {
- // look for last release that is the same major version
- if (major_versions[major]) {
- cross_obj = abi_crosswalk[major_versions[major]];
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
- console.log('Warning: but node-pre-gyp successfully choose ' + major_versions[major] + ' as ABI compatible target');
- }
- } else if (major === 0) { // node.js
- if (target_parts[1] % 2 === 0) { // for stable/even node.js series
- // look for the last release that is the same minor release
- // e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0
- while (--patch > 0) {
- var new_node_target = '' + major + '.' + minor + '.' + patch;
- if (abi_crosswalk[new_node_target]) {
- cross_obj = abi_crosswalk[new_node_target];
- console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
- console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target');
- break;
- }
- }
- }
- }
- }
- if (!cross_obj) {
- throw new Error("Unsupported target version: " + target_version);
- }
- // emulate process.versions
- var versions_obj = {
- node: target_version,
- v8: cross_obj.v8+'.0',
- // abi_crosswalk uses 1 for node versions lacking process.versions.modules
- // process.versions.modules added in >= v0.10.4 and v0.11.7
- modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined
- };
- return get_node_abi(runtime, versions_obj);
- }
- }
-}
-module.exports.get_runtime_abi = get_runtime_abi;
-
-var required_parameters = [
- 'module_name',
- 'module_path',
- 'host'
-];
-
-function validate_config(package_json,opts) {
- var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';
- var missing = [];
- if (!package_json.main) {
- missing.push('main');
- }
- if (!package_json.version) {
- missing.push('version');
- }
- if (!package_json.name) {
- missing.push('name');
- }
- if (!package_json.binary) {
- missing.push('binary');
- }
- var o = package_json.binary;
- required_parameters.forEach(function(p) {
- if (missing.indexOf('binary') > -1) {
- missing.pop('binary');
- }
- if (!o || o[p] === undefined || o[p] === "") {
- missing.push('binary.' + p);
- }
- });
- if (missing.length >= 1) {
- throw new Error(msg+"package.json must declare these properties: \n" + missing.join('\n'));
- }
- if (o) {
- // enforce https over http
- var protocol = url.parse(o.host).protocol;
- if (protocol === 'http:') {
- throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted");
- }
- }
- napi.validate_package_json(package_json,opts);
-}
-
-module.exports.validate_config = validate_config;
-
-function eval_template(template,opts) {
- Object.keys(opts).forEach(function(key) {
- var pattern = '{'+key+'}';
- while (template.indexOf(pattern) > -1) {
- template = template.replace(pattern,opts[key]);
- }
- });
- return template;
-}
-
-// url.resolve needs single trailing slash
-// to behave correctly, otherwise a double slash
-// may end up in the url which breaks requests
-// and a lacking slash may not lead to proper joining
-function fix_slashes(pathname) {
- if (pathname.slice(-1) != '/') {
- return pathname + '/';
- }
- return pathname;
-}
-
-// remove double slashes
-// note: path.normalize will not work because
-// it will convert forward to back slashes
-function drop_double_slashes(pathname) {
- return pathname.replace(/\/\//g,'/');
-}
-
-function get_process_runtime(versions) {
- var runtime = 'node';
- if (versions['node-webkit']) {
- runtime = 'node-webkit';
- } else if (versions.electron) {
- runtime = 'electron';
- }
- return runtime;
-}
-
-module.exports.get_process_runtime = get_process_runtime;
-
-var default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz';
-var default_remote_path = '';
-
-module.exports.evaluate = function(package_json,options,napi_build_version) {
- options = options || {};
- validate_config(package_json,options); // options is a suitable substitute for opts in this case
- var v = package_json.version;
- var module_version = semver.parse(v);
- var runtime = options.runtime || get_process_runtime(process.versions);
- var opts = {
- name: package_json.name,
- configuration: Boolean(options.debug) ? 'Debug' : 'Release',
- debug: options.debug,
- module_name: package_json.binary.module_name,
- version: module_version.version,
- prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '',
- build: module_version.build.length ? module_version.build.join('.') : '',
- major: module_version.major,
- minor: module_version.minor,
- patch: module_version.patch,
- runtime: runtime,
- node_abi: get_runtime_abi(runtime,options.target),
- node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target),
- napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported
- napi_build_version: napi_build_version || '',
- node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target),
- target: options.target || '',
- platform: options.target_platform || process.platform,
- target_platform: options.target_platform || process.platform,
- arch: options.target_arch || process.arch,
- target_arch: options.target_arch || process.arch,
- libc: options.target_libc || detect_libc.family || 'unknown',
- module_main: package_json.main,
- toolset : options.toolset || '' // address https://github.com/mapbox/node-pre-gyp/issues/119
- };
- // support host mirror with npm config `--{module_name}_binary_host_mirror`
- // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25
- // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/
- var host = process.env['npm_config_' + opts.module_name + '_binary_host_mirror'] || package_json.binary.host;
- opts.host = fix_slashes(eval_template(host,opts));
- opts.module_path = eval_template(package_json.binary.module_path,opts);
- // now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably
- if (options.module_root) {
- // resolve relative to known module root: works for pre-binding require
- opts.module_path = path.join(options.module_root,opts.module_path);
- } else {
- // resolve relative to current working directory: works for node-pre-gyp commands
- opts.module_path = path.resolve(opts.module_path);
- }
- opts.module = path.join(opts.module_path,opts.module_name + '.node');
- opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path,opts))) : default_remote_path;
- var package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name;
- opts.package_name = eval_template(package_name,opts);
- opts.staged_tarball = path.join('build/stage',opts.remote_path,opts.package_name);
- opts.hosted_path = url.resolve(opts.host,opts.remote_path);
- opts.hosted_tarball = url.resolve(opts.hosted_path,opts.package_name);
- return opts;
-};
-
-
-/***/ }),
-
-/***/ 41743:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-// info about each config option.
-
-var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
- ? function () { console.error.apply(console, arguments) }
- : function () {}
-
-var url = __nccwpck_require__(78835)
- , path = __nccwpck_require__(85622)
- , Stream = __nccwpck_require__(92413).Stream
- , abbrev = __nccwpck_require__(48566)
- , osenv = __nccwpck_require__(84669)
-
-module.exports = exports = nopt
-exports.clean = clean
-
-exports.typeDefs =
- { String : { type: String, validate: validateString }
- , Boolean : { type: Boolean, validate: validateBoolean }
- , url : { type: url, validate: validateUrl }
- , Number : { type: Number, validate: validateNumber }
- , path : { type: path, validate: validatePath }
- , Stream : { type: Stream, validate: validateStream }
- , Date : { type: Date, validate: validateDate }
- }
-
-function nopt (types, shorthands, args, slice) {
- args = args || process.argv
- types = types || {}
- shorthands = shorthands || {}
- if (typeof slice !== "number") slice = 2
-
- debug(types, shorthands, args, slice)
-
- args = args.slice(slice)
- var data = {}
- , key
- , argv = {
- remain: [],
- cooked: args,
- original: args.slice(0)
- }
-
- parse(args, data, argv.remain, types, shorthands)
- // now data is full
- clean(data, types, exports.typeDefs)
- data.argv = argv
- Object.defineProperty(data.argv, 'toString', { value: function () {
- return this.original.map(JSON.stringify).join(" ")
- }, enumerable: false })
- return data
-}
-
-function clean (data, types, typeDefs) {
- typeDefs = typeDefs || exports.typeDefs
- var remove = {}
- , typeDefault = [false, true, null, String, Array]
-
- Object.keys(data).forEach(function (k) {
- if (k === "argv") return
- var val = data[k]
- , isArray = Array.isArray(val)
- , type = types[k]
- if (!isArray) val = [val]
- if (!type) type = typeDefault
- if (type === Array) type = typeDefault.concat(Array)
- if (!Array.isArray(type)) type = [type]
-
- debug("val=%j", val)
- debug("types=", type)
- val = val.map(function (val) {
- // if it's an unknown value, then parse false/true/null/numbers/dates
- if (typeof val === "string") {
- debug("string %j", val)
- val = val.trim()
- if ((val === "null" && ~type.indexOf(null))
- || (val === "true" &&
- (~type.indexOf(true) || ~type.indexOf(Boolean)))
- || (val === "false" &&
- (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
- val = JSON.parse(val)
- debug("jsonable %j", val)
- } else if (~type.indexOf(Number) && !isNaN(val)) {
- debug("convert to number", val)
- val = +val
- } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
- debug("convert to date", val)
- val = new Date(val)
- }
- }
-
- if (!types.hasOwnProperty(k)) {
- return val
- }
-
- // allow `--no-blah` to set 'blah' to null if null is allowed
- if (val === false && ~type.indexOf(null) &&
- !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
- val = null
- }
-
- var d = {}
- d[k] = val
- debug("prevalidated val", d, val, types[k])
- if (!validate(d, k, val, types[k], typeDefs)) {
- if (exports.invalidHandler) {
- exports.invalidHandler(k, val, types[k], data)
- } else if (exports.invalidHandler !== false) {
- debug("invalid: "+k+"="+val, types[k])
- }
- return remove
- }
- debug("validated val", d, val, types[k])
- return d[k]
- }).filter(function (val) { return val !== remove })
-
- // if we allow Array specifically, then an empty array is how we
- // express 'no value here', not null. Allow it.
- if (!val.length && type.indexOf(Array) === -1) {
- debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
- delete data[k]
- }
- else if (isArray) {
- debug(isArray, data[k], val)
- data[k] = val
- } else data[k] = val[0]
-
- debug("k=%s val=%j", k, val, data[k])
- })
-}
-
-function validateString (data, k, val) {
- data[k] = String(val)
-}
-
-function validatePath (data, k, val) {
- if (val === true) return false
- if (val === null) return true
-
- val = String(val)
-
- var isWin = process.platform === 'win32'
- , homePattern = isWin ? /^~(\/|\\)/ : /^~\//
- , home = osenv.home()
-
- if (home && val.match(homePattern)) {
- data[k] = path.resolve(home, val.substr(2))
- } else {
- data[k] = path.resolve(val)
- }
- return true
-}
-
-function validateNumber (data, k, val) {
- debug("validate Number %j %j %j", k, val, isNaN(val))
- if (isNaN(val)) return false
- data[k] = +val
-}
-
-function validateDate (data, k, val) {
- var s = Date.parse(val)
- debug("validate Date %j %j %j", k, val, s)
- if (isNaN(s)) return false
- data[k] = new Date(val)
-}
-
-function validateBoolean (data, k, val) {
- if (val instanceof Boolean) val = val.valueOf()
- else if (typeof val === "string") {
- if (!isNaN(val)) val = !!(+val)
- else if (val === "null" || val === "false") val = false
- else val = true
- } else val = !!val
- data[k] = val
-}
-
-function validateUrl (data, k, val) {
- val = url.parse(String(val))
- if (!val.host) return false
- data[k] = val.href
-}
-
-function validateStream (data, k, val) {
- if (!(val instanceof Stream)) return false
- data[k] = val
-}
-
-function validate (data, k, val, type, typeDefs) {
- // arrays are lists of types.
- if (Array.isArray(type)) {
- for (var i = 0, l = type.length; i < l; i ++) {
- if (type[i] === Array) continue
- if (validate(data, k, val, type[i], typeDefs)) return true
- }
- delete data[k]
- return false
- }
-
- // an array of anything?
- if (type === Array) return true
-
- // NaN is poisonous. Means that something is not allowed.
- if (type !== type) {
- debug("Poison NaN", k, val, type)
- delete data[k]
- return false
- }
-
- // explicit list of values
- if (val === type) {
- debug("Explicitly allowed %j", val)
- // if (isArray) (data[k] = data[k] || []).push(val)
- // else data[k] = val
- data[k] = val
- return true
- }
-
- // now go through the list of typeDefs, validate against each one.
- var ok = false
- , types = Object.keys(typeDefs)
- for (var i = 0, l = types.length; i < l; i ++) {
- debug("test type %j %j %j", k, val, types[i])
- var t = typeDefs[types[i]]
- if (t &&
- ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) {
- var d = {}
- ok = false !== t.validate(d, k, val)
- val = d[k]
- if (ok) {
- // if (isArray) (data[k] = data[k] || []).push(val)
- // else data[k] = val
- data[k] = val
- break
- }
- }
- }
- debug("OK? %j (%j %j %j)", ok, k, val, types[i])
-
- if (!ok) delete data[k]
- return ok
-}
-
-function parse (args, data, remain, types, shorthands) {
- debug("parse", args, data, remain)
-
- var key = null
- , abbrevs = abbrev(Object.keys(types))
- , shortAbbr = abbrev(Object.keys(shorthands))
-
- for (var i = 0; i < args.length; i ++) {
- var arg = args[i]
- debug("arg", arg)
-
- if (arg.match(/^-{2,}$/)) {
- // done with keys.
- // the rest are args.
- remain.push.apply(remain, args.slice(i + 1))
- args[i] = "--"
- break
- }
- var hadEq = false
- if (arg.charAt(0) === "-" && arg.length > 1) {
- var at = arg.indexOf('=')
- if (at > -1) {
- hadEq = true
- var v = arg.substr(at + 1)
- arg = arg.substr(0, at)
- args.splice(i, 1, arg, v)
- }
-
- // see if it's a shorthand
- // if so, splice and back up to re-parse it.
- var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
- debug("arg=%j shRes=%j", arg, shRes)
- if (shRes) {
- debug(arg, shRes)
- args.splice.apply(args, [i, 1].concat(shRes))
- if (arg !== shRes[0]) {
- i --
- continue
- }
- }
- arg = arg.replace(/^-+/, "")
- var no = null
- while (arg.toLowerCase().indexOf("no-") === 0) {
- no = !no
- arg = arg.substr(3)
- }
-
- if (abbrevs[arg]) arg = abbrevs[arg]
-
- var argType = types[arg]
- var isTypeArray = Array.isArray(argType)
- if (isTypeArray && argType.length === 1) {
- isTypeArray = false
- argType = argType[0]
- }
-
- var isArray = argType === Array ||
- isTypeArray && argType.indexOf(Array) !== -1
-
- // allow unknown things to be arrays if specified multiple times.
- if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
- if (!Array.isArray(data[arg]))
- data[arg] = [data[arg]]
- isArray = true
- }
-
- var val
- , la = args[i + 1]
-
- var isBool = typeof no === 'boolean' ||
- argType === Boolean ||
- isTypeArray && argType.indexOf(Boolean) !== -1 ||
- (typeof argType === 'undefined' && !hadEq) ||
- (la === "false" &&
- (argType === null ||
- isTypeArray && ~argType.indexOf(null)))
-
- if (isBool) {
- // just set and move along
- val = !no
- // however, also support --bool true or --bool false
- if (la === "true" || la === "false") {
- val = JSON.parse(la)
- la = null
- if (no) val = !val
- i ++
- }
-
- // also support "foo":[Boolean, "bar"] and "--foo bar"
- if (isTypeArray && la) {
- if (~argType.indexOf(la)) {
- // an explicit type
- val = la
- i ++
- } else if ( la === "null" && ~argType.indexOf(null) ) {
- // null allowed
- val = null
- i ++
- } else if ( !la.match(/^-{2,}[^-]/) &&
- !isNaN(la) &&
- ~argType.indexOf(Number) ) {
- // number
- val = +la
- i ++
- } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) {
- // string
- val = la
- i ++
- }
- }
-
- if (isArray) (data[arg] = data[arg] || []).push(val)
- else data[arg] = val
-
- continue
- }
-
- if (argType === String) {
- if (la === undefined) {
- la = ""
- } else if (la.match(/^-{1,2}[^-]+/)) {
- la = ""
- i --
- }
- }
-
- if (la && la.match(/^-{2,}$/)) {
- la = undefined
- i --
- }
-
- val = la === undefined ? true : la
- if (isArray) (data[arg] = data[arg] || []).push(val)
- else data[arg] = val
-
- i ++
- continue
- }
- remain.push(arg)
- }
-}
-
-function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
- // handle single-char shorthands glommed together, like
- // npm ls -glp, but only if there is one dash, and only if
- // all of the chars are single-char shorthands, and it's
- // not a match to some other abbrev.
- arg = arg.replace(/^-+/, '')
-
- // if it's an exact known option, then don't go any further
- if (abbrevs[arg] === arg)
- return null
-
- // if it's an exact known shortopt, same deal
- if (shorthands[arg]) {
- // make it an array, if it's a list of words
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
- shorthands[arg] = shorthands[arg].split(/\s+/)
-
- return shorthands[arg]
- }
-
- // first check to see if this arg is a set of single-char shorthands
- var singles = shorthands.___singles
- if (!singles) {
- singles = Object.keys(shorthands).filter(function (s) {
- return s.length === 1
- }).reduce(function (l,r) {
- l[r] = true
- return l
- }, {})
- shorthands.___singles = singles
- debug('shorthand singles', singles)
- }
-
- var chrs = arg.split("").filter(function (c) {
- return singles[c]
- })
-
- if (chrs.join("") === arg) return chrs.map(function (c) {
- return shorthands[c]
- }).reduce(function (l, r) {
- return l.concat(r)
- }, [])
-
-
- // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
- if (abbrevs[arg] && !shorthands[arg])
- return null
-
- // if it's an abbr for a shorthand, then use that
- if (shortAbbr[arg])
- arg = shortAbbr[arg]
-
- // make it an array, if it's a list of words
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
- shorthands[arg] = shorthands[arg].split(/\s+/)
-
- return shorthands[arg]
-}
-
-
-/***/ }),
-
-/***/ 99120:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-module.exports = rimraf
-rimraf.sync = rimrafSync
-
-var assert = __nccwpck_require__(42357)
-var path = __nccwpck_require__(85622)
-var fs = __nccwpck_require__(35747)
-var glob = undefined
-try {
- glob = __nccwpck_require__(91957)
-} catch (_err) {
- // treat glob as optional.
-}
-var _0666 = parseInt('666', 8)
-
-var defaultGlobOpts = {
- nosort: true,
- silent: true
-}
-
-// for EMFILE handling
-var timeout = 0
-
-var isWindows = (process.platform === "win32")
-
-function defaults (options) {
- var methods = [
- 'unlink',
- 'chmod',
- 'stat',
- 'lstat',
- 'rmdir',
- 'readdir'
- ]
- methods.forEach(function(m) {
- options[m] = options[m] || fs[m]
- m = m + 'Sync'
- options[m] = options[m] || fs[m]
- })
-
- options.maxBusyTries = options.maxBusyTries || 3
- options.emfileWait = options.emfileWait || 1000
- if (options.glob === false) {
- options.disableGlob = true
- }
- if (options.disableGlob !== true && glob === undefined) {
- throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
- }
- options.disableGlob = options.disableGlob || false
- options.glob = options.glob || defaultGlobOpts
-}
-
-function rimraf (p, options, cb) {
- if (typeof options === 'function') {
- cb = options
- options = {}
- }
-
- assert(p, 'rimraf: missing path')
- assert.equal(typeof p, 'string', 'rimraf: path should be a string')
- assert.equal(typeof cb, 'function', 'rimraf: callback function required')
- assert(options, 'rimraf: invalid options argument provided')
- assert.equal(typeof options, 'object', 'rimraf: options should be object')
-
- defaults(options)
-
- var busyTries = 0
- var errState = null
- var n = 0
-
- if (options.disableGlob || !glob.hasMagic(p))
- return afterGlob(null, [p])
-
- options.lstat(p, function (er, stat) {
- if (!er)
- return afterGlob(null, [p])
-
- glob(p, options.glob, afterGlob)
- })
-
- function next (er) {
- errState = errState || er
- if (--n === 0)
- cb(errState)
- }
-
- function afterGlob (er, results) {
- if (er)
- return cb(er)
-
- n = results.length
- if (n === 0)
- return cb()
-
- results.forEach(function (p) {
- rimraf_(p, options, function CB (er) {
- if (er) {
- if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
- busyTries < options.maxBusyTries) {
- busyTries ++
- var time = busyTries * 100
- // try again, with the same exact callback as this one.
- return setTimeout(function () {
- rimraf_(p, options, CB)
- }, time)
- }
-
- // this one won't happen if graceful-fs is used.
- if (er.code === "EMFILE" && timeout < options.emfileWait) {
- return setTimeout(function () {
- rimraf_(p, options, CB)
- }, timeout ++)
- }
-
- // already gone
- if (er.code === "ENOENT") er = null
- }
-
- timeout = 0
- next(er)
- })
- })
- }
-}
-
-// Two possible strategies.
-// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
-// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
-//
-// Both result in an extra syscall when you guess wrong. However, there
-// are likely far more normal files in the world than directories. This
-// is based on the assumption that a the average number of files per
-// directory is >= 1.
-//
-// If anyone ever complains about this, then I guess the strategy could
-// be made configurable somehow. But until then, YAGNI.
-function rimraf_ (p, options, cb) {
- assert(p)
- assert(options)
- assert(typeof cb === 'function')
-
- // sunos lets the root user unlink directories, which is... weird.
- // so we have to lstat here and make sure it's not a dir.
- options.lstat(p, function (er, st) {
- if (er && er.code === "ENOENT")
- return cb(null)
-
- // Windows can EPERM on stat. Life is suffering.
- if (er && er.code === "EPERM" && isWindows)
- fixWinEPERM(p, options, er, cb)
-
- if (st && st.isDirectory())
- return rmdir(p, options, er, cb)
-
- options.unlink(p, function (er) {
- if (er) {
- if (er.code === "ENOENT")
- return cb(null)
- if (er.code === "EPERM")
- return (isWindows)
- ? fixWinEPERM(p, options, er, cb)
- : rmdir(p, options, er, cb)
- if (er.code === "EISDIR")
- return rmdir(p, options, er, cb)
- }
- return cb(er)
- })
- })
-}
-
-function fixWinEPERM (p, options, er, cb) {
- assert(p)
- assert(options)
- assert(typeof cb === 'function')
- if (er)
- assert(er instanceof Error)
-
- options.chmod(p, _0666, function (er2) {
- if (er2)
- cb(er2.code === "ENOENT" ? null : er)
- else
- options.stat(p, function(er3, stats) {
- if (er3)
- cb(er3.code === "ENOENT" ? null : er)
- else if (stats.isDirectory())
- rmdir(p, options, er, cb)
- else
- options.unlink(p, cb)
- })
- })
-}
-
-function fixWinEPERMSync (p, options, er) {
- assert(p)
- assert(options)
- if (er)
- assert(er instanceof Error)
-
- try {
- options.chmodSync(p, _0666)
- } catch (er2) {
- if (er2.code === "ENOENT")
- return
- else
- throw er
- }
-
- try {
- var stats = options.statSync(p)
- } catch (er3) {
- if (er3.code === "ENOENT")
- return
- else
- throw er
- }
-
- if (stats.isDirectory())
- rmdirSync(p, options, er)
- else
- options.unlinkSync(p)
-}
-
-function rmdir (p, options, originalEr, cb) {
- assert(p)
- assert(options)
- if (originalEr)
- assert(originalEr instanceof Error)
- assert(typeof cb === 'function')
-
- // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
- // if we guessed wrong, and it's not a directory, then
- // raise the original error.
- options.rmdir(p, function (er) {
- if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
- rmkids(p, options, cb)
- else if (er && er.code === "ENOTDIR")
- cb(originalEr)
- else
- cb(er)
- })
-}
-
-function rmkids(p, options, cb) {
- assert(p)
- assert(options)
- assert(typeof cb === 'function')
-
- options.readdir(p, function (er, files) {
- if (er)
- return cb(er)
- var n = files.length
- if (n === 0)
- return options.rmdir(p, cb)
- var errState
- files.forEach(function (f) {
- rimraf(path.join(p, f), options, function (er) {
- if (errState)
- return
- if (er)
- return cb(errState = er)
- if (--n === 0)
- options.rmdir(p, cb)
- })
- })
- })
-}
-
-// this looks simpler, and is strictly *faster*, but will
-// tie up the JavaScript thread and fail on excessively
-// deep directory trees.
-function rimrafSync (p, options) {
- options = options || {}
- defaults(options)
-
- assert(p, 'rimraf: missing path')
- assert.equal(typeof p, 'string', 'rimraf: path should be a string')
- assert(options, 'rimraf: missing options')
- assert.equal(typeof options, 'object', 'rimraf: options should be object')
-
- var results
-
- if (options.disableGlob || !glob.hasMagic(p)) {
- results = [p]
- } else {
- try {
- options.lstatSync(p)
- results = [p]
- } catch (er) {
- results = glob.sync(p, options.glob)
- }
- }
-
- if (!results.length)
- return
-
- for (var i = 0; i < results.length; i++) {
- var p = results[i]
-
- try {
- var st = options.lstatSync(p)
- } catch (er) {
- if (er.code === "ENOENT")
- return
-
- // Windows can EPERM on stat. Life is suffering.
- if (er.code === "EPERM" && isWindows)
- fixWinEPERMSync(p, options, er)
- }
-
- try {
- // sunos lets the root user unlink directories, which is... weird.
- if (st && st.isDirectory())
- rmdirSync(p, options, null)
- else
- options.unlinkSync(p)
- } catch (er) {
- if (er.code === "ENOENT")
- return
- if (er.code === "EPERM")
- return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
- if (er.code !== "EISDIR")
- throw er
-
- rmdirSync(p, options, er)
- }
- }
-}
-
-function rmdirSync (p, options, originalEr) {
- assert(p)
- assert(options)
- if (originalEr)
- assert(originalEr instanceof Error)
-
- try {
- options.rmdirSync(p)
- } catch (er) {
- if (er.code === "ENOENT")
- return
- if (er.code === "ENOTDIR")
- throw originalEr
- if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
- rmkidsSync(p, options)
- }
-}
-
-function rmkidsSync (p, options) {
- assert(p)
- assert(options)
- options.readdirSync(p).forEach(function (f) {
- rimrafSync(path.join(p, f), options)
- })
-
- // We only end up here once we got ENOTEMPTY at least once, and
- // at this point, we are guaranteed to have removed all the kids.
- // So, we know that it won't be ENOENT or ENOTDIR or anything else.
- // try really hard to delete stuff on windows, because it has a
- // PROFOUNDLY annoying habit of not closing handles promptly when
- // files are deleted, resulting in spurious ENOTEMPTY errors.
- var retries = isWindows ? 100 : 1
- var i = 0
- do {
- var threw = true
- try {
- var ret = options.rmdirSync(p, options)
- threw = false
- return ret
- } finally {
- if (++i < retries && threw)
- continue
- }
- } while (true)
-}
-
-
-/***/ }),
-
-/***/ 2964:
-/***/ ((module, exports) => {
-
-exports = module.exports = SemVer
-
-var debug
-/* istanbul ignore next */
-if (typeof process === 'object' &&
- process.env &&
- process.env.NODE_DEBUG &&
- /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
- debug = function () {
- var args = Array.prototype.slice.call(arguments, 0)
- args.unshift('SEMVER')
- console.log.apply(console, args)
- }
-} else {
- debug = function () {}
-}
-
-// Note: this is the semver.org version of the spec that it implements
-// Not necessarily the package version of this code.
-exports.SEMVER_SPEC_VERSION = '2.0.0'
-
-var MAX_LENGTH = 256
-var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
- /* istanbul ignore next */ 9007199254740991
-
-// Max safe segment length for coercion.
-var MAX_SAFE_COMPONENT_LENGTH = 16
-
-// The actual regexps go on exports.re
-var re = exports.re = []
-var src = exports.src = []
-var R = 0
-
-// The following Regular Expressions can be used for tokenizing,
-// validating, and parsing SemVer version strings.
-
-// ## Numeric Identifier
-// A single `0`, or a non-zero digit followed by zero or more digits.
-
-var NUMERICIDENTIFIER = R++
-src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
-var NUMERICIDENTIFIERLOOSE = R++
-src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
-
-// ## Non-numeric Identifier
-// Zero or more digits, followed by a letter or hyphen, and then zero or
-// more letters, digits, or hyphens.
-
-var NONNUMERICIDENTIFIER = R++
-src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
-
-// ## Main Version
-// Three dot-separated numeric identifiers.
-
-var MAINVERSION = R++
-src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
- '(' + src[NUMERICIDENTIFIER] + ')\\.' +
- '(' + src[NUMERICIDENTIFIER] + ')'
-
-var MAINVERSIONLOOSE = R++
-src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
-
-// ## Pre-release Version Identifier
-// A numeric identifier, or a non-numeric identifier.
-
-var PRERELEASEIDENTIFIER = R++
-src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
- '|' + src[NONNUMERICIDENTIFIER] + ')'
-
-var PRERELEASEIDENTIFIERLOOSE = R++
-src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
- '|' + src[NONNUMERICIDENTIFIER] + ')'
-
-// ## Pre-release Version
-// Hyphen, followed by one or more dot-separated pre-release version
-// identifiers.
-
-var PRERELEASE = R++
-src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
- '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
-
-var PRERELEASELOOSE = R++
-src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
- '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
-
-// ## Build Metadata Identifier
-// Any combination of digits, letters, or hyphens.
-
-var BUILDIDENTIFIER = R++
-src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
-
-// ## Build Metadata
-// Plus sign, followed by one or more period-separated build metadata
-// identifiers.
-
-var BUILD = R++
-src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
- '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
-
-// ## Full Version String
-// A main version, followed optionally by a pre-release version and
-// build metadata.
-
-// Note that the only major, minor, patch, and pre-release sections of
-// the version string are capturing groups. The build metadata is not a
-// capturing group, because it should not ever be used in version
-// comparison.
-
-var FULL = R++
-var FULLPLAIN = 'v?' + src[MAINVERSION] +
- src[PRERELEASE] + '?' +
- src[BUILD] + '?'
-
-src[FULL] = '^' + FULLPLAIN + '$'
-
-// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
-// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
-// common in the npm registry.
-var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
- src[PRERELEASELOOSE] + '?' +
- src[BUILD] + '?'
-
-var LOOSE = R++
-src[LOOSE] = '^' + LOOSEPLAIN + '$'
-
-var GTLT = R++
-src[GTLT] = '((?:<|>)?=?)'
-
-// Something like "2.*" or "1.2.x".
-// Note that "x.x" is a valid xRange identifer, meaning "any version"
-// Only the first item is strictly required.
-var XRANGEIDENTIFIERLOOSE = R++
-src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
-var XRANGEIDENTIFIER = R++
-src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
-
-var XRANGEPLAIN = R++
-src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:' + src[PRERELEASE] + ')?' +
- src[BUILD] + '?' +
- ')?)?'
-
-var XRANGEPLAINLOOSE = R++
-src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:' + src[PRERELEASELOOSE] + ')?' +
- src[BUILD] + '?' +
- ')?)?'
-
-var XRANGE = R++
-src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
-var XRANGELOOSE = R++
-src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
-
-// Coercion.
-// Extract anything that could conceivably be a part of a valid semver
-var COERCE = R++
-src[COERCE] = '(?:^|[^\\d])' +
- '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
- '(?:$|[^\\d])'
-
-// Tilde ranges.
-// Meaning is "reasonably at or greater than"
-var LONETILDE = R++
-src[LONETILDE] = '(?:~>?)'
-
-var TILDETRIM = R++
-src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
-re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
-var tildeTrimReplace = '$1~'
-
-var TILDE = R++
-src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
-var TILDELOOSE = R++
-src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
-
-// Caret ranges.
-// Meaning is "at least and backwards compatible with"
-var LONECARET = R++
-src[LONECARET] = '(?:\\^)'
-
-var CARETTRIM = R++
-src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
-re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
-var caretTrimReplace = '$1^'
-
-var CARET = R++
-src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
-var CARETLOOSE = R++
-src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
-
-// A simple gt/lt/eq thing, or just "" to indicate "any version"
-var COMPARATORLOOSE = R++
-src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
-var COMPARATOR = R++
-src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
-
-// An expression to strip any whitespace between the gtlt and the thing
-// it modifies, so that `> 1.2.3` ==> `>1.2.3`
-var COMPARATORTRIM = R++
-src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
- '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
-
-// this one has to use the /g flag
-re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
-var comparatorTrimReplace = '$1$2$3'
-
-// Something like `1.2.3 - 1.2.4`
-// Note that these all use the loose form, because they'll be
-// checked against either the strict or loose comparator form
-// later.
-var HYPHENRANGE = R++
-src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
- '\\s+-\\s+' +
- '(' + src[XRANGEPLAIN] + ')' +
- '\\s*$'
-
-var HYPHENRANGELOOSE = R++
-src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
- '\\s+-\\s+' +
- '(' + src[XRANGEPLAINLOOSE] + ')' +
- '\\s*$'
-
-// Star ranges basically just allow anything at all.
-var STAR = R++
-src[STAR] = '(<|>)?=?\\s*\\*'
-
-// Compile to actual regexp objects.
-// All are flag-free, unless they were created above with a flag.
-for (var i = 0; i < R; i++) {
- debug(i, src[i])
- if (!re[i]) {
- re[i] = new RegExp(src[i])
- }
-}
-
-exports.parse = parse
-function parse (version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- }
- }
-
- if (version instanceof SemVer) {
- return version
- }
-
- if (typeof version !== 'string') {
- return null
- }
-
- if (version.length > MAX_LENGTH) {
- return null
- }
-
- var r = options.loose ? re[LOOSE] : re[FULL]
- if (!r.test(version)) {
- return null
- }
-
- try {
- return new SemVer(version, options)
- } catch (er) {
- return null
- }
-}
-
-exports.valid = valid
-function valid (version, options) {
- var v = parse(version, options)
- return v ? v.version : null
-}
-
-exports.clean = clean
-function clean (version, options) {
- var s = parse(version.trim().replace(/^[=v]+/, ''), options)
- return s ? s.version : null
-}
-
-exports.SemVer = SemVer
-
-function SemVer (version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- }
- }
- if (version instanceof SemVer) {
- if (version.loose === options.loose) {
- return version
- } else {
- version = version.version
- }
- } else if (typeof version !== 'string') {
- throw new TypeError('Invalid Version: ' + version)
- }
-
- if (version.length > MAX_LENGTH) {
- throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
- }
-
- if (!(this instanceof SemVer)) {
- return new SemVer(version, options)
- }
-
- debug('SemVer', version, options)
- this.options = options
- this.loose = !!options.loose
-
- var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
-
- if (!m) {
- throw new TypeError('Invalid Version: ' + version)
- }
-
- this.raw = version
-
- // these are actually numbers
- this.major = +m[1]
- this.minor = +m[2]
- this.patch = +m[3]
-
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
- throw new TypeError('Invalid major version')
- }
-
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
- throw new TypeError('Invalid minor version')
- }
-
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
- throw new TypeError('Invalid patch version')
- }
-
- // numberify any prerelease numeric ids
- if (!m[4]) {
- this.prerelease = []
- } else {
- this.prerelease = m[4].split('.').map(function (id) {
- if (/^[0-9]+$/.test(id)) {
- var num = +id
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
- return num
- }
- }
- return id
- })
- }
-
- this.build = m[5] ? m[5].split('.') : []
- this.format()
-}
-
-SemVer.prototype.format = function () {
- this.version = this.major + '.' + this.minor + '.' + this.patch
- if (this.prerelease.length) {
- this.version += '-' + this.prerelease.join('.')
- }
- return this.version
-}
-
-SemVer.prototype.toString = function () {
- return this.version
-}
-
-SemVer.prototype.compare = function (other) {
- debug('SemVer.compare', this.version, this.options, other)
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options)
- }
-
- return this.compareMain(other) || this.comparePre(other)
-}
-
-SemVer.prototype.compareMain = function (other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options)
- }
-
- return compareIdentifiers(this.major, other.major) ||
- compareIdentifiers(this.minor, other.minor) ||
- compareIdentifiers(this.patch, other.patch)
-}
-
-SemVer.prototype.comparePre = function (other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options)
- }
-
- // NOT having a prerelease is > having one
- if (this.prerelease.length && !other.prerelease.length) {
- return -1
- } else if (!this.prerelease.length && other.prerelease.length) {
- return 1
- } else if (!this.prerelease.length && !other.prerelease.length) {
- return 0
- }
-
- var i = 0
- do {
- var a = this.prerelease[i]
- var b = other.prerelease[i]
- debug('prerelease compare', i, a, b)
- if (a === undefined && b === undefined) {
- return 0
- } else if (b === undefined) {
- return 1
- } else if (a === undefined) {
- return -1
- } else if (a === b) {
- continue
- } else {
- return compareIdentifiers(a, b)
- }
- } while (++i)
-}
-
-// preminor will bump the version up to the next minor release, and immediately
-// down to pre-release. premajor and prepatch work the same way.
-SemVer.prototype.inc = function (release, identifier) {
- switch (release) {
- case 'premajor':
- this.prerelease.length = 0
- this.patch = 0
- this.minor = 0
- this.major++
- this.inc('pre', identifier)
- break
- case 'preminor':
- this.prerelease.length = 0
- this.patch = 0
- this.minor++
- this.inc('pre', identifier)
- break
- case 'prepatch':
- // If this is already a prerelease, it will bump to the next version
- // drop any prereleases that might already exist, since they are not
- // relevant at this point.
- this.prerelease.length = 0
- this.inc('patch', identifier)
- this.inc('pre', identifier)
- break
- // If the input is a non-prerelease version, this acts the same as
- // prepatch.
- case 'prerelease':
- if (this.prerelease.length === 0) {
- this.inc('patch', identifier)
- }
- this.inc('pre', identifier)
- break
-
- case 'major':
- // If this is a pre-major version, bump up to the same major version.
- // Otherwise increment major.
- // 1.0.0-5 bumps to 1.0.0
- // 1.1.0 bumps to 2.0.0
- if (this.minor !== 0 ||
- this.patch !== 0 ||
- this.prerelease.length === 0) {
- this.major++
- }
- this.minor = 0
- this.patch = 0
- this.prerelease = []
- break
- case 'minor':
- // If this is a pre-minor version, bump up to the same minor version.
- // Otherwise increment minor.
- // 1.2.0-5 bumps to 1.2.0
- // 1.2.1 bumps to 1.3.0
- if (this.patch !== 0 || this.prerelease.length === 0) {
- this.minor++
- }
- this.patch = 0
- this.prerelease = []
- break
- case 'patch':
- // If this is not a pre-release version, it will increment the patch.
- // If it is a pre-release it will bump up to the same patch version.
- // 1.2.0-5 patches to 1.2.0
- // 1.2.0 patches to 1.2.1
- if (this.prerelease.length === 0) {
- this.patch++
- }
- this.prerelease = []
- break
- // This probably shouldn't be used publicly.
- // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
- case 'pre':
- if (this.prerelease.length === 0) {
- this.prerelease = [0]
- } else {
- var i = this.prerelease.length
- while (--i >= 0) {
- if (typeof this.prerelease[i] === 'number') {
- this.prerelease[i]++
- i = -2
- }
- }
- if (i === -1) {
- // didn't increment anything
- this.prerelease.push(0)
- }
- }
- if (identifier) {
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
- if (this.prerelease[0] === identifier) {
- if (isNaN(this.prerelease[1])) {
- this.prerelease = [identifier, 0]
- }
- } else {
- this.prerelease = [identifier, 0]
- }
- }
- break
-
- default:
- throw new Error('invalid increment argument: ' + release)
- }
- this.format()
- this.raw = this.version
- return this
-}
-
-exports.inc = inc
-function inc (version, release, loose, identifier) {
- if (typeof (loose) === 'string') {
- identifier = loose
- loose = undefined
- }
-
- try {
- return new SemVer(version, loose).inc(release, identifier).version
- } catch (er) {
- return null
- }
-}
-
-exports.diff = diff
-function diff (version1, version2) {
- if (eq(version1, version2)) {
- return null
- } else {
- var v1 = parse(version1)
- var v2 = parse(version2)
- var prefix = ''
- if (v1.prerelease.length || v2.prerelease.length) {
- prefix = 'pre'
- var defaultResult = 'prerelease'
- }
- for (var key in v1) {
- if (key === 'major' || key === 'minor' || key === 'patch') {
- if (v1[key] !== v2[key]) {
- return prefix + key
- }
- }
- }
- return defaultResult // may be undefined
- }
-}
-
-exports.compareIdentifiers = compareIdentifiers
-
-var numeric = /^[0-9]+$/
-function compareIdentifiers (a, b) {
- var anum = numeric.test(a)
- var bnum = numeric.test(b)
-
- if (anum && bnum) {
- a = +a
- b = +b
- }
-
- return a === b ? 0
- : (anum && !bnum) ? -1
- : (bnum && !anum) ? 1
- : a < b ? -1
- : 1
-}
-
-exports.rcompareIdentifiers = rcompareIdentifiers
-function rcompareIdentifiers (a, b) {
- return compareIdentifiers(b, a)
-}
-
-exports.major = major
-function major (a, loose) {
- return new SemVer(a, loose).major
-}
-
-exports.minor = minor
-function minor (a, loose) {
- return new SemVer(a, loose).minor
-}
-
-exports.patch = patch
-function patch (a, loose) {
- return new SemVer(a, loose).patch
-}
-
-exports.compare = compare
-function compare (a, b, loose) {
- return new SemVer(a, loose).compare(new SemVer(b, loose))
-}
-
-exports.compareLoose = compareLoose
-function compareLoose (a, b) {
- return compare(a, b, true)
-}
-
-exports.rcompare = rcompare
-function rcompare (a, b, loose) {
- return compare(b, a, loose)
-}
-
-exports.sort = sort
-function sort (list, loose) {
- return list.sort(function (a, b) {
- return exports.compare(a, b, loose)
- })
-}
-
-exports.rsort = rsort
-function rsort (list, loose) {
- return list.sort(function (a, b) {
- return exports.rcompare(a, b, loose)
- })
-}
-
-exports.gt = gt
-function gt (a, b, loose) {
- return compare(a, b, loose) > 0
-}
-
-exports.lt = lt
-function lt (a, b, loose) {
- return compare(a, b, loose) < 0
-}
-
-exports.eq = eq
-function eq (a, b, loose) {
- return compare(a, b, loose) === 0
-}
-
-exports.neq = neq
-function neq (a, b, loose) {
- return compare(a, b, loose) !== 0
-}
-
-exports.gte = gte
-function gte (a, b, loose) {
- return compare(a, b, loose) >= 0
-}
-
-exports.lte = lte
-function lte (a, b, loose) {
- return compare(a, b, loose) <= 0
-}
-
-exports.cmp = cmp
-function cmp (a, op, b, loose) {
- switch (op) {
- case '===':
- if (typeof a === 'object')
- a = a.version
- if (typeof b === 'object')
- b = b.version
- return a === b
-
- case '!==':
- if (typeof a === 'object')
- a = a.version
- if (typeof b === 'object')
- b = b.version
- return a !== b
-
- case '':
- case '=':
- case '==':
- return eq(a, b, loose)
-
- case '!=':
- return neq(a, b, loose)
-
- case '>':
- return gt(a, b, loose)
-
- case '>=':
- return gte(a, b, loose)
-
- case '<':
- return lt(a, b, loose)
-
- case '<=':
- return lte(a, b, loose)
-
- default:
- throw new TypeError('Invalid operator: ' + op)
- }
-}
-
-exports.Comparator = Comparator
-function Comparator (comp, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- }
- }
-
- if (comp instanceof Comparator) {
- if (comp.loose === !!options.loose) {
- return comp
- } else {
- comp = comp.value
- }
- }
-
- if (!(this instanceof Comparator)) {
- return new Comparator(comp, options)
- }
-
- debug('comparator', comp, options)
- this.options = options
- this.loose = !!options.loose
- this.parse(comp)
-
- if (this.semver === ANY) {
- this.value = ''
- } else {
- this.value = this.operator + this.semver.version
- }
-
- debug('comp', this)
-}
-
-var ANY = {}
-Comparator.prototype.parse = function (comp) {
- var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
- var m = comp.match(r)
-
- if (!m) {
- throw new TypeError('Invalid comparator: ' + comp)
- }
-
- this.operator = m[1]
- if (this.operator === '=') {
- this.operator = ''
- }
-
- // if it literally is just '>' or '' then allow anything.
- if (!m[2]) {
- this.semver = ANY
- } else {
- this.semver = new SemVer(m[2], this.options.loose)
- }
-}
-
-Comparator.prototype.toString = function () {
- return this.value
-}
-
-Comparator.prototype.test = function (version) {
- debug('Comparator.test', version, this.options.loose)
-
- if (this.semver === ANY) {
- return true
- }
-
- if (typeof version === 'string') {
- version = new SemVer(version, this.options)
- }
-
- return cmp(version, this.operator, this.semver, this.options)
-}
-
-Comparator.prototype.intersects = function (comp, options) {
- if (!(comp instanceof Comparator)) {
- throw new TypeError('a Comparator is required')
- }
-
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- }
- }
-
- var rangeTmp
-
- if (this.operator === '') {
- rangeTmp = new Range(comp.value, options)
- return satisfies(this.value, rangeTmp, options)
- } else if (comp.operator === '') {
- rangeTmp = new Range(this.value, options)
- return satisfies(comp.semver, rangeTmp, options)
- }
-
- var sameDirectionIncreasing =
- (this.operator === '>=' || this.operator === '>') &&
- (comp.operator === '>=' || comp.operator === '>')
- var sameDirectionDecreasing =
- (this.operator === '<=' || this.operator === '<') &&
- (comp.operator === '<=' || comp.operator === '<')
- var sameSemVer = this.semver.version === comp.semver.version
- var differentDirectionsInclusive =
- (this.operator === '>=' || this.operator === '<=') &&
- (comp.operator === '>=' || comp.operator === '<=')
- var oppositeDirectionsLessThan =
- cmp(this.semver, '<', comp.semver, options) &&
- ((this.operator === '>=' || this.operator === '>') &&
- (comp.operator === '<=' || comp.operator === '<'))
- var oppositeDirectionsGreaterThan =
- cmp(this.semver, '>', comp.semver, options) &&
- ((this.operator === '<=' || this.operator === '<') &&
- (comp.operator === '>=' || comp.operator === '>'))
-
- return sameDirectionIncreasing || sameDirectionDecreasing ||
- (sameSemVer && differentDirectionsInclusive) ||
- oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
-}
-
-exports.Range = Range
-function Range (range, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- }
- }
-
- if (range instanceof Range) {
- if (range.loose === !!options.loose &&
- range.includePrerelease === !!options.includePrerelease) {
- return range
- } else {
- return new Range(range.raw, options)
- }
- }
-
- if (range instanceof Comparator) {
- return new Range(range.value, options)
- }
-
- if (!(this instanceof Range)) {
- return new Range(range, options)
- }
-
- this.options = options
- this.loose = !!options.loose
- this.includePrerelease = !!options.includePrerelease
-
- // First, split based on boolean or ||
- this.raw = range
- this.set = range.split(/\s*\|\|\s*/).map(function (range) {
- return this.parseRange(range.trim())
- }, this).filter(function (c) {
- // throw out any that are not relevant for whatever reason
- return c.length
- })
-
- if (!this.set.length) {
- throw new TypeError('Invalid SemVer Range: ' + range)
- }
-
- this.format()
-}
-
-Range.prototype.format = function () {
- this.range = this.set.map(function (comps) {
- return comps.join(' ').trim()
- }).join('||').trim()
- return this.range
-}
-
-Range.prototype.toString = function () {
- return this.range
-}
-
-Range.prototype.parseRange = function (range) {
- var loose = this.options.loose
- range = range.trim()
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
- var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
- range = range.replace(hr, hyphenReplace)
- debug('hyphen replace', range)
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
- range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
- debug('comparator trim', range, re[COMPARATORTRIM])
-
- // `~ 1.2.3` => `~1.2.3`
- range = range.replace(re[TILDETRIM], tildeTrimReplace)
-
- // `^ 1.2.3` => `^1.2.3`
- range = range.replace(re[CARETTRIM], caretTrimReplace)
-
- // normalize spaces
- range = range.split(/\s+/).join(' ')
-
- // At this point, the range is completely trimmed and
- // ready to be split into comparators.
-
- var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
- var set = range.split(' ').map(function (comp) {
- return parseComparator(comp, this.options)
- }, this).join(' ').split(/\s+/)
- if (this.options.loose) {
- // in loose mode, throw out any that are not valid comparators
- set = set.filter(function (comp) {
- return !!comp.match(compRe)
- })
- }
- set = set.map(function (comp) {
- return new Comparator(comp, this.options)
- }, this)
-
- return set
-}
-
-Range.prototype.intersects = function (range, options) {
- if (!(range instanceof Range)) {
- throw new TypeError('a Range is required')
- }
-
- return this.set.some(function (thisComparators) {
- return thisComparators.every(function (thisComparator) {
- return range.set.some(function (rangeComparators) {
- return rangeComparators.every(function (rangeComparator) {
- return thisComparator.intersects(rangeComparator, options)
- })
- })
- })
- })
-}
-
-// Mostly just for testing and legacy API reasons
-exports.toComparators = toComparators
-function toComparators (range, options) {
- return new Range(range, options).set.map(function (comp) {
- return comp.map(function (c) {
- return c.value
- }).join(' ').trim().split(' ')
- })
-}
-
-// comprised of xranges, tildes, stars, and gtlt's at this point.
-// already replaced the hyphen ranges
-// turn into a set of JUST comparators.
-function parseComparator (comp, options) {
- debug('comp', comp, options)
- comp = replaceCarets(comp, options)
- debug('caret', comp)
- comp = replaceTildes(comp, options)
- debug('tildes', comp)
- comp = replaceXRanges(comp, options)
- debug('xrange', comp)
- comp = replaceStars(comp, options)
- debug('stars', comp)
- return comp
-}
-
-function isX (id) {
- return !id || id.toLowerCase() === 'x' || id === '*'
-}
-
-// ~, ~> --> * (any, kinda silly)
-// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
-// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
-// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
-// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
-// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
-function replaceTildes (comp, options) {
- return comp.trim().split(/\s+/).map(function (comp) {
- return replaceTilde(comp, options)
- }).join(' ')
-}
-
-function replaceTilde (comp, options) {
- var r = options.loose ? re[TILDELOOSE] : re[TILDE]
- return comp.replace(r, function (_, M, m, p, pr) {
- debug('tilde', comp, _, M, m, p, pr)
- var ret
-
- if (isX(M)) {
- ret = ''
- } else if (isX(m)) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
- } else if (isX(p)) {
- // ~1.2 == >=1.2.0 <1.3.0
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
- } else if (pr) {
- debug('replaceTilde pr', pr)
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
- ' <' + M + '.' + (+m + 1) + '.0'
- } else {
- // ~1.2.3 == >=1.2.3 <1.3.0
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + (+m + 1) + '.0'
- }
-
- debug('tilde return', ret)
- return ret
- })
-}
-
-// ^ --> * (any, kinda silly)
-// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
-// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
-// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
-// ^1.2.3 --> >=1.2.3 <2.0.0
-// ^1.2.0 --> >=1.2.0 <2.0.0
-function replaceCarets (comp, options) {
- return comp.trim().split(/\s+/).map(function (comp) {
- return replaceCaret(comp, options)
- }).join(' ')
-}
-
-function replaceCaret (comp, options) {
- debug('caret', comp, options)
- var r = options.loose ? re[CARETLOOSE] : re[CARET]
- return comp.replace(r, function (_, M, m, p, pr) {
- debug('caret', comp, _, M, m, p, pr)
- var ret
-
- if (isX(M)) {
- ret = ''
- } else if (isX(m)) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
- } else if (isX(p)) {
- if (M === '0') {
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
- } else {
- ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
- }
- } else if (pr) {
- debug('replaceCaret pr', pr)
- if (M === '0') {
- if (m === '0') {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
- ' <' + M + '.' + m + '.' + (+p + 1)
- } else {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
- ' <' + M + '.' + (+m + 1) + '.0'
- }
- } else {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
- ' <' + (+M + 1) + '.0.0'
- }
- } else {
- debug('no pr')
- if (M === '0') {
- if (m === '0') {
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + m + '.' + (+p + 1)
- } else {
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + (+m + 1) + '.0'
- }
- } else {
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + (+M + 1) + '.0.0'
- }
- }
-
- debug('caret return', ret)
- return ret
- })
-}
-
-function replaceXRanges (comp, options) {
- debug('replaceXRanges', comp, options)
- return comp.split(/\s+/).map(function (comp) {
- return replaceXRange(comp, options)
- }).join(' ')
-}
-
-function replaceXRange (comp, options) {
- comp = comp.trim()
- var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
- return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
- debug('xRange', comp, ret, gtlt, M, m, p, pr)
- var xM = isX(M)
- var xm = xM || isX(m)
- var xp = xm || isX(p)
- var anyX = xp
-
- if (gtlt === '=' && anyX) {
- gtlt = ''
- }
-
- if (xM) {
- if (gtlt === '>' || gtlt === '<') {
- // nothing is allowed
- ret = '<0.0.0'
- } else {
- // nothing is forbidden
- ret = '*'
- }
- } else if (gtlt && anyX) {
- // we know patch is an x, because we have any x at all.
- // replace X with 0
- if (xm) {
- m = 0
- }
- p = 0
-
- if (gtlt === '>') {
- // >1 => >=2.0.0
- // >1.2 => >=1.3.0
- // >1.2.3 => >= 1.2.4
- gtlt = '>='
- if (xm) {
- M = +M + 1
- m = 0
- p = 0
- } else {
- m = +m + 1
- p = 0
- }
- } else if (gtlt === '<=') {
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
- gtlt = '<'
- if (xm) {
- M = +M + 1
- } else {
- m = +m + 1
- }
- }
-
- ret = gtlt + M + '.' + m + '.' + p
- } else if (xm) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
- } else if (xp) {
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
- }
-
- debug('xRange return', ret)
-
- return ret
- })
-}
-
-// Because * is AND-ed with everything else in the comparator,
-// and '' means "any version", just remove the *s entirely.
-function replaceStars (comp, options) {
- debug('replaceStars', comp, options)
- // Looseness is ignored here. star is always as loose as it gets!
- return comp.trim().replace(re[STAR], '')
-}
-
-// This function is passed to string.replace(re[HYPHENRANGE])
-// M, m, patch, prerelease, build
-// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
-// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
-// 1.2 - 3.4 => >=1.2.0 <3.5.0
-function hyphenReplace ($0,
- from, fM, fm, fp, fpr, fb,
- to, tM, tm, tp, tpr, tb) {
- if (isX(fM)) {
- from = ''
- } else if (isX(fm)) {
- from = '>=' + fM + '.0.0'
- } else if (isX(fp)) {
- from = '>=' + fM + '.' + fm + '.0'
- } else {
- from = '>=' + from
- }
-
- if (isX(tM)) {
- to = ''
- } else if (isX(tm)) {
- to = '<' + (+tM + 1) + '.0.0'
- } else if (isX(tp)) {
- to = '<' + tM + '.' + (+tm + 1) + '.0'
- } else if (tpr) {
- to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
- } else {
- to = '<=' + to
- }
-
- return (from + ' ' + to).trim()
-}
-
-// if ANY of the sets match ALL of its comparators, then pass
-Range.prototype.test = function (version) {
- if (!version) {
- return false
- }
-
- if (typeof version === 'string') {
- version = new SemVer(version, this.options)
- }
-
- for (var i = 0; i < this.set.length; i++) {
- if (testSet(this.set[i], version, this.options)) {
- return true
- }
- }
- return false
-}
-
-function testSet (set, version, options) {
- for (var i = 0; i < set.length; i++) {
- if (!set[i].test(version)) {
- return false
- }
- }
-
- if (version.prerelease.length && !options.includePrerelease) {
- // Find the set of versions that are allowed to have prereleases
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
- // That should allow `1.2.3-pr.2` to pass.
- // However, `1.2.4-alpha.notready` should NOT be allowed,
- // even though it's within the range set by the comparators.
- for (i = 0; i < set.length; i++) {
- debug(set[i].semver)
- if (set[i].semver === ANY) {
- continue
- }
-
- if (set[i].semver.prerelease.length > 0) {
- var allowed = set[i].semver
- if (allowed.major === version.major &&
- allowed.minor === version.minor &&
- allowed.patch === version.patch) {
- return true
- }
- }
- }
-
- // Version has a -pre, but it's not one of the ones we like.
- return false
- }
-
- return true
-}
-
-exports.satisfies = satisfies
-function satisfies (version, range, options) {
- try {
- range = new Range(range, options)
- } catch (er) {
- return false
- }
- return range.test(version)
-}
-
-exports.maxSatisfying = maxSatisfying
-function maxSatisfying (versions, range, options) {
- var max = null
- var maxSV = null
- try {
- var rangeObj = new Range(range, options)
- } catch (er) {
- return null
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) {
- // satisfies(v, range, options)
- if (!max || maxSV.compare(v) === -1) {
- // compare(max, v, true)
- max = v
- maxSV = new SemVer(max, options)
- }
- }
- })
- return max
-}
-
-exports.minSatisfying = minSatisfying
-function minSatisfying (versions, range, options) {
- var min = null
- var minSV = null
- try {
- var rangeObj = new Range(range, options)
- } catch (er) {
- return null
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) {
- // satisfies(v, range, options)
- if (!min || minSV.compare(v) === 1) {
- // compare(min, v, true)
- min = v
- minSV = new SemVer(min, options)
- }
- }
- })
- return min
-}
-
-exports.minVersion = minVersion
-function minVersion (range, loose) {
- range = new Range(range, loose)
-
- var minver = new SemVer('0.0.0')
- if (range.test(minver)) {
- return minver
- }
-
- minver = new SemVer('0.0.0-0')
- if (range.test(minver)) {
- return minver
- }
-
- minver = null
- for (var i = 0; i < range.set.length; ++i) {
- var comparators = range.set[i]
-
- comparators.forEach(function (comparator) {
- // Clone to avoid manipulating the comparator's semver object.
- var compver = new SemVer(comparator.semver.version)
- switch (comparator.operator) {
- case '>':
- if (compver.prerelease.length === 0) {
- compver.patch++
- } else {
- compver.prerelease.push(0)
- }
- compver.raw = compver.format()
- /* fallthrough */
- case '':
- case '>=':
- if (!minver || gt(minver, compver)) {
- minver = compver
- }
- break
- case '<':
- case '<=':
- /* Ignore maximum versions */
- break
- /* istanbul ignore next */
- default:
- throw new Error('Unexpected operation: ' + comparator.operator)
- }
- })
- }
-
- if (minver && range.test(minver)) {
- return minver
- }
-
- return null
-}
-
-exports.validRange = validRange
-function validRange (range, options) {
- try {
- // Return '*' instead of '' so that truthiness works.
- // This will throw if it's invalid anyway
- return new Range(range, options).range || '*'
- } catch (er) {
- return null
- }
-}
-
-// Determine if version is less than all the versions possible in the range
-exports.ltr = ltr
-function ltr (version, range, options) {
- return outside(version, range, '<', options)
-}
-
-// Determine if version is greater than all the versions possible in the range.
-exports.gtr = gtr
-function gtr (version, range, options) {
- return outside(version, range, '>', options)
-}
-
-exports.outside = outside
-function outside (version, range, hilo, options) {
- version = new SemVer(version, options)
- range = new Range(range, options)
-
- var gtfn, ltefn, ltfn, comp, ecomp
- switch (hilo) {
- case '>':
- gtfn = gt
- ltefn = lte
- ltfn = lt
- comp = '>'
- ecomp = '>='
- break
- case '<':
- gtfn = lt
- ltefn = gte
- ltfn = gt
- comp = '<'
- ecomp = '<='
- break
- default:
- throw new TypeError('Must provide a hilo val of "<" or ">"')
- }
-
- // If it satisifes the range it is not outside
- if (satisfies(version, range, options)) {
- return false
- }
-
- // From now on, variable terms are as if we're in "gtr" mode.
- // but note that everything is flipped for the "ltr" function.
-
- for (var i = 0; i < range.set.length; ++i) {
- var comparators = range.set[i]
-
- var high = null
- var low = null
-
- comparators.forEach(function (comparator) {
- if (comparator.semver === ANY) {
- comparator = new Comparator('>=0.0.0')
- }
- high = high || comparator
- low = low || comparator
- if (gtfn(comparator.semver, high.semver, options)) {
- high = comparator
- } else if (ltfn(comparator.semver, low.semver, options)) {
- low = comparator
- }
- })
-
- // If the edge version comparator has a operator then our version
- // isn't outside it
- if (high.operator === comp || high.operator === ecomp) {
- return false
- }
-
- // If the lowest version comparator has an operator and our version
- // is less than it then it isn't higher than the range
- if ((!low.operator || low.operator === comp) &&
- ltefn(version, low.semver)) {
- return false
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
- return false
- }
- }
- return true
-}
-
-exports.prerelease = prerelease
-function prerelease (version, options) {
- var parsed = parse(version, options)
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
-}
-
-exports.intersects = intersects
-function intersects (r1, r2, options) {
- r1 = new Range(r1, options)
- r2 = new Range(r2, options)
- return r1.intersects(r2)
-}
-
-exports.coerce = coerce
-function coerce (version) {
- if (version instanceof SemVer) {
- return version
- }
-
- if (typeof version !== 'string') {
- return null
- }
-
- var match = version.match(re[COERCE])
-
- if (match == null) {
- return null
- }
-
- return parse(match[1] +
- '.' + (match[2] || '0') +
- '.' + (match[3] || '0'))
-}
-
-
-/***/ }),
-
-/***/ 64314:
-/***/ ((module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-var Progress = __nccwpck_require__(11083)
-var Gauge = __nccwpck_require__(51800)
-var EE = __nccwpck_require__(28614).EventEmitter
-var log = exports = module.exports = new EE()
-var util = __nccwpck_require__(31669)
-
-var setBlocking = __nccwpck_require__(79344)
-var consoleControl = __nccwpck_require__(73645)
-
-setBlocking(true)
-var stream = process.stderr
-Object.defineProperty(log, 'stream', {
- set: function (newStream) {
- stream = newStream
- if (this.gauge) this.gauge.setWriteTo(stream, stream)
- },
- get: function () {
- return stream
- }
-})
-
-// by default, decide based on tty-ness.
-var colorEnabled
-log.useColor = function () {
- return colorEnabled != null ? colorEnabled : stream.isTTY
-}
-
-log.enableColor = function () {
- colorEnabled = true
- this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
-}
-log.disableColor = function () {
- colorEnabled = false
- this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
-}
-
-// default level
-log.level = 'info'
-
-log.gauge = new Gauge(stream, {
- enabled: false, // no progress bars unless asked
- theme: {hasColor: log.useColor()},
- template: [
- {type: 'progressbar', length: 20},
- {type: 'activityIndicator', kerning: 1, length: 1},
- {type: 'section', default: ''},
- ':',
- {type: 'logline', kerning: 1, default: ''}
- ]
-})
-
-log.tracker = new Progress.TrackerGroup()
-
-// we track this separately as we may need to temporarily disable the
-// display of the status bar for our own loggy purposes.
-log.progressEnabled = log.gauge.isEnabled()
-
-var unicodeEnabled
-
-log.enableUnicode = function () {
- unicodeEnabled = true
- this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled})
-}
-
-log.disableUnicode = function () {
- unicodeEnabled = false
- this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled})
-}
-
-log.setGaugeThemeset = function (themes) {
- this.gauge.setThemeset(themes)
-}
-
-log.setGaugeTemplate = function (template) {
- this.gauge.setTemplate(template)
-}
-
-log.enableProgress = function () {
- if (this.progressEnabled) return
- this.progressEnabled = true
- this.tracker.on('change', this.showProgress)
- if (this._pause) return
- this.gauge.enable()
-}
-
-log.disableProgress = function () {
- if (!this.progressEnabled) return
- this.progressEnabled = false
- this.tracker.removeListener('change', this.showProgress)
- this.gauge.disable()
-}
-
-var trackerConstructors = ['newGroup', 'newItem', 'newStream']
-
-var mixinLog = function (tracker) {
- // mixin the public methods from log into the tracker
- // (except: conflicts and one's we handle specially)
- Object.keys(log).forEach(function (P) {
- if (P[0] === '_') return
- if (trackerConstructors.filter(function (C) { return C === P }).length) return
- if (tracker[P]) return
- if (typeof log[P] !== 'function') return
- var func = log[P]
- tracker[P] = function () {
- return func.apply(log, arguments)
- }
- })
- // if the new tracker is a group, make sure any subtrackers get
- // mixed in too
- if (tracker instanceof Progress.TrackerGroup) {
- trackerConstructors.forEach(function (C) {
- var func = tracker[C]
- tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) }
- })
- }
- return tracker
-}
-
-// Add tracker constructors to the top level log object
-trackerConstructors.forEach(function (C) {
- log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) }
-})
-
-log.clearProgress = function (cb) {
- if (!this.progressEnabled) return cb && process.nextTick(cb)
- this.gauge.hide(cb)
-}
-
-log.showProgress = function (name, completed) {
- if (!this.progressEnabled) return
- var values = {}
- if (name) values.section = name
- var last = log.record[log.record.length - 1]
- if (last) {
- values.subsection = last.prefix
- var disp = log.disp[last.level] || last.level
- var logline = this._format(disp, log.style[last.level])
- if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle)
- logline += ' ' + last.message.split(/\r?\n/)[0]
- values.logline = logline
- }
- values.completed = completed || this.tracker.completed()
- this.gauge.show(values)
-}.bind(log) // bind for use in tracker's on-change listener
-
-// temporarily stop emitting, but don't drop
-log.pause = function () {
- this._paused = true
- if (this.progressEnabled) this.gauge.disable()
-}
-
-log.resume = function () {
- if (!this._paused) return
- this._paused = false
-
- var b = this._buffer
- this._buffer = []
- b.forEach(function (m) {
- this.emitLog(m)
- }, this)
- if (this.progressEnabled) this.gauge.enable()
-}
-
-log._buffer = []
-
-var id = 0
-log.record = []
-log.maxRecordSize = 10000
-log.log = function (lvl, prefix, message) {
- var l = this.levels[lvl]
- if (l === undefined) {
- return this.emit('error', new Error(util.format(
- 'Undefined log level: %j', lvl)))
- }
-
- var a = new Array(arguments.length - 2)
- var stack = null
- for (var i = 2; i < arguments.length; i++) {
- var arg = a[i - 2] = arguments[i]
-
- // resolve stack traces to a plain string.
- if (typeof arg === 'object' && arg &&
- (arg instanceof Error) && arg.stack) {
-
- Object.defineProperty(arg, 'stack', {
- value: stack = arg.stack + '',
- enumerable: true,
- writable: true
- })
- }
- }
- if (stack) a.unshift(stack + '\n')
- message = util.format.apply(util, a)
-
- var m = { id: id++,
- level: lvl,
- prefix: String(prefix || ''),
- message: message,
- messageRaw: a }
-
- this.emit('log', m)
- this.emit('log.' + lvl, m)
- if (m.prefix) this.emit(m.prefix, m)
-
- this.record.push(m)
- var mrs = this.maxRecordSize
- var n = this.record.length - mrs
- if (n > mrs / 10) {
- var newSize = Math.floor(mrs * 0.9)
- this.record = this.record.slice(-1 * newSize)
- }
-
- this.emitLog(m)
-}.bind(log)
-
-log.emitLog = function (m) {
- if (this._paused) {
- this._buffer.push(m)
- return
- }
- if (this.progressEnabled) this.gauge.pulse(m.prefix)
- var l = this.levels[m.level]
- if (l === undefined) return
- if (l < this.levels[this.level]) return
- if (l > 0 && !isFinite(l)) return
-
- // If 'disp' is null or undefined, use the lvl as a default
- // Allows: '', 0 as valid disp
- var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level
- this.clearProgress()
- m.message.split(/\r?\n/).forEach(function (line) {
- if (this.heading) {
- this.write(this.heading, this.headingStyle)
- this.write(' ')
- }
- this.write(disp, log.style[m.level])
- var p = m.prefix || ''
- if (p) this.write(' ')
- this.write(p, this.prefixStyle)
- this.write(' ' + line + '\n')
- }, this)
- this.showProgress()
-}
-
-log._format = function (msg, style) {
- if (!stream) return
-
- var output = ''
- if (this.useColor()) {
- style = style || {}
- var settings = []
- if (style.fg) settings.push(style.fg)
- if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1))
- if (style.bold) settings.push('bold')
- if (style.underline) settings.push('underline')
- if (style.inverse) settings.push('inverse')
- if (settings.length) output += consoleControl.color(settings)
- if (style.beep) output += consoleControl.beep()
- }
- output += msg
- if (this.useColor()) {
- output += consoleControl.color('reset')
- }
- return output
-}
-
-log.write = function (msg, style) {
- if (!stream) return
-
- stream.write(this._format(msg, style))
-}
-
-log.addLevel = function (lvl, n, style, disp) {
- // If 'disp' is null or undefined, use the lvl as a default
- if (disp == null) disp = lvl
- this.levels[lvl] = n
- this.style[lvl] = style
- if (!this[lvl]) {
- this[lvl] = function () {
- var a = new Array(arguments.length + 1)
- a[0] = lvl
- for (var i = 0; i < arguments.length; i++) {
- a[i + 1] = arguments[i]
- }
- return this.log.apply(this, a)
- }.bind(this)
- }
- this.disp[lvl] = disp
-}
-
-log.prefixStyle = { fg: 'magenta' }
-log.headingStyle = { fg: 'white', bg: 'black' }
-
-log.style = {}
-log.levels = {}
-log.disp = {}
-log.addLevel('silly', -Infinity, { inverse: true }, 'sill')
-log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb')
-log.addLevel('info', 2000, { fg: 'green' })
-log.addLevel('timing', 2500, { fg: 'green', bg: 'black' })
-log.addLevel('http', 3000, { fg: 'green', bg: 'black' })
-log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' })
-log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN')
-log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!')
-log.addLevel('silent', Infinity)
-
-// allow 'error' prefix
-log.on('error', function () {})
-
-
-/***/ }),
-
-/***/ 16325:
-/***/ ((module) => {
-
-"use strict";
-
-module.exports = Number.isNaN || function (x) {
- return x !== x;
-};
-
-
-/***/ }),
-
-/***/ 43248:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-var crypto = __nccwpck_require__(76417)
-
-function sha (key, body, algorithm) {
- return crypto.createHmac(algorithm, key).update(body).digest('base64')
-}
-
-function rsa (key, body) {
- return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64')
-}
-
-function rfc3986 (str) {
- return encodeURIComponent(str)
- .replace(/!/g,'%21')
- .replace(/\*/g,'%2A')
- .replace(/\(/g,'%28')
- .replace(/\)/g,'%29')
- .replace(/'/g,'%27')
-}
-
-// Maps object to bi-dimensional array
-// Converts { foo: 'A', bar: [ 'b', 'B' ]} to
-// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
-function map (obj) {
- var key, val, arr = []
- for (key in obj) {
- val = obj[key]
- if (Array.isArray(val))
- for (var i = 0; i < val.length; i++)
- arr.push([key, val[i]])
- else if (typeof val === 'object')
- for (var prop in val)
- arr.push([key + '[' + prop + ']', val[prop]])
- else
- arr.push([key, val])
- }
- return arr
-}
-
-// Compare function for sort
-function compare (a, b) {
- return a > b ? 1 : a < b ? -1 : 0
-}
-
-function generateBase (httpMethod, base_uri, params) {
- // adapted from https://dev.twitter.com/docs/auth/oauth and
- // https://dev.twitter.com/docs/auth/creating-signature
-
- // Parameter normalization
- // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
- var normalized = map(params)
- // 1. First, the name and value of each parameter are encoded
- .map(function (p) {
- return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
- })
- // 2. The parameters are sorted by name, using ascending byte value
- // ordering. If two or more parameters share the same name, they
- // are sorted by their value.
- .sort(function (a, b) {
- return compare(a[0], b[0]) || compare(a[1], b[1])
- })
- // 3. The name of each parameter is concatenated to its corresponding
- // value using an "=" character (ASCII code 61) as a separator, even
- // if the value is empty.
- .map(function (p) { return p.join('=') })
- // 4. The sorted name/value pairs are concatenated together into a
- // single string by using an "&" character (ASCII code 38) as
- // separator.
- .join('&')
-
- var base = [
- rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
- rfc3986(base_uri),
- rfc3986(normalized)
- ].join('&')
-
- return base
-}
-
-function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
- var base = generateBase(httpMethod, base_uri, params)
- var key = [
- consumer_secret || '',
- token_secret || ''
- ].map(rfc3986).join('&')
-
- return sha(key, base, 'sha1')
-}
-
-function hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) {
- var base = generateBase(httpMethod, base_uri, params)
- var key = [
- consumer_secret || '',
- token_secret || ''
- ].map(rfc3986).join('&')
-
- return sha(key, base, 'sha256')
-}
-
-function rsasign (httpMethod, base_uri, params, private_key, token_secret) {
- var base = generateBase(httpMethod, base_uri, params)
- var key = private_key || ''
-
- return rsa(key, base)
-}
-
-function plaintext (consumer_secret, token_secret) {
- var key = [
- consumer_secret || '',
- token_secret || ''
- ].map(rfc3986).join('&')
-
- return key
-}
-
-function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
- var method
- var skipArgs = 1
-
- switch (signMethod) {
- case 'RSA-SHA1':
- method = rsasign
- break
- case 'HMAC-SHA1':
- method = hmacsign
- break
- case 'HMAC-SHA256':
- method = hmacsign256
- break
- case 'PLAINTEXT':
- method = plaintext
- skipArgs = 4
- break
- default:
- throw new Error('Signature method not supported: ' + signMethod)
- }
-
- return method.apply(null, [].slice.call(arguments, skipArgs))
-}
-
-exports.hmacsign = hmacsign
-exports.hmacsign256 = hmacsign256
-exports.rsasign = rsasign
-exports.plaintext = plaintext
-exports.sign = sign
-exports.rfc3986 = rfc3986
-exports.generateBase = generateBase
-
-/***/ }),
-
-/***/ 17426:
-/***/ ((module) => {
-
-"use strict";
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
-}
-
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
-
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
-
-
-/***/ }),
-
-/***/ 1223:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var wrappy = __nccwpck_require__(62940)
-module.exports = wrappy(once)
-module.exports.strict = wrappy(onceStrict)
-
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
-
- Object.defineProperty(Function.prototype, 'onceStrict', {
- value: function () {
- return onceStrict(this)
- },
- configurable: true
- })
-})
-
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
-}
-
-function onceStrict (fn) {
- var f = function () {
- if (f.called)
- throw new Error(f.onceError)
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- var name = fn.name || 'Function wrapped with `once`'
- f.onceError = name + " shouldn't be called more than once"
- f.called = false
- return f
-}
-
-
-/***/ }),
-
-/***/ 43406:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-var os = __nccwpck_require__(12087);
-
-function homedir() {
- var env = process.env;
- var home = env.HOME;
- var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
-
- if (process.platform === 'win32') {
- return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
- }
-
- if (process.platform === 'darwin') {
- return home || (user ? '/Users/' + user : null);
- }
-
- if (process.platform === 'linux') {
- return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
- }
-
- return home || null;
-}
-
-module.exports = typeof os.homedir === 'function' ? os.homedir : homedir;
-
-
-/***/ }),
-
-/***/ 71284:
-/***/ ((module) => {
-
-"use strict";
-
-var isWindows = process.platform === 'win32';
-var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
-
-// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
-module.exports = function () {
- var path;
-
- if (isWindows) {
- path = process.env.TEMP ||
- process.env.TMP ||
- (process.env.SystemRoot || process.env.windir) + '\\temp';
- } else {
- path = process.env.TMPDIR ||
- process.env.TMP ||
- process.env.TEMP ||
- '/tmp';
- }
-
- if (trailingSlashRe.test(path)) {
- path = path.slice(0, -1);
- }
-
- return path;
-};
-
-
-/***/ }),
-
-/***/ 84669:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-var isWindows = process.platform === 'win32'
-var path = __nccwpck_require__(85622)
-var exec = __nccwpck_require__(63129).exec
-var osTmpdir = __nccwpck_require__(71284)
-var osHomedir = __nccwpck_require__(43406)
-
-// looking up envs is a bit costly.
-// Also, sometimes we want to have a fallback
-// Pass in a callback to wait for the fallback on failures
-// After the first lookup, always returns the same thing.
-function memo (key, lookup, fallback) {
- var fell = false
- var falling = false
- exports[key] = function (cb) {
- var val = lookup()
- if (!val && !fell && !falling && fallback) {
- fell = true
- falling = true
- exec(fallback, function (er, output, stderr) {
- falling = false
- if (er) return // oh well, we tried
- val = output.trim()
- })
- }
- exports[key] = function (cb) {
- if (cb) process.nextTick(cb.bind(null, null, val))
- return val
- }
- if (cb && !falling) process.nextTick(cb.bind(null, null, val))
- return val
- }
-}
-
-memo('user', function () {
- return ( isWindows
- ? process.env.USERDOMAIN + '\\' + process.env.USERNAME
- : process.env.USER
- )
-}, 'whoami')
-
-memo('prompt', function () {
- return isWindows ? process.env.PROMPT : process.env.PS1
-})
-
-memo('hostname', function () {
- return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME
-}, 'hostname')
-
-memo('tmpdir', function () {
- return osTmpdir()
-})
-
-memo('home', function () {
- return osHomedir()
-})
-
-memo('path', function () {
- return (process.env.PATH ||
- process.env.Path ||
- process.env.path).split(isWindows ? ';' : ':')
-})
-
-memo('editor', function () {
- return process.env.EDITOR ||
- process.env.VISUAL ||
- (isWindows ? 'notepad.exe' : 'vi')
-})
-
-memo('shell', function () {
- return isWindows ? process.env.ComSpec || 'cmd'
- : process.env.SHELL || 'bash'
-})
-
-
-/***/ }),
-
-/***/ 9759:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const doctype = __nccwpck_require__(27079);
-const { DOCUMENT_MODE } = __nccwpck_require__(69338);
-
-//Conversion tables for DOM Level1 structure emulation
-const nodeTypes = {
- element: 1,
- text: 3,
- cdata: 4,
- comment: 8
-};
-
-const nodePropertyShorthands = {
- tagName: 'name',
- childNodes: 'children',
- parentNode: 'parent',
- previousSibling: 'prev',
- nextSibling: 'next',
- nodeValue: 'data'
-};
-
-//Node
-class Node {
- constructor(props) {
- for (const key of Object.keys(props)) {
- this[key] = props[key];
- }
- }
-
- get firstChild() {
- const children = this.children;
-
- return (children && children[0]) || null;
- }
-
- get lastChild() {
- const children = this.children;
-
- return (children && children[children.length - 1]) || null;
- }
-
- get nodeType() {
- return nodeTypes[this.type] || nodeTypes.element;
- }
-}
-
-Object.keys(nodePropertyShorthands).forEach(key => {
- const shorthand = nodePropertyShorthands[key];
-
- Object.defineProperty(Node.prototype, key, {
- get: function() {
- return this[shorthand] || null;
- },
- set: function(val) {
- this[shorthand] = val;
- return val;
- }
- });
-});
-
-//Node construction
-exports.createDocument = function() {
- return new Node({
- type: 'root',
- name: 'root',
- parent: null,
- prev: null,
- next: null,
- children: [],
- 'x-mode': DOCUMENT_MODE.NO_QUIRKS
- });
-};
-
-exports.createDocumentFragment = function() {
- return new Node({
- type: 'root',
- name: 'root',
- parent: null,
- prev: null,
- next: null,
- children: []
- });
-};
-
-exports.createElement = function(tagName, namespaceURI, attrs) {
- const attribs = Object.create(null);
- const attribsNamespace = Object.create(null);
- const attribsPrefix = Object.create(null);
-
- for (let i = 0; i < attrs.length; i++) {
- const attrName = attrs[i].name;
-
- attribs[attrName] = attrs[i].value;
- attribsNamespace[attrName] = attrs[i].namespace;
- attribsPrefix[attrName] = attrs[i].prefix;
- }
-
- return new Node({
- type: tagName === 'script' || tagName === 'style' ? tagName : 'tag',
- name: tagName,
- namespace: namespaceURI,
- attribs: attribs,
- 'x-attribsNamespace': attribsNamespace,
- 'x-attribsPrefix': attribsPrefix,
- children: [],
- parent: null,
- prev: null,
- next: null
- });
-};
-
-exports.createCommentNode = function(data) {
- return new Node({
- type: 'comment',
- data: data,
- parent: null,
- prev: null,
- next: null
- });
-};
-
-const createTextNode = function(value) {
- return new Node({
- type: 'text',
- data: value,
- parent: null,
- prev: null,
- next: null
- });
-};
-
-//Tree mutation
-const appendChild = (exports.appendChild = function(parentNode, newNode) {
- const prev = parentNode.children[parentNode.children.length - 1];
-
- if (prev) {
- prev.next = newNode;
- newNode.prev = prev;
- }
-
- parentNode.children.push(newNode);
- newNode.parent = parentNode;
-});
-
-const insertBefore = (exports.insertBefore = function(parentNode, newNode, referenceNode) {
- const insertionIdx = parentNode.children.indexOf(referenceNode);
- const prev = referenceNode.prev;
-
- if (prev) {
- prev.next = newNode;
- newNode.prev = prev;
- }
-
- referenceNode.prev = newNode;
- newNode.next = referenceNode;
-
- parentNode.children.splice(insertionIdx, 0, newNode);
- newNode.parent = parentNode;
-});
-
-exports.setTemplateContent = function(templateElement, contentElement) {
- appendChild(templateElement, contentElement);
-};
-
-exports.getTemplateContent = function(templateElement) {
- return templateElement.children[0];
-};
-
-exports.setDocumentType = function(document, name, publicId, systemId) {
- const data = doctype.serializeContent(name, publicId, systemId);
- let doctypeNode = null;
-
- for (let i = 0; i < document.children.length; i++) {
- if (document.children[i].type === 'directive' && document.children[i].name === '!doctype') {
- doctypeNode = document.children[i];
- break;
- }
- }
-
- if (doctypeNode) {
- doctypeNode.data = data;
- doctypeNode['x-name'] = name;
- doctypeNode['x-publicId'] = publicId;
- doctypeNode['x-systemId'] = systemId;
- } else {
- appendChild(
- document,
- new Node({
- type: 'directive',
- name: '!doctype',
- data: data,
- 'x-name': name,
- 'x-publicId': publicId,
- 'x-systemId': systemId
- })
- );
- }
-};
-
-exports.setDocumentMode = function(document, mode) {
- document['x-mode'] = mode;
-};
-
-exports.getDocumentMode = function(document) {
- return document['x-mode'];
-};
-
-exports.detachNode = function(node) {
- if (node.parent) {
- const idx = node.parent.children.indexOf(node);
- const prev = node.prev;
- const next = node.next;
-
- node.prev = null;
- node.next = null;
-
- if (prev) {
- prev.next = next;
- }
-
- if (next) {
- next.prev = prev;
- }
-
- node.parent.children.splice(idx, 1);
- node.parent = null;
- }
-};
-
-exports.insertText = function(parentNode, text) {
- const lastChild = parentNode.children[parentNode.children.length - 1];
-
- if (lastChild && lastChild.type === 'text') {
- lastChild.data += text;
- } else {
- appendChild(parentNode, createTextNode(text));
- }
-};
-
-exports.insertTextBefore = function(parentNode, text, referenceNode) {
- const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
-
- if (prevNode && prevNode.type === 'text') {
- prevNode.data += text;
- } else {
- insertBefore(parentNode, createTextNode(text), referenceNode);
- }
-};
-
-exports.adoptAttributes = function(recipient, attrs) {
- for (let i = 0; i < attrs.length; i++) {
- const attrName = attrs[i].name;
-
- if (typeof recipient.attribs[attrName] === 'undefined') {
- recipient.attribs[attrName] = attrs[i].value;
- recipient['x-attribsNamespace'][attrName] = attrs[i].namespace;
- recipient['x-attribsPrefix'][attrName] = attrs[i].prefix;
- }
- }
-};
-
-//Tree traversing
-exports.getFirstChild = function(node) {
- return node.children[0];
-};
-
-exports.getChildNodes = function(node) {
- return node.children;
-};
-
-exports.getParentNode = function(node) {
- return node.parent;
-};
-
-exports.getAttrList = function(element) {
- const attrList = [];
-
- for (const name in element.attribs) {
- attrList.push({
- name: name,
- value: element.attribs[name],
- namespace: element['x-attribsNamespace'][name],
- prefix: element['x-attribsPrefix'][name]
- });
- }
-
- return attrList;
-};
-
-//Node data
-exports.getTagName = function(element) {
- return element.name;
-};
-
-exports.getNamespaceURI = function(element) {
- return element.namespace;
-};
-
-exports.getTextNodeContent = function(textNode) {
- return textNode.data;
-};
-
-exports.getCommentNodeContent = function(commentNode) {
- return commentNode.data;
-};
-
-exports.getDocumentTypeNodeName = function(doctypeNode) {
- return doctypeNode['x-name'];
-};
-
-exports.getDocumentTypeNodePublicId = function(doctypeNode) {
- return doctypeNode['x-publicId'];
-};
-
-exports.getDocumentTypeNodeSystemId = function(doctypeNode) {
- return doctypeNode['x-systemId'];
-};
-
-//Node types
-exports.isTextNode = function(node) {
- return node.type === 'text';
-};
-
-exports.isCommentNode = function(node) {
- return node.type === 'comment';
-};
-
-exports.isDocumentTypeNode = function(node) {
- return node.type === 'directive' && node.name === '!doctype';
-};
-
-exports.isElementNode = function(node) {
- return !!node.attribs;
-};
-
-// Source code location
-exports.setNodeSourceCodeLocation = function(node, location) {
- node.sourceCodeLocation = location;
-};
-
-exports.getNodeSourceCodeLocation = function(node) {
- return node.sourceCodeLocation;
-};
-
-exports.updateNodeSourceCodeLocation = function(node, endLocation) {
- node.sourceCodeLocation = Object.assign(node.sourceCodeLocation, endLocation);
-};
-
-
-/***/ }),
-
-/***/ 27079:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const { DOCUMENT_MODE } = __nccwpck_require__(69338);
-
-//Const
-const VALID_DOCTYPE_NAME = 'html';
-const VALID_SYSTEM_ID = 'about:legacy-compat';
-const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';
-
-const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
- '+//silmaril//dtd html pro v0r11 19970101//',
- '-//as//dtd html 3.0 aswedit + extensions//',
- '-//advasoft ltd//dtd html 3.0 aswedit + extensions//',
- '-//ietf//dtd html 2.0 level 1//',
- '-//ietf//dtd html 2.0 level 2//',
- '-//ietf//dtd html 2.0 strict level 1//',
- '-//ietf//dtd html 2.0 strict level 2//',
- '-//ietf//dtd html 2.0 strict//',
- '-//ietf//dtd html 2.0//',
- '-//ietf//dtd html 2.1e//',
- '-//ietf//dtd html 3.0//',
- '-//ietf//dtd html 3.2 final//',
- '-//ietf//dtd html 3.2//',
- '-//ietf//dtd html 3//',
- '-//ietf//dtd html level 0//',
- '-//ietf//dtd html level 1//',
- '-//ietf//dtd html level 2//',
- '-//ietf//dtd html level 3//',
- '-//ietf//dtd html strict level 0//',
- '-//ietf//dtd html strict level 1//',
- '-//ietf//dtd html strict level 2//',
- '-//ietf//dtd html strict level 3//',
- '-//ietf//dtd html strict//',
- '-//ietf//dtd html//',
- '-//metrius//dtd metrius presentational//',
- '-//microsoft//dtd internet explorer 2.0 html strict//',
- '-//microsoft//dtd internet explorer 2.0 html//',
- '-//microsoft//dtd internet explorer 2.0 tables//',
- '-//microsoft//dtd internet explorer 3.0 html strict//',
- '-//microsoft//dtd internet explorer 3.0 html//',
- '-//microsoft//dtd internet explorer 3.0 tables//',
- '-//netscape comm. corp.//dtd html//',
- '-//netscape comm. corp.//dtd strict html//',
- "-//o'reilly and associates//dtd html 2.0//",
- "-//o'reilly and associates//dtd html extended 1.0//",
- "-//o'reilly and associates//dtd html extended relaxed 1.0//",
- '-//sq//dtd html 2.0 hotmetal + extensions//',
- '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//',
- '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//',
- '-//spyglass//dtd html 2.0 extended//',
- '-//sun microsystems corp.//dtd hotjava html//',
- '-//sun microsystems corp.//dtd hotjava strict html//',
- '-//w3c//dtd html 3 1995-03-24//',
- '-//w3c//dtd html 3.2 draft//',
- '-//w3c//dtd html 3.2 final//',
- '-//w3c//dtd html 3.2//',
- '-//w3c//dtd html 3.2s draft//',
- '-//w3c//dtd html 4.0 frameset//',
- '-//w3c//dtd html 4.0 transitional//',
- '-//w3c//dtd html experimental 19960712//',
- '-//w3c//dtd html experimental 970421//',
- '-//w3c//dtd w3 html//',
- '-//w3o//dtd w3 html 3.0//',
- '-//webtechs//dtd mozilla html 2.0//',
- '-//webtechs//dtd mozilla html//'
-];
-
-const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([
- '-//w3c//dtd html 4.01 frameset//',
- '-//w3c//dtd html 4.01 transitional//'
-]);
-
-const QUIRKS_MODE_PUBLIC_IDS = ['-//w3o//dtd w3 html strict 3.0//en//', '-/w3c/dtd html 4.0 transitional/en', 'html'];
-const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];
-
-const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([
- '-//w3c//dtd html 4.01 frameset//',
- '-//w3c//dtd html 4.01 transitional//'
-]);
-
-//Utils
-function enquoteDoctypeId(id) {
- const quote = id.indexOf('"') !== -1 ? "'" : '"';
-
- return quote + id + quote;
-}
-
-function hasPrefix(publicId, prefixes) {
- for (let i = 0; i < prefixes.length; i++) {
- if (publicId.indexOf(prefixes[i]) === 0) {
- return true;
- }
- }
-
- return false;
-}
-
-//API
-exports.isConforming = function(token) {
- return (
- token.name === VALID_DOCTYPE_NAME &&
- token.publicId === null &&
- (token.systemId === null || token.systemId === VALID_SYSTEM_ID)
- );
-};
-
-exports.getDocumentMode = function(token) {
- if (token.name !== VALID_DOCTYPE_NAME) {
- return DOCUMENT_MODE.QUIRKS;
- }
-
- const systemId = token.systemId;
-
- if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
- return DOCUMENT_MODE.QUIRKS;
- }
-
- let publicId = token.publicId;
-
- if (publicId !== null) {
- publicId = publicId.toLowerCase();
-
- if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) {
- return DOCUMENT_MODE.QUIRKS;
- }
-
- let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
-
- if (hasPrefix(publicId, prefixes)) {
- return DOCUMENT_MODE.QUIRKS;
- }
-
- prefixes =
- systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
-
- if (hasPrefix(publicId, prefixes)) {
- return DOCUMENT_MODE.LIMITED_QUIRKS;
- }
- }
-
- return DOCUMENT_MODE.NO_QUIRKS;
-};
-
-exports.serializeContent = function(name, publicId, systemId) {
- let str = '!DOCTYPE ';
-
- if (name) {
- str += name;
- }
-
- if (publicId) {
- str += ' PUBLIC ' + enquoteDoctypeId(publicId);
- } else if (systemId) {
- str += ' SYSTEM';
- }
-
- if (systemId !== null) {
- str += ' ' + enquoteDoctypeId(systemId);
- }
-
- return str;
-};
-
-
-/***/ }),
-
-/***/ 69338:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-const NS = (exports.NAMESPACES = {
- HTML: 'http://www.w3.org/1999/xhtml',
- MATHML: 'http://www.w3.org/1998/Math/MathML',
- SVG: 'http://www.w3.org/2000/svg',
- XLINK: 'http://www.w3.org/1999/xlink',
- XML: 'http://www.w3.org/XML/1998/namespace',
- XMLNS: 'http://www.w3.org/2000/xmlns/'
-});
-
-exports.ATTRS = {
- TYPE: 'type',
- ACTION: 'action',
- ENCODING: 'encoding',
- PROMPT: 'prompt',
- NAME: 'name',
- COLOR: 'color',
- FACE: 'face',
- SIZE: 'size'
-};
-
-exports.DOCUMENT_MODE = {
- NO_QUIRKS: 'no-quirks',
- QUIRKS: 'quirks',
- LIMITED_QUIRKS: 'limited-quirks'
-};
-
-const $ = (exports.TAG_NAMES = {
- A: 'a',
- ADDRESS: 'address',
- ANNOTATION_XML: 'annotation-xml',
- APPLET: 'applet',
- AREA: 'area',
- ARTICLE: 'article',
- ASIDE: 'aside',
-
- B: 'b',
- BASE: 'base',
- BASEFONT: 'basefont',
- BGSOUND: 'bgsound',
- BIG: 'big',
- BLOCKQUOTE: 'blockquote',
- BODY: 'body',
- BR: 'br',
- BUTTON: 'button',
-
- CAPTION: 'caption',
- CENTER: 'center',
- CODE: 'code',
- COL: 'col',
- COLGROUP: 'colgroup',
-
- DD: 'dd',
- DESC: 'desc',
- DETAILS: 'details',
- DIALOG: 'dialog',
- DIR: 'dir',
- DIV: 'div',
- DL: 'dl',
- DT: 'dt',
-
- EM: 'em',
- EMBED: 'embed',
-
- FIELDSET: 'fieldset',
- FIGCAPTION: 'figcaption',
- FIGURE: 'figure',
- FONT: 'font',
- FOOTER: 'footer',
- FOREIGN_OBJECT: 'foreignObject',
- FORM: 'form',
- FRAME: 'frame',
- FRAMESET: 'frameset',
-
- H1: 'h1',
- H2: 'h2',
- H3: 'h3',
- H4: 'h4',
- H5: 'h5',
- H6: 'h6',
- HEAD: 'head',
- HEADER: 'header',
- HGROUP: 'hgroup',
- HR: 'hr',
- HTML: 'html',
-
- I: 'i',
- IMG: 'img',
- IMAGE: 'image',
- INPUT: 'input',
- IFRAME: 'iframe',
-
- KEYGEN: 'keygen',
-
- LABEL: 'label',
- LI: 'li',
- LINK: 'link',
- LISTING: 'listing',
-
- MAIN: 'main',
- MALIGNMARK: 'malignmark',
- MARQUEE: 'marquee',
- MATH: 'math',
- MENU: 'menu',
- META: 'meta',
- MGLYPH: 'mglyph',
- MI: 'mi',
- MO: 'mo',
- MN: 'mn',
- MS: 'ms',
- MTEXT: 'mtext',
-
- NAV: 'nav',
- NOBR: 'nobr',
- NOFRAMES: 'noframes',
- NOEMBED: 'noembed',
- NOSCRIPT: 'noscript',
-
- OBJECT: 'object',
- OL: 'ol',
- OPTGROUP: 'optgroup',
- OPTION: 'option',
-
- P: 'p',
- PARAM: 'param',
- PLAINTEXT: 'plaintext',
- PRE: 'pre',
-
- RB: 'rb',
- RP: 'rp',
- RT: 'rt',
- RTC: 'rtc',
- RUBY: 'ruby',
-
- S: 's',
- SCRIPT: 'script',
- SECTION: 'section',
- SELECT: 'select',
- SOURCE: 'source',
- SMALL: 'small',
- SPAN: 'span',
- STRIKE: 'strike',
- STRONG: 'strong',
- STYLE: 'style',
- SUB: 'sub',
- SUMMARY: 'summary',
- SUP: 'sup',
-
- TABLE: 'table',
- TBODY: 'tbody',
- TEMPLATE: 'template',
- TEXTAREA: 'textarea',
- TFOOT: 'tfoot',
- TD: 'td',
- TH: 'th',
- THEAD: 'thead',
- TITLE: 'title',
- TR: 'tr',
- TRACK: 'track',
- TT: 'tt',
-
- U: 'u',
- UL: 'ul',
-
- SVG: 'svg',
-
- VAR: 'var',
-
- WBR: 'wbr',
-
- XMP: 'xmp'
-});
-
-exports.SPECIAL_ELEMENTS = {
- [NS.HTML]: {
- [$.ADDRESS]: true,
- [$.APPLET]: true,
- [$.AREA]: true,
- [$.ARTICLE]: true,
- [$.ASIDE]: true,
- [$.BASE]: true,
- [$.BASEFONT]: true,
- [$.BGSOUND]: true,
- [$.BLOCKQUOTE]: true,
- [$.BODY]: true,
- [$.BR]: true,
- [$.BUTTON]: true,
- [$.CAPTION]: true,
- [$.CENTER]: true,
- [$.COL]: true,
- [$.COLGROUP]: true,
- [$.DD]: true,
- [$.DETAILS]: true,
- [$.DIR]: true,
- [$.DIV]: true,
- [$.DL]: true,
- [$.DT]: true,
- [$.EMBED]: true,
- [$.FIELDSET]: true,
- [$.FIGCAPTION]: true,
- [$.FIGURE]: true,
- [$.FOOTER]: true,
- [$.FORM]: true,
- [$.FRAME]: true,
- [$.FRAMESET]: true,
- [$.H1]: true,
- [$.H2]: true,
- [$.H3]: true,
- [$.H4]: true,
- [$.H5]: true,
- [$.H6]: true,
- [$.HEAD]: true,
- [$.HEADER]: true,
- [$.HGROUP]: true,
- [$.HR]: true,
- [$.HTML]: true,
- [$.IFRAME]: true,
- [$.IMG]: true,
- [$.INPUT]: true,
- [$.LI]: true,
- [$.LINK]: true,
- [$.LISTING]: true,
- [$.MAIN]: true,
- [$.MARQUEE]: true,
- [$.MENU]: true,
- [$.META]: true,
- [$.NAV]: true,
- [$.NOEMBED]: true,
- [$.NOFRAMES]: true,
- [$.NOSCRIPT]: true,
- [$.OBJECT]: true,
- [$.OL]: true,
- [$.P]: true,
- [$.PARAM]: true,
- [$.PLAINTEXT]: true,
- [$.PRE]: true,
- [$.SCRIPT]: true,
- [$.SECTION]: true,
- [$.SELECT]: true,
- [$.SOURCE]: true,
- [$.STYLE]: true,
- [$.SUMMARY]: true,
- [$.TABLE]: true,
- [$.TBODY]: true,
- [$.TD]: true,
- [$.TEMPLATE]: true,
- [$.TEXTAREA]: true,
- [$.TFOOT]: true,
- [$.TH]: true,
- [$.THEAD]: true,
- [$.TITLE]: true,
- [$.TR]: true,
- [$.TRACK]: true,
- [$.UL]: true,
- [$.WBR]: true,
- [$.XMP]: true
- },
- [NS.MATHML]: {
- [$.MI]: true,
- [$.MO]: true,
- [$.MN]: true,
- [$.MS]: true,
- [$.MTEXT]: true,
- [$.ANNOTATION_XML]: true
- },
- [NS.SVG]: {
- [$.TITLE]: true,
- [$.FOREIGN_OBJECT]: true,
- [$.DESC]: true
- }
-};
-
-
-/***/ }),
-
-/***/ 38714:
-/***/ ((module) => {
-
-"use strict";
-
-
-function posix(path) {
- return path.charAt(0) === '/';
-}
-
-function win32(path) {
- // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
- var result = splitDeviceRe.exec(path);
- var device = result[1] || '';
- var isUnc = Boolean(device && device.charAt(1) !== ':');
-
- // UNC paths are always absolute
- return Boolean(result[2] || isUnc);
-}
-
-module.exports = process.platform === 'win32' ? win32 : posix;
-module.exports.posix = posix;
-module.exports.win32 = win32;
-
-
-/***/ }),
-
-/***/ 85644:
-/***/ (function(module) {
-
-// Generated by CoffeeScript 1.12.2
-(function() {
- var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
-
- if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
- module.exports = function() {
- return performance.now();
- };
- } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
- module.exports = function() {
- return (getNanoSeconds() - nodeLoadTime) / 1e6;
- };
- hrtime = process.hrtime;
- getNanoSeconds = function() {
- var hr;
- hr = hrtime();
- return hr[0] * 1e9 + hr[1];
- };
- moduleLoadTime = getNanoSeconds();
- upTime = process.uptime() * 1e9;
- nodeLoadTime = moduleLoadTime - upTime;
- } else if (Date.now) {
- module.exports = function() {
- return Date.now() - loadTime;
- };
- loadTime = Date.now();
- } else {
- module.exports = function() {
- return new Date().getTime() - loadTime;
- };
- loadTime = new Date().getTime();
- }
-
-}).call(this);
-
-//# sourceMappingURL=performance-now.js.map
-
-
-/***/ }),
-
-/***/ 38961:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var url = __nccwpck_require__(78835)
-var fs = __nccwpck_require__(35747)
-
-//Parse method copied from https://github.com/brianc/node-postgres
-//Copyright (c) 2010-2014 Brian Carlson (brian.m.carlson@gmail.com)
-//MIT License
-
-//parses a connection string
-function parse(str) {
- //unix socket
- if (str.charAt(0) === '/') {
- var config = str.split(' ')
- return { host: config[0], database: config[1] }
- }
-
- // url parse expects spaces encoded as %20
- var result = url.parse(
- / |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str) ? encodeURI(str).replace(/\%25(\d\d)/g, '%$1') : str,
- true
- )
- var config = result.query
- for (var k in config) {
- if (Array.isArray(config[k])) {
- config[k] = config[k][config[k].length - 1]
- }
- }
-
- var auth = (result.auth || ':').split(':')
- config.user = auth[0]
- config.password = auth.splice(1).join(':')
-
- config.port = result.port
- if (result.protocol == 'socket:') {
- config.host = decodeURI(result.pathname)
- config.database = result.query.db
- config.client_encoding = result.query.encoding
- return config
- }
- if (!config.host) {
- // Only set the host if there is no equivalent query param.
- config.host = result.hostname
- }
-
- // If the host is missing it might be a URL-encoded path to a socket.
- var pathname = result.pathname
- if (!config.host && pathname && /^%2f/i.test(pathname)) {
- var pathnameSplit = pathname.split('/')
- config.host = decodeURIComponent(pathnameSplit[0])
- pathname = pathnameSplit.splice(1).join('/')
- }
- // result.pathname is not always guaranteed to have a '/' prefix (e.g. relative urls)
- // only strip the slash if it is present.
- if (pathname && pathname.charAt(0) === '/') {
- pathname = pathname.slice(1) || null
- }
- config.database = pathname && decodeURI(pathname)
-
- if (config.ssl === 'true' || config.ssl === '1') {
- config.ssl = true
- }
-
- if (config.ssl === '0') {
- config.ssl = false
- }
-
- if (config.sslcert || config.sslkey || config.sslrootcert || config.sslmode) {
- config.ssl = {}
- }
-
- if (config.sslcert) {
- config.ssl.cert = fs.readFileSync(config.sslcert).toString()
- }
-
- if (config.sslkey) {
- config.ssl.key = fs.readFileSync(config.sslkey).toString()
- }
-
- if (config.sslrootcert) {
- config.ssl.ca = fs.readFileSync(config.sslrootcert).toString()
- }
-
- switch (config.sslmode) {
- case 'disable': {
- config.ssl = false
- break
- }
- case 'prefer':
- case 'require':
- case 'verify-ca':
- case 'verify-full': {
- break
- }
- case 'no-verify': {
- config.ssl.rejectUnauthorized = false
- break
- }
- }
-
- return config
-}
-
-module.exports = parse
-
-parse.parse = parse
-
-
-/***/ }),
-
-/***/ 41180:
-/***/ ((module) => {
-
-"use strict";
-
-
-// selected so (BASE - 1) * 0x100000000 + 0xffffffff is a safe integer
-var BASE = 1000000;
-
-function readInt8(buffer) {
- var high = buffer.readInt32BE(0);
- var low = buffer.readUInt32BE(4);
- var sign = '';
-
- if (high < 0) {
- high = ~high + (low === 0);
- low = (~low + 1) >>> 0;
- sign = '-';
- }
-
- var result = '';
- var carry;
- var t;
- var digits;
- var pad;
- var l;
- var i;
-
- {
- carry = high % BASE;
- high = high / BASE >>> 0;
-
- t = 0x100000000 * carry + low;
- low = t / BASE >>> 0;
- digits = '' + (t - BASE * low);
-
- if (low === 0 && high === 0) {
- return sign + digits + result;
- }
-
- pad = '';
- l = 6 - digits.length;
-
- for (i = 0; i < l; i++) {
- pad += '0';
- }
-
- result = pad + digits + result;
- }
-
- {
- carry = high % BASE;
- high = high / BASE >>> 0;
-
- t = 0x100000000 * carry + low;
- low = t / BASE >>> 0;
- digits = '' + (t - BASE * low);
-
- if (low === 0 && high === 0) {
- return sign + digits + result;
- }
-
- pad = '';
- l = 6 - digits.length;
-
- for (i = 0; i < l; i++) {
- pad += '0';
- }
-
- result = pad + digits + result;
- }
-
- {
- carry = high % BASE;
- high = high / BASE >>> 0;
-
- t = 0x100000000 * carry + low;
- low = t / BASE >>> 0;
- digits = '' + (t - BASE * low);
-
- if (low === 0 && high === 0) {
- return sign + digits + result;
- }
-
- pad = '';
- l = 6 - digits.length;
-
- for (i = 0; i < l; i++) {
- pad += '0';
- }
-
- result = pad + digits + result;
- }
-
- {
- carry = high % BASE;
- t = 0x100000000 * carry + low;
- digits = '' + t % BASE;
-
- return sign + digits + result;
- }
-}
-
-module.exports = readInt8;
-
-
-/***/ }),
-
-/***/ 99599:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-const EventEmitter = __nccwpck_require__(28614).EventEmitter
-
-const NOOP = function () {}
-
-const removeWhere = (list, predicate) => {
- const i = list.findIndex(predicate)
-
- return i === -1 ? undefined : list.splice(i, 1)[0]
-}
-
-class IdleItem {
- constructor(client, idleListener, timeoutId) {
- this.client = client
- this.idleListener = idleListener
- this.timeoutId = timeoutId
- }
-}
-
-class PendingItem {
- constructor(callback) {
- this.callback = callback
- }
-}
-
-function throwOnDoubleRelease() {
- throw new Error('Release called on client which has already been released to the pool.')
-}
-
-function promisify(Promise, callback) {
- if (callback) {
- return { callback: callback, result: undefined }
- }
- let rej
- let res
- const cb = function (err, client) {
- err ? rej(err) : res(client)
- }
- const result = new Promise(function (resolve, reject) {
- res = resolve
- rej = reject
- })
- return { callback: cb, result: result }
-}
-
-function makeIdleListener(pool, client) {
- return function idleListener(err) {
- err.client = client
-
- client.removeListener('error', idleListener)
- client.on('error', () => {
- pool.log('additional client error after disconnection due to error', err)
- })
- pool._remove(client)
- // TODO - document that once the pool emits an error
- // the client has already been closed & purged and is unusable
- pool.emit('error', err, client)
- }
-}
-
-class Pool extends EventEmitter {
- constructor(options, Client) {
- super()
- this.options = Object.assign({}, options)
-
- if (options != null && 'password' in options) {
- // "hiding" the password so it doesn't show up in stack traces
- // or if the client is console.logged
- Object.defineProperty(this.options, 'password', {
- configurable: true,
- enumerable: false,
- writable: true,
- value: options.password,
- })
- }
- if (options != null && options.ssl && options.ssl.key) {
- // "hiding" the ssl->key so it doesn't show up in stack traces
- // or if the client is console.logged
- Object.defineProperty(this.options.ssl, 'key', {
- enumerable: false,
- })
- }
-
- this.options.max = this.options.max || this.options.poolSize || 10
- this.options.maxUses = this.options.maxUses || Infinity
- this.log = this.options.log || function () {}
- this.Client = this.options.Client || Client || __nccwpck_require__(44194).Client
- this.Promise = this.options.Promise || global.Promise
-
- if (typeof this.options.idleTimeoutMillis === 'undefined') {
- this.options.idleTimeoutMillis = 10000
- }
-
- this._clients = []
- this._idle = []
- this._pendingQueue = []
- this._endCallback = undefined
- this.ending = false
- this.ended = false
- }
-
- _isFull() {
- return this._clients.length >= this.options.max
- }
-
- _pulseQueue() {
- this.log('pulse queue')
- if (this.ended) {
- this.log('pulse queue ended')
- return
- }
- if (this.ending) {
- this.log('pulse queue on ending')
- if (this._idle.length) {
- this._idle.slice().map((item) => {
- this._remove(item.client)
- })
- }
- if (!this._clients.length) {
- this.ended = true
- this._endCallback()
- }
- return
- }
- // if we don't have any waiting, do nothing
- if (!this._pendingQueue.length) {
- this.log('no queued requests')
- return
- }
- // if we don't have any idle clients and we have no more room do nothing
- if (!this._idle.length && this._isFull()) {
- return
- }
- const pendingItem = this._pendingQueue.shift()
- if (this._idle.length) {
- const idleItem = this._idle.pop()
- clearTimeout(idleItem.timeoutId)
- const client = idleItem.client
- const idleListener = idleItem.idleListener
-
- return this._acquireClient(client, pendingItem, idleListener, false)
- }
- if (!this._isFull()) {
- return this.newClient(pendingItem)
- }
- throw new Error('unexpected condition')
- }
-
- _remove(client) {
- const removed = removeWhere(this._idle, (item) => item.client === client)
-
- if (removed !== undefined) {
- clearTimeout(removed.timeoutId)
- }
-
- this._clients = this._clients.filter((c) => c !== client)
- client.end()
- this.emit('remove', client)
- }
-
- connect(cb) {
- if (this.ending) {
- const err = new Error('Cannot use a pool after calling end on the pool')
- return cb ? cb(err) : this.Promise.reject(err)
- }
-
- const response = promisify(this.Promise, cb)
- const result = response.result
-
- // if we don't have to connect a new client, don't do so
- if (this._clients.length >= this.options.max || this._idle.length) {
- // if we have idle clients schedule a pulse immediately
- if (this._idle.length) {
- process.nextTick(() => this._pulseQueue())
- }
-
- if (!this.options.connectionTimeoutMillis) {
- this._pendingQueue.push(new PendingItem(response.callback))
- return result
- }
-
- const queueCallback = (err, res, done) => {
- clearTimeout(tid)
- response.callback(err, res, done)
- }
-
- const pendingItem = new PendingItem(queueCallback)
-
- // set connection timeout on checking out an existing client
- const tid = setTimeout(() => {
- // remove the callback from pending waiters because
- // we're going to call it with a timeout error
- removeWhere(this._pendingQueue, (i) => i.callback === queueCallback)
- pendingItem.timedOut = true
- response.callback(new Error('timeout exceeded when trying to connect'))
- }, this.options.connectionTimeoutMillis)
-
- this._pendingQueue.push(pendingItem)
- return result
- }
-
- this.newClient(new PendingItem(response.callback))
-
- return result
- }
-
- newClient(pendingItem) {
- const client = new this.Client(this.options)
- this._clients.push(client)
- const idleListener = makeIdleListener(this, client)
-
- this.log('checking client timeout')
-
- // connection timeout logic
- let tid
- let timeoutHit = false
- if (this.options.connectionTimeoutMillis) {
- tid = setTimeout(() => {
- this.log('ending client due to timeout')
- timeoutHit = true
- // force kill the node driver, and let libpq do its teardown
- client.connection ? client.connection.stream.destroy() : client.end()
- }, this.options.connectionTimeoutMillis)
- }
-
- this.log('connecting new client')
- client.connect((err) => {
- if (tid) {
- clearTimeout(tid)
- }
- client.on('error', idleListener)
- if (err) {
- this.log('client failed to connect', err)
- // remove the dead client from our list of clients
- this._clients = this._clients.filter((c) => c !== client)
- if (timeoutHit) {
- err.message = 'Connection terminated due to connection timeout'
- }
-
- // this client won’t be released, so move on immediately
- this._pulseQueue()
-
- if (!pendingItem.timedOut) {
- pendingItem.callback(err, undefined, NOOP)
- }
- } else {
- this.log('new client connected')
-
- return this._acquireClient(client, pendingItem, idleListener, true)
- }
- })
- }
-
- // acquire a client for a pending work item
- _acquireClient(client, pendingItem, idleListener, isNew) {
- if (isNew) {
- this.emit('connect', client)
- }
-
- this.emit('acquire', client)
-
- client.release = this._releaseOnce(client, idleListener)
-
- client.removeListener('error', idleListener)
-
- if (!pendingItem.timedOut) {
- if (isNew && this.options.verify) {
- this.options.verify(client, (err) => {
- if (err) {
- client.release(err)
- return pendingItem.callback(err, undefined, NOOP)
- }
-
- pendingItem.callback(undefined, client, client.release)
- })
- } else {
- pendingItem.callback(undefined, client, client.release)
- }
- } else {
- if (isNew && this.options.verify) {
- this.options.verify(client, client.release)
- } else {
- client.release()
- }
- }
- }
-
- // returns a function that wraps _release and throws if called more than once
- _releaseOnce(client, idleListener) {
- let released = false
-
- return (err) => {
- if (released) {
- throwOnDoubleRelease()
- }
-
- released = true
- this._release(client, idleListener, err)
- }
- }
-
- // release a client back to the poll, include an error
- // to remove it from the pool
- _release(client, idleListener, err) {
- client.on('error', idleListener)
-
- client._poolUseCount = (client._poolUseCount || 0) + 1
-
- // TODO(bmc): expose a proper, public interface _queryable and _ending
- if (err || this.ending || !client._queryable || client._ending || client._poolUseCount >= this.options.maxUses) {
- if (client._poolUseCount >= this.options.maxUses) {
- this.log('remove expended client')
- }
- this._remove(client)
- this._pulseQueue()
- return
- }
-
- // idle timeout
- let tid
- if (this.options.idleTimeoutMillis) {
- tid = setTimeout(() => {
- this.log('remove idle client')
- this._remove(client)
- }, this.options.idleTimeoutMillis)
- }
-
- this._idle.push(new IdleItem(client, idleListener, tid))
- this._pulseQueue()
- }
-
- query(text, values, cb) {
- // guard clause against passing a function as the first parameter
- if (typeof text === 'function') {
- const response = promisify(this.Promise, text)
- setImmediate(function () {
- return response.callback(new Error('Passing a function as the first parameter to pool.query is not supported'))
- })
- return response.result
- }
-
- // allow plain text query without values
- if (typeof values === 'function') {
- cb = values
- values = undefined
- }
- const response = promisify(this.Promise, cb)
- cb = response.callback
-
- this.connect((err, client) => {
- if (err) {
- return cb(err)
- }
-
- let clientReleased = false
- const onError = (err) => {
- if (clientReleased) {
- return
- }
- clientReleased = true
- client.release(err)
- cb(err)
- }
-
- client.once('error', onError)
- this.log('dispatching query')
- client.query(text, values, (err, res) => {
- this.log('query dispatched')
- client.removeListener('error', onError)
- if (clientReleased) {
- return
- }
- clientReleased = true
- client.release(err)
- if (err) {
- return cb(err)
- } else {
- return cb(undefined, res)
- }
- })
- })
- return response.result
- }
-
- end(cb) {
- this.log('ending')
- if (this.ending) {
- const err = new Error('Called end on pool more than once')
- return cb ? cb(err) : this.Promise.reject(err)
- }
- this.ending = true
- const promised = promisify(this.Promise, cb)
- this._endCallback = promised.callback
- this._pulseQueue()
- return promised.result
- }
-
- get waitingCount() {
- return this._pendingQueue.length
- }
-
- get idleCount() {
- return this._idle.length
- }
-
- get totalCount() {
- return this._clients.length
- }
-}
-module.exports = Pool
-
-
-/***/ }),
-
-/***/ 10320:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const emptyBuffer = Buffer.allocUnsafe(0);
-class BufferReader {
- constructor(offset = 0) {
- this.offset = offset;
- this.buffer = emptyBuffer;
- // TODO(bmc): support non-utf8 encoding?
- this.encoding = 'utf-8';
- }
- setBuffer(offset, buffer) {
- this.offset = offset;
- this.buffer = buffer;
- }
- int16() {
- const result = this.buffer.readInt16BE(this.offset);
- this.offset += 2;
- return result;
- }
- byte() {
- const result = this.buffer[this.offset];
- this.offset++;
- return result;
- }
- int32() {
- const result = this.buffer.readInt32BE(this.offset);
- this.offset += 4;
- return result;
- }
- string(length) {
- const result = this.buffer.toString(this.encoding, this.offset, this.offset + length);
- this.offset += length;
- return result;
- }
- cstring() {
- const start = this.offset;
- let end = start;
- while (this.buffer[end++] !== 0) { }
- this.offset = end;
- return this.buffer.toString(this.encoding, start, end - 1);
- }
- bytes(length) {
- const result = this.buffer.slice(this.offset, this.offset + length);
- this.offset += length;
- return result;
- }
-}
-exports.BufferReader = BufferReader;
-//# sourceMappingURL=buffer-reader.js.map
-
-/***/ }),
-
-/***/ 19228:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-//binary data writer tuned for encoding binary specific to the postgres binary protocol
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-class Writer {
- constructor(size = 256) {
- this.size = size;
- this.offset = 5;
- this.headerPosition = 0;
- this.buffer = Buffer.allocUnsafe(size);
- }
- ensure(size) {
- var remaining = this.buffer.length - this.offset;
- if (remaining < size) {
- var oldBuffer = this.buffer;
- // exponential growth factor of around ~ 1.5
- // https://stackoverflow.com/questions/2269063/buffer-growth-strategy
- var newSize = oldBuffer.length + (oldBuffer.length >> 1) + size;
- this.buffer = Buffer.allocUnsafe(newSize);
- oldBuffer.copy(this.buffer);
- }
- }
- addInt32(num) {
- this.ensure(4);
- this.buffer[this.offset++] = (num >>> 24) & 0xff;
- this.buffer[this.offset++] = (num >>> 16) & 0xff;
- this.buffer[this.offset++] = (num >>> 8) & 0xff;
- this.buffer[this.offset++] = (num >>> 0) & 0xff;
- return this;
- }
- addInt16(num) {
- this.ensure(2);
- this.buffer[this.offset++] = (num >>> 8) & 0xff;
- this.buffer[this.offset++] = (num >>> 0) & 0xff;
- return this;
- }
- addCString(string) {
- if (!string) {
- this.ensure(1);
- }
- else {
- var len = Buffer.byteLength(string);
- this.ensure(len + 1); // +1 for null terminator
- this.buffer.write(string, this.offset, 'utf-8');
- this.offset += len;
- }
- this.buffer[this.offset++] = 0; // null terminator
- return this;
- }
- addString(string = '') {
- var len = Buffer.byteLength(string);
- this.ensure(len);
- this.buffer.write(string, this.offset);
- this.offset += len;
- return this;
- }
- add(otherBuffer) {
- this.ensure(otherBuffer.length);
- otherBuffer.copy(this.buffer, this.offset);
- this.offset += otherBuffer.length;
- return this;
- }
- join(code) {
- if (code) {
- this.buffer[this.headerPosition] = code;
- //length is everything in this packet minus the code
- const length = this.offset - (this.headerPosition + 1);
- this.buffer.writeInt32BE(length, this.headerPosition + 1);
- }
- return this.buffer.slice(code ? 0 : 5, this.offset);
- }
- flush(code) {
- var result = this.join(code);
- this.offset = 5;
- this.headerPosition = 0;
- this.buffer = Buffer.allocUnsafe(this.size);
- return result;
- }
-}
-exports.Writer = Writer;
-//# sourceMappingURL=buffer-writer.js.map
-
-/***/ }),
-
-/***/ 21113:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const messages_1 = __nccwpck_require__(36359);
-exports.DatabaseError = messages_1.DatabaseError;
-const serializer_1 = __nccwpck_require__(42439);
-exports.serialize = serializer_1.serialize;
-const parser_1 = __nccwpck_require__(67912);
-function parse(stream, callback) {
- const parser = new parser_1.Parser();
- stream.on('data', (buffer) => parser.parse(buffer, callback));
- return new Promise((resolve) => stream.on('end', () => resolve()));
-}
-exports.parse = parse;
-//# sourceMappingURL=index.js.map
-
-/***/ }),
-
-/***/ 36359:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-exports.parseComplete = {
- name: "parseComplete" /* parseComplete */,
- length: 5,
-};
-exports.bindComplete = {
- name: "bindComplete" /* bindComplete */,
- length: 5,
-};
-exports.closeComplete = {
- name: "closeComplete" /* closeComplete */,
- length: 5,
-};
-exports.noData = {
- name: "noData" /* noData */,
- length: 5,
-};
-exports.portalSuspended = {
- name: "portalSuspended" /* portalSuspended */,
- length: 5,
-};
-exports.replicationStart = {
- name: "replicationStart" /* replicationStart */,
- length: 4,
-};
-exports.emptyQuery = {
- name: "emptyQuery" /* emptyQuery */,
- length: 4,
-};
-exports.copyDone = {
- name: "copyDone" /* copyDone */,
- length: 4,
-};
-class DatabaseError extends Error {
- constructor(message, length, name) {
- super(message);
- this.length = length;
- this.name = name;
- }
-}
-exports.DatabaseError = DatabaseError;
-class CopyDataMessage {
- constructor(length, chunk) {
- this.length = length;
- this.chunk = chunk;
- this.name = "copyData" /* copyData */;
- }
-}
-exports.CopyDataMessage = CopyDataMessage;
-class CopyResponse {
- constructor(length, name, binary, columnCount) {
- this.length = length;
- this.name = name;
- this.binary = binary;
- this.columnTypes = new Array(columnCount);
- }
-}
-exports.CopyResponse = CopyResponse;
-class Field {
- constructor(name, tableID, columnID, dataTypeID, dataTypeSize, dataTypeModifier, format) {
- this.name = name;
- this.tableID = tableID;
- this.columnID = columnID;
- this.dataTypeID = dataTypeID;
- this.dataTypeSize = dataTypeSize;
- this.dataTypeModifier = dataTypeModifier;
- this.format = format;
- }
-}
-exports.Field = Field;
-class RowDescriptionMessage {
- constructor(length, fieldCount) {
- this.length = length;
- this.fieldCount = fieldCount;
- this.name = "rowDescription" /* rowDescription */;
- this.fields = new Array(this.fieldCount);
- }
-}
-exports.RowDescriptionMessage = RowDescriptionMessage;
-class ParameterStatusMessage {
- constructor(length, parameterName, parameterValue) {
- this.length = length;
- this.parameterName = parameterName;
- this.parameterValue = parameterValue;
- this.name = "parameterStatus" /* parameterStatus */;
- }
-}
-exports.ParameterStatusMessage = ParameterStatusMessage;
-class AuthenticationMD5Password {
- constructor(length, salt) {
- this.length = length;
- this.salt = salt;
- this.name = "authenticationMD5Password" /* authenticationMD5Password */;
- }
-}
-exports.AuthenticationMD5Password = AuthenticationMD5Password;
-class BackendKeyDataMessage {
- constructor(length, processID, secretKey) {
- this.length = length;
- this.processID = processID;
- this.secretKey = secretKey;
- this.name = "backendKeyData" /* backendKeyData */;
- }
-}
-exports.BackendKeyDataMessage = BackendKeyDataMessage;
-class NotificationResponseMessage {
- constructor(length, processId, channel, payload) {
- this.length = length;
- this.processId = processId;
- this.channel = channel;
- this.payload = payload;
- this.name = "notification" /* notification */;
- }
-}
-exports.NotificationResponseMessage = NotificationResponseMessage;
-class ReadyForQueryMessage {
- constructor(length, status) {
- this.length = length;
- this.status = status;
- this.name = "readyForQuery" /* readyForQuery */;
- }
-}
-exports.ReadyForQueryMessage = ReadyForQueryMessage;
-class CommandCompleteMessage {
- constructor(length, text) {
- this.length = length;
- this.text = text;
- this.name = "commandComplete" /* commandComplete */;
- }
-}
-exports.CommandCompleteMessage = CommandCompleteMessage;
-class DataRowMessage {
- constructor(length, fields) {
- this.length = length;
- this.fields = fields;
- this.name = "dataRow" /* dataRow */;
- this.fieldCount = fields.length;
- }
-}
-exports.DataRowMessage = DataRowMessage;
-class NoticeMessage {
- constructor(length, message) {
- this.length = length;
- this.message = message;
- this.name = "notice" /* notice */;
- }
-}
-exports.NoticeMessage = NoticeMessage;
-//# sourceMappingURL=messages.js.map
-
-/***/ }),
-
-/***/ 67912:
-/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
-
-"use strict";
-
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const messages_1 = __nccwpck_require__(36359);
-const buffer_reader_1 = __nccwpck_require__(10320);
-const assert_1 = __importDefault(__nccwpck_require__(42357));
-// every message is prefixed with a single bye
-const CODE_LENGTH = 1;
-// every message has an int32 length which includes itself but does
-// NOT include the code in the length
-const LEN_LENGTH = 4;
-const HEADER_LENGTH = CODE_LENGTH + LEN_LENGTH;
-const emptyBuffer = Buffer.allocUnsafe(0);
-class Parser {
- constructor(opts) {
- var _a, _b;
- this.buffer = emptyBuffer;
- this.bufferLength = 0;
- this.bufferOffset = 0;
- this.reader = new buffer_reader_1.BufferReader();
- if (((_a = opts) === null || _a === void 0 ? void 0 : _a.mode) === 'binary') {
- throw new Error('Binary mode not supported yet');
- }
- this.mode = ((_b = opts) === null || _b === void 0 ? void 0 : _b.mode) || 'text';
- }
- parse(buffer, callback) {
- this.mergeBuffer(buffer);
- const bufferFullLength = this.bufferOffset + this.bufferLength;
- let offset = this.bufferOffset;
- while (offset + HEADER_LENGTH <= bufferFullLength) {
- // code is 1 byte long - it identifies the message type
- const code = this.buffer[offset];
- // length is 1 Uint32BE - it is the length of the message EXCLUDING the code
- const length = this.buffer.readUInt32BE(offset + CODE_LENGTH);
- const fullMessageLength = CODE_LENGTH + length;
- if (fullMessageLength + offset <= bufferFullLength) {
- const message = this.handlePacket(offset + HEADER_LENGTH, code, length, this.buffer);
- callback(message);
- offset += fullMessageLength;
- }
- else {
- break;
- }
- }
- if (offset === bufferFullLength) {
- // No more use for the buffer
- this.buffer = emptyBuffer;
- this.bufferLength = 0;
- this.bufferOffset = 0;
- }
- else {
- // Adjust the cursors of remainingBuffer
- this.bufferLength = bufferFullLength - offset;
- this.bufferOffset = offset;
- }
- }
- mergeBuffer(buffer) {
- if (this.bufferLength > 0) {
- const newLength = this.bufferLength + buffer.byteLength;
- const newFullLength = newLength + this.bufferOffset;
- if (newFullLength > this.buffer.byteLength) {
- // We can't concat the new buffer with the remaining one
- let newBuffer;
- if (newLength <= this.buffer.byteLength && this.bufferOffset >= this.bufferLength) {
- // We can move the relevant part to the beginning of the buffer instead of allocating a new buffer
- newBuffer = this.buffer;
- }
- else {
- // Allocate a new larger buffer
- let newBufferLength = this.buffer.byteLength * 2;
- while (newLength >= newBufferLength) {
- newBufferLength *= 2;
- }
- newBuffer = Buffer.allocUnsafe(newBufferLength);
- }
- // Move the remaining buffer to the new one
- this.buffer.copy(newBuffer, 0, this.bufferOffset, this.bufferOffset + this.bufferLength);
- this.buffer = newBuffer;
- this.bufferOffset = 0;
- }
- // Concat the new buffer with the remaining one
- buffer.copy(this.buffer, this.bufferOffset + this.bufferLength);
- this.bufferLength = newLength;
- }
- else {
- this.buffer = buffer;
- this.bufferOffset = 0;
- this.bufferLength = buffer.byteLength;
- }
- }
- handlePacket(offset, code, length, bytes) {
- switch (code) {
- case 50 /* BindComplete */:
- return messages_1.bindComplete;
- case 49 /* ParseComplete */:
- return messages_1.parseComplete;
- case 51 /* CloseComplete */:
- return messages_1.closeComplete;
- case 110 /* NoData */:
- return messages_1.noData;
- case 115 /* PortalSuspended */:
- return messages_1.portalSuspended;
- case 99 /* CopyDone */:
- return messages_1.copyDone;
- case 87 /* ReplicationStart */:
- return messages_1.replicationStart;
- case 73 /* EmptyQuery */:
- return messages_1.emptyQuery;
- case 68 /* DataRow */:
- return this.parseDataRowMessage(offset, length, bytes);
- case 67 /* CommandComplete */:
- return this.parseCommandCompleteMessage(offset, length, bytes);
- case 90 /* ReadyForQuery */:
- return this.parseReadyForQueryMessage(offset, length, bytes);
- case 65 /* NotificationResponse */:
- return this.parseNotificationMessage(offset, length, bytes);
- case 82 /* AuthenticationResponse */:
- return this.parseAuthenticationResponse(offset, length, bytes);
- case 83 /* ParameterStatus */:
- return this.parseParameterStatusMessage(offset, length, bytes);
- case 75 /* BackendKeyData */:
- return this.parseBackendKeyData(offset, length, bytes);
- case 69 /* ErrorMessage */:
- return this.parseErrorMessage(offset, length, bytes, "error" /* error */);
- case 78 /* NoticeMessage */:
- return this.parseErrorMessage(offset, length, bytes, "notice" /* notice */);
- case 84 /* RowDescriptionMessage */:
- return this.parseRowDescriptionMessage(offset, length, bytes);
- case 71 /* CopyIn */:
- return this.parseCopyInMessage(offset, length, bytes);
- case 72 /* CopyOut */:
- return this.parseCopyOutMessage(offset, length, bytes);
- case 100 /* CopyData */:
- return this.parseCopyData(offset, length, bytes);
- default:
- assert_1.default.fail(`unknown message code: ${code.toString(16)}`);
- }
- }
- parseReadyForQueryMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const status = this.reader.string(1);
- return new messages_1.ReadyForQueryMessage(length, status);
- }
- parseCommandCompleteMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const text = this.reader.cstring();
- return new messages_1.CommandCompleteMessage(length, text);
- }
- parseCopyData(offset, length, bytes) {
- const chunk = bytes.slice(offset, offset + (length - 4));
- return new messages_1.CopyDataMessage(length, chunk);
- }
- parseCopyInMessage(offset, length, bytes) {
- return this.parseCopyMessage(offset, length, bytes, "copyInResponse" /* copyInResponse */);
- }
- parseCopyOutMessage(offset, length, bytes) {
- return this.parseCopyMessage(offset, length, bytes, "copyOutResponse" /* copyOutResponse */);
- }
- parseCopyMessage(offset, length, bytes, messageName) {
- this.reader.setBuffer(offset, bytes);
- const isBinary = this.reader.byte() !== 0;
- const columnCount = this.reader.int16();
- const message = new messages_1.CopyResponse(length, messageName, isBinary, columnCount);
- for (let i = 0; i < columnCount; i++) {
- message.columnTypes[i] = this.reader.int16();
- }
- return message;
- }
- parseNotificationMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const processId = this.reader.int32();
- const channel = this.reader.cstring();
- const payload = this.reader.cstring();
- return new messages_1.NotificationResponseMessage(length, processId, channel, payload);
- }
- parseRowDescriptionMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const fieldCount = this.reader.int16();
- const message = new messages_1.RowDescriptionMessage(length, fieldCount);
- for (let i = 0; i < fieldCount; i++) {
- message.fields[i] = this.parseField();
- }
- return message;
- }
- parseField() {
- const name = this.reader.cstring();
- const tableID = this.reader.int32();
- const columnID = this.reader.int16();
- const dataTypeID = this.reader.int32();
- const dataTypeSize = this.reader.int16();
- const dataTypeModifier = this.reader.int32();
- const mode = this.reader.int16() === 0 ? 'text' : 'binary';
- return new messages_1.Field(name, tableID, columnID, dataTypeID, dataTypeSize, dataTypeModifier, mode);
- }
- parseDataRowMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const fieldCount = this.reader.int16();
- const fields = new Array(fieldCount);
- for (let i = 0; i < fieldCount; i++) {
- const len = this.reader.int32();
- // a -1 for length means the value of the field is null
- fields[i] = len === -1 ? null : this.reader.string(len);
- }
- return new messages_1.DataRowMessage(length, fields);
- }
- parseParameterStatusMessage(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const name = this.reader.cstring();
- const value = this.reader.cstring();
- return new messages_1.ParameterStatusMessage(length, name, value);
- }
- parseBackendKeyData(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const processID = this.reader.int32();
- const secretKey = this.reader.int32();
- return new messages_1.BackendKeyDataMessage(length, processID, secretKey);
- }
- parseAuthenticationResponse(offset, length, bytes) {
- this.reader.setBuffer(offset, bytes);
- const code = this.reader.int32();
- // TODO(bmc): maybe better types here
- const message = {
- name: "authenticationOk" /* authenticationOk */,
- length,
- };
- switch (code) {
- case 0: // AuthenticationOk
- break;
- case 3: // AuthenticationCleartextPassword
- if (message.length === 8) {
- message.name = "authenticationCleartextPassword" /* authenticationCleartextPassword */;
- }
- break;
- case 5: // AuthenticationMD5Password
- if (message.length === 12) {
- message.name = "authenticationMD5Password" /* authenticationMD5Password */;
- const salt = this.reader.bytes(4);
- return new messages_1.AuthenticationMD5Password(length, salt);
- }
- break;
- case 10: // AuthenticationSASL
- message.name = "authenticationSASL" /* authenticationSASL */;
- message.mechanisms = [];
- let mechanism;
- do {
- mechanism = this.reader.cstring();
- if (mechanism) {
- message.mechanisms.push(mechanism);
- }
- } while (mechanism);
- break;
- case 11: // AuthenticationSASLContinue
- message.name = "authenticationSASLContinue" /* authenticationSASLContinue */;
- message.data = this.reader.string(length - 8);
- break;
- case 12: // AuthenticationSASLFinal
- message.name = "authenticationSASLFinal" /* authenticationSASLFinal */;
- message.data = this.reader.string(length - 8);
- break;
- default:
- throw new Error('Unknown authenticationOk message type ' + code);
- }
- return message;
- }
- parseErrorMessage(offset, length, bytes, name) {
- this.reader.setBuffer(offset, bytes);
- const fields = {};
- let fieldType = this.reader.string(1);
- while (fieldType !== '\0') {
- fields[fieldType] = this.reader.cstring();
- fieldType = this.reader.string(1);
- }
- const messageValue = fields.M;
- const message = name === "notice" /* notice */
- ? new messages_1.NoticeMessage(length, messageValue)
- : new messages_1.DatabaseError(messageValue, length, name);
- message.severity = fields.S;
- message.code = fields.C;
- message.detail = fields.D;
- message.hint = fields.H;
- message.position = fields.P;
- message.internalPosition = fields.p;
- message.internalQuery = fields.q;
- message.where = fields.W;
- message.schema = fields.s;
- message.table = fields.t;
- message.column = fields.c;
- message.dataType = fields.d;
- message.constraint = fields.n;
- message.file = fields.F;
- message.line = fields.L;
- message.routine = fields.R;
- return message;
- }
-}
-exports.Parser = Parser;
-//# sourceMappingURL=parser.js.map
-
-/***/ }),
-
-/***/ 42439:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", ({ value: true }));
-const buffer_writer_1 = __nccwpck_require__(19228);
-const writer = new buffer_writer_1.Writer();
-const startup = (opts) => {
- // protocol version
- writer.addInt16(3).addInt16(0);
- for (const key of Object.keys(opts)) {
- writer.addCString(key).addCString(opts[key]);
- }
- writer.addCString('client_encoding').addCString('UTF8');
- var bodyBuffer = writer.addCString('').flush();
- // this message is sent without a code
- var length = bodyBuffer.length + 4;
- return new buffer_writer_1.Writer().addInt32(length).add(bodyBuffer).flush();
-};
-const requestSsl = () => {
- const response = Buffer.allocUnsafe(8);
- response.writeInt32BE(8, 0);
- response.writeInt32BE(80877103, 4);
- return response;
-};
-const password = (password) => {
- return writer.addCString(password).flush(112 /* startup */);
-};
-const sendSASLInitialResponseMessage = function (mechanism, initialResponse) {
- // 0x70 = 'p'
- writer.addCString(mechanism).addInt32(Buffer.byteLength(initialResponse)).addString(initialResponse);
- return writer.flush(112 /* startup */);
-};
-const sendSCRAMClientFinalMessage = function (additionalData) {
- return writer.addString(additionalData).flush(112 /* startup */);
-};
-const query = (text) => {
- return writer.addCString(text).flush(81 /* query */);
-};
-const emptyArray = [];
-const parse = (query) => {
- // expect something like this:
- // { name: 'queryName',
- // text: 'select * from blah',
- // types: ['int8', 'bool'] }
- // normalize missing query names to allow for null
- const name = query.name || '';
- if (name.length > 63) {
- /* eslint-disable no-console */
- console.error('Warning! Postgres only supports 63 characters for query names.');
- console.error('You supplied %s (%s)', name, name.length);
- console.error('This can cause conflicts and silent errors executing queries');
- /* eslint-enable no-console */
- }
- const types = query.types || emptyArray;
- var len = types.length;
- var buffer = writer
- .addCString(name) // name of query
- .addCString(query.text) // actual query text
- .addInt16(len);
- for (var i = 0; i < len; i++) {
- buffer.addInt32(types[i]);
- }
- return writer.flush(80 /* parse */);
-};
-const paramWriter = new buffer_writer_1.Writer();
-const writeValues = function (values, valueMapper) {
- for (let i = 0; i < values.length; i++) {
- const mappedVal = valueMapper ? valueMapper(values[i], i) : values[i];
- if (mappedVal == null) {
- // add the param type (string) to the writer
- writer.addInt16(0 /* STRING */);
- // write -1 to the param writer to indicate null
- paramWriter.addInt32(-1);
- }
- else if (mappedVal instanceof Buffer) {
- // add the param type (binary) to the writer
- writer.addInt16(1 /* BINARY */);
- // add the buffer to the param writer
- paramWriter.addInt32(mappedVal.length);
- paramWriter.add(mappedVal);
- }
- else {
- // add the param type (string) to the writer
- writer.addInt16(0 /* STRING */);
- paramWriter.addInt32(Buffer.byteLength(mappedVal));
- paramWriter.addString(mappedVal);
- }
- }
-};
-const bind = (config = {}) => {
- // normalize config
- const portal = config.portal || '';
- const statement = config.statement || '';
- const binary = config.binary || false;
- const values = config.values || emptyArray;
- const len = values.length;
- writer.addCString(portal).addCString(statement);
- writer.addInt16(len);
- writeValues(values, config.valueMapper);
- writer.addInt16(len);
- writer.add(paramWriter.flush());
- // format code
- writer.addInt16(binary ? 1 /* BINARY */ : 0 /* STRING */);
- return writer.flush(66 /* bind */);
-};
-const emptyExecute = Buffer.from([69 /* execute */, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00]);
-const execute = (config) => {
- // this is the happy path for most queries
- if (!config || (!config.portal && !config.rows)) {
- return emptyExecute;
- }
- const portal = config.portal || '';
- const rows = config.rows || 0;
- const portalLength = Buffer.byteLength(portal);
- const len = 4 + portalLength + 1 + 4;
- // one extra bit for code
- const buff = Buffer.allocUnsafe(1 + len);
- buff[0] = 69 /* execute */;
- buff.writeInt32BE(len, 1);
- buff.write(portal, 5, 'utf-8');
- buff[portalLength + 5] = 0; // null terminate portal cString
- buff.writeUInt32BE(rows, buff.length - 4);
- return buff;
-};
-const cancel = (processID, secretKey) => {
- const buffer = Buffer.allocUnsafe(16);
- buffer.writeInt32BE(16, 0);
- buffer.writeInt16BE(1234, 4);
- buffer.writeInt16BE(5678, 6);
- buffer.writeInt32BE(processID, 8);
- buffer.writeInt32BE(secretKey, 12);
- return buffer;
-};
-const cstringMessage = (code, string) => {
- const stringLen = Buffer.byteLength(string);
- const len = 4 + stringLen + 1;
- // one extra bit for code
- const buffer = Buffer.allocUnsafe(1 + len);
- buffer[0] = code;
- buffer.writeInt32BE(len, 1);
- buffer.write(string, 5, 'utf-8');
- buffer[len] = 0; // null terminate cString
- return buffer;
-};
-const emptyDescribePortal = writer.addCString('P').flush(68 /* describe */);
-const emptyDescribeStatement = writer.addCString('S').flush(68 /* describe */);
-const describe = (msg) => {
- return msg.name
- ? cstringMessage(68 /* describe */, `${msg.type}${msg.name || ''}`)
- : msg.type === 'P'
- ? emptyDescribePortal
- : emptyDescribeStatement;
-};
-const close = (msg) => {
- const text = `${msg.type}${msg.name || ''}`;
- return cstringMessage(67 /* close */, text);
-};
-const copyData = (chunk) => {
- return writer.add(chunk).flush(100 /* copyFromChunk */);
-};
-const copyFail = (message) => {
- return cstringMessage(102 /* copyFail */, message);
-};
-const codeOnlyBuffer = (code) => Buffer.from([code, 0x00, 0x00, 0x00, 0x04]);
-const flushBuffer = codeOnlyBuffer(72 /* flush */);
-const syncBuffer = codeOnlyBuffer(83 /* sync */);
-const endBuffer = codeOnlyBuffer(88 /* end */);
-const copyDoneBuffer = codeOnlyBuffer(99 /* copyDone */);
-const serialize = {
- startup,
- password,
- requestSsl,
- sendSASLInitialResponseMessage,
- sendSCRAMClientFinalMessage,
- query,
- parse,
- bind,
- execute,
- describe,
- close,
- flush: () => flushBuffer,
- sync: () => syncBuffer,
- end: () => endBuffer,
- copyData,
- copyDone: () => copyDoneBuffer,
- copyFail,
- cancel,
-};
-exports.serialize = serialize;
-//# sourceMappingURL=serializer.js.map
-
-/***/ }),
-
-/***/ 77929:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-var textParsers = __nccwpck_require__(50977);
-var binaryParsers = __nccwpck_require__(99849);
-var arrayParser = __nccwpck_require__(83614);
-var builtinTypes = __nccwpck_require__(45967);
-
-exports.getTypeParser = getTypeParser;
-exports.setTypeParser = setTypeParser;
-exports.arrayParser = arrayParser;
-exports.builtins = builtinTypes;
-
-var typeParsers = {
- text: {},
- binary: {}
-};
-
-//the empty parse function
-function noParse (val) {
- return String(val);
-};
-
-//returns a function used to convert a specific type (specified by
-//oid) into a result javascript type
-//note: the oid can be obtained via the following sql query:
-//SELECT oid FROM pg_type WHERE typname = 'TYPE_NAME_HERE';
-function getTypeParser (oid, format) {
- format = format || 'text';
- if (!typeParsers[format]) {
- return noParse;
- }
- return typeParsers[format][oid] || noParse;
-};
-
-function setTypeParser (oid, format, parseFn) {
- if(typeof format == 'function') {
- parseFn = format;
- format = 'text';
- }
- typeParsers[format][oid] = parseFn;
-};
-
-textParsers.init(function(oid, converter) {
- typeParsers.text[oid] = converter;
-});
-
-binaryParsers.init(function(oid, converter) {
- typeParsers.binary[oid] = converter;
-});
-
-
-/***/ }),
-
-/***/ 83614:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var array = __nccwpck_require__(34702);
-
-module.exports = {
- create: function (source, transform) {
- return {
- parse: function() {
- return array.parse(source, transform);
- }
- };
- }
-};
-
-
-/***/ }),
-
-/***/ 99849:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var parseInt64 = __nccwpck_require__(41180);
-
-var parseBits = function(data, bits, offset, invert, callback) {
- offset = offset || 0;
- invert = invert || false;
- callback = callback || function(lastValue, newValue, bits) { return (lastValue * Math.pow(2, bits)) + newValue; };
- var offsetBytes = offset >> 3;
-
- var inv = function(value) {
- if (invert) {
- return ~value & 0xff;
- }
-
- return value;
- };
-
- // read first (maybe partial) byte
- var mask = 0xff;
- var firstBits = 8 - (offset % 8);
- if (bits < firstBits) {
- mask = (0xff << (8 - bits)) & 0xff;
- firstBits = bits;
- }
-
- if (offset) {
- mask = mask >> (offset % 8);
- }
-
- var result = 0;
- if ((offset % 8) + bits >= 8) {
- result = callback(0, inv(data[offsetBytes]) & mask, firstBits);
- }
-
- // read bytes
- var bytes = (bits + offset) >> 3;
- for (var i = offsetBytes + 1; i < bytes; i++) {
- result = callback(result, inv(data[i]), 8);
- }
-
- // bits to read, that are not a complete byte
- var lastBits = (bits + offset) % 8;
- if (lastBits > 0) {
- result = callback(result, inv(data[bytes]) >> (8 - lastBits), lastBits);
- }
-
- return result;
-};
-
-var parseFloatFromBits = function(data, precisionBits, exponentBits) {
- var bias = Math.pow(2, exponentBits - 1) - 1;
- var sign = parseBits(data, 1);
- var exponent = parseBits(data, exponentBits, 1);
-
- if (exponent === 0) {
- return 0;
- }
-
- // parse mantissa
- var precisionBitsCounter = 1;
- var parsePrecisionBits = function(lastValue, newValue, bits) {
- if (lastValue === 0) {
- lastValue = 1;
- }
-
- for (var i = 1; i <= bits; i++) {
- precisionBitsCounter /= 2;
- if ((newValue & (0x1 << (bits - i))) > 0) {
- lastValue += precisionBitsCounter;
- }
- }
-
- return lastValue;
- };
-
- var mantissa = parseBits(data, precisionBits, exponentBits + 1, false, parsePrecisionBits);
-
- // special cases
- if (exponent == (Math.pow(2, exponentBits + 1) - 1)) {
- if (mantissa === 0) {
- return (sign === 0) ? Infinity : -Infinity;
- }
-
- return NaN;
- }
-
- // normale number
- return ((sign === 0) ? 1 : -1) * Math.pow(2, exponent - bias) * mantissa;
-};
-
-var parseInt16 = function(value) {
- if (parseBits(value, 1) == 1) {
- return -1 * (parseBits(value, 15, 1, true) + 1);
- }
-
- return parseBits(value, 15, 1);
-};
-
-var parseInt32 = function(value) {
- if (parseBits(value, 1) == 1) {
- return -1 * (parseBits(value, 31, 1, true) + 1);
- }
-
- return parseBits(value, 31, 1);
-};
-
-var parseFloat32 = function(value) {
- return parseFloatFromBits(value, 23, 8);
-};
-
-var parseFloat64 = function(value) {
- return parseFloatFromBits(value, 52, 11);
-};
-
-var parseNumeric = function(value) {
- var sign = parseBits(value, 16, 32);
- if (sign == 0xc000) {
- return NaN;
- }
-
- var weight = Math.pow(10000, parseBits(value, 16, 16));
- var result = 0;
-
- var digits = [];
- var ndigits = parseBits(value, 16);
- for (var i = 0; i < ndigits; i++) {
- result += parseBits(value, 16, 64 + (16 * i)) * weight;
- weight /= 10000;
- }
-
- var scale = Math.pow(10, parseBits(value, 16, 48));
- return ((sign === 0) ? 1 : -1) * Math.round(result * scale) / scale;
-};
-
-var parseDate = function(isUTC, value) {
- var sign = parseBits(value, 1);
- var rawValue = parseBits(value, 63, 1);
-
- // discard usecs and shift from 2000 to 1970
- var result = new Date((((sign === 0) ? 1 : -1) * rawValue / 1000) + 946684800000);
-
- if (!isUTC) {
- result.setTime(result.getTime() + result.getTimezoneOffset() * 60000);
- }
-
- // add microseconds to the date
- result.usec = rawValue % 1000;
- result.getMicroSeconds = function() {
- return this.usec;
- };
- result.setMicroSeconds = function(value) {
- this.usec = value;
- };
- result.getUTCMicroSeconds = function() {
- return this.usec;
- };
-
- return result;
-};
-
-var parseArray = function(value) {
- var dim = parseBits(value, 32);
-
- var flags = parseBits(value, 32, 32);
- var elementType = parseBits(value, 32, 64);
-
- var offset = 96;
- var dims = [];
- for (var i = 0; i < dim; i++) {
- // parse dimension
- dims[i] = parseBits(value, 32, offset);
- offset += 32;
-
- // ignore lower bounds
- offset += 32;
- }
-
- var parseElement = function(elementType) {
- // parse content length
- var length = parseBits(value, 32, offset);
- offset += 32;
-
- // parse null values
- if (length == 0xffffffff) {
- return null;
- }
-
- var result;
- if ((elementType == 0x17) || (elementType == 0x14)) {
- // int/bigint
- result = parseBits(value, length * 8, offset);
- offset += length * 8;
- return result;
- }
- else if (elementType == 0x19) {
- // string
- result = value.toString(this.encoding, offset >> 3, (offset += (length << 3)) >> 3);
- return result;
- }
- else {
- console.log("ERROR: ElementType not implemented: " + elementType);
- }
- };
-
- var parse = function(dimension, elementType) {
- var array = [];
- var i;
-
- if (dimension.length > 1) {
- var count = dimension.shift();
- for (i = 0; i < count; i++) {
- array[i] = parse(dimension, elementType);
- }
- dimension.unshift(count);
- }
- else {
- for (i = 0; i < dimension[0]; i++) {
- array[i] = parseElement(elementType);
- }
- }
-
- return array;
- };
-
- return parse(dims, elementType);
-};
-
-var parseText = function(value) {
- return value.toString('utf8');
-};
-
-var parseBool = function(value) {
- if(value === null) return null;
- return (parseBits(value, 8) > 0);
-};
-
-var init = function(register) {
- register(20, parseInt64);
- register(21, parseInt16);
- register(23, parseInt32);
- register(26, parseInt32);
- register(1700, parseNumeric);
- register(700, parseFloat32);
- register(701, parseFloat64);
- register(16, parseBool);
- register(1114, parseDate.bind(null, false));
- register(1184, parseDate.bind(null, true));
- register(1000, parseArray);
- register(1007, parseArray);
- register(1016, parseArray);
- register(1008, parseArray);
- register(1009, parseArray);
- register(25, parseText);
-};
-
-module.exports = {
- init: init
-};
-
-
-/***/ }),
-
-/***/ 45967:
-/***/ ((module) => {
-
-/**
- * Following query was used to generate this file:
-
- SELECT json_object_agg(UPPER(PT.typname), PT.oid::int4 ORDER BY pt.oid)
- FROM pg_type PT
- WHERE typnamespace = (SELECT pgn.oid FROM pg_namespace pgn WHERE nspname = 'pg_catalog') -- Take only builting Postgres types with stable OID (extension types are not guaranted to be stable)
- AND typtype = 'b' -- Only basic types
- AND typelem = 0 -- Ignore aliases
- AND typisdefined -- Ignore undefined types
- */
-
-module.exports = {
- BOOL: 16,
- BYTEA: 17,
- CHAR: 18,
- INT8: 20,
- INT2: 21,
- INT4: 23,
- REGPROC: 24,
- TEXT: 25,
- OID: 26,
- TID: 27,
- XID: 28,
- CID: 29,
- JSON: 114,
- XML: 142,
- PG_NODE_TREE: 194,
- SMGR: 210,
- PATH: 602,
- POLYGON: 604,
- CIDR: 650,
- FLOAT4: 700,
- FLOAT8: 701,
- ABSTIME: 702,
- RELTIME: 703,
- TINTERVAL: 704,
- CIRCLE: 718,
- MACADDR8: 774,
- MONEY: 790,
- MACADDR: 829,
- INET: 869,
- ACLITEM: 1033,
- BPCHAR: 1042,
- VARCHAR: 1043,
- DATE: 1082,
- TIME: 1083,
- TIMESTAMP: 1114,
- TIMESTAMPTZ: 1184,
- INTERVAL: 1186,
- TIMETZ: 1266,
- BIT: 1560,
- VARBIT: 1562,
- NUMERIC: 1700,
- REFCURSOR: 1790,
- REGPROCEDURE: 2202,
- REGOPER: 2203,
- REGOPERATOR: 2204,
- REGCLASS: 2205,
- REGTYPE: 2206,
- UUID: 2950,
- TXID_SNAPSHOT: 2970,
- PG_LSN: 3220,
- PG_NDISTINCT: 3361,
- PG_DEPENDENCIES: 3402,
- TSVECTOR: 3614,
- TSQUERY: 3615,
- GTSVECTOR: 3642,
- REGCONFIG: 3734,
- REGDICTIONARY: 3769,
- JSONB: 3802,
- REGNAMESPACE: 4089,
- REGROLE: 4096
-};
-
-
-/***/ }),
-
-/***/ 50977:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-var array = __nccwpck_require__(34702)
-var arrayParser = __nccwpck_require__(83614);
-var parseDate = __nccwpck_require__(13264);
-var parseInterval = __nccwpck_require__(19991);
-var parseByteA = __nccwpck_require__(79377);
-
-function allowNull (fn) {
- return function nullAllowed (value) {
- if (value === null) return value
- return fn(value)
- }
-}
-
-function parseBool (value) {
- if (value === null) return value
- return value === 'TRUE' ||
- value === 't' ||
- value === 'true' ||
- value === 'y' ||
- value === 'yes' ||
- value === 'on' ||
- value === '1';
-}
-
-function parseBoolArray (value) {
- if (!value) return null
- return array.parse(value, parseBool)
-}
-
-function parseBaseTenInt (string) {
- return parseInt(string, 10)
-}
-
-function parseIntegerArray (value) {
- if (!value) return null
- return array.parse(value, allowNull(parseBaseTenInt))
-}
-
-function parseBigIntegerArray (value) {
- if (!value) return null
- return array.parse(value, allowNull(function (entry) {
- return parseBigInteger(entry).trim()
- }))
-}
-
-var parsePointArray = function(value) {
- if(!value) { return null; }
- var p = arrayParser.create(value, function(entry) {
- if(entry !== null) {
- entry = parsePoint(entry);
- }
- return entry;
- });
-
- return p.parse();
-};
-
-var parseFloatArray = function(value) {
- if(!value) { return null; }
- var p = arrayParser.create(value, function(entry) {
- if(entry !== null) {
- entry = parseFloat(entry);
- }
- return entry;
- });
-
- return p.parse();
-};
-
-var parseStringArray = function(value) {
- if(!value) { return null; }
-
- var p = arrayParser.create(value);
- return p.parse();
-};
-
-var parseDateArray = function(value) {
- if (!value) { return null; }
-
- var p = arrayParser.create(value, function(entry) {
- if (entry !== null) {
- entry = parseDate(entry);
- }
- return entry;
- });
-
- return p.parse();
-};
-
-var parseIntervalArray = function(value) {
- if (!value) { return null; }
-
- var p = arrayParser.create(value, function(entry) {
- if (entry !== null) {
- entry = parseInterval(entry);
- }
- return entry;
- });
-
- return p.parse();
-};
-
-var parseByteAArray = function(value) {
- if (!value) { return null; }
-
- return array.parse(value, allowNull(parseByteA));
-};
-
-var parseInteger = function(value) {
- return parseInt(value, 10);
-};
-
-var parseBigInteger = function(value) {
- var valStr = String(value);
- if (/^\d+$/.test(valStr)) { return valStr; }
- return value;
-};
-
-var parseJsonArray = function(value) {
- if (!value) { return null; }
-
- return array.parse(value, allowNull(JSON.parse));
-};
-
-var parsePoint = function(value) {
- if (value[0] !== '(') { return null; }
-
- value = value.substring( 1, value.length - 1 ).split(',');
-
- return {
- x: parseFloat(value[0])
- , y: parseFloat(value[1])
- };
-};
-
-var parseCircle = function(value) {
- if (value[0] !== '<' && value[1] !== '(') { return null; }
-
- var point = '(';
- var radius = '';
- var pointParsed = false;
- for (var i = 2; i < value.length - 1; i++){
- if (!pointParsed) {
- point += value[i];
- }
-
- if (value[i] === ')') {
- pointParsed = true;
- continue;
- } else if (!pointParsed) {
- continue;
- }
-
- if (value[i] === ','){
- continue;
- }
-
- radius += value[i];
- }
- var result = parsePoint(point);
- result.radius = parseFloat(radius);
-
- return result;
-};
-
-var init = function(register) {
- register(20, parseBigInteger); // int8
- register(21, parseInteger); // int2
- register(23, parseInteger); // int4
- register(26, parseInteger); // oid
- register(700, parseFloat); // float4/real
- register(701, parseFloat); // float8/double
- register(16, parseBool);
- register(1082, parseDate); // date
- register(1114, parseDate); // timestamp without timezone
- register(1184, parseDate); // timestamp
- register(600, parsePoint); // point
- register(651, parseStringArray); // cidr[]
- register(718, parseCircle); // circle
- register(1000, parseBoolArray);
- register(1001, parseByteAArray);
- register(1005, parseIntegerArray); // _int2
- register(1007, parseIntegerArray); // _int4
- register(1028, parseIntegerArray); // oid[]
- register(1016, parseBigIntegerArray); // _int8
- register(1017, parsePointArray); // point[]
- register(1021, parseFloatArray); // _float4
- register(1022, parseFloatArray); // _float8
- register(1231, parseFloatArray); // _numeric
- register(1014, parseStringArray); //char
- register(1015, parseStringArray); //varchar
- register(1008, parseStringArray);
- register(1009, parseStringArray);
- register(1040, parseStringArray); // macaddr[]
- register(1041, parseStringArray); // inet[]
- register(1115, parseDateArray); // timestamp without time zone[]
- register(1182, parseDateArray); // _date
- register(1185, parseDateArray); // timestamp with time zone[]
- register(1186, parseInterval);
- register(1187, parseIntervalArray);
- register(17, parseByteA);
- register(114, JSON.parse.bind(JSON)); // json
- register(3802, JSON.parse.bind(JSON)); // jsonb
- register(199, parseJsonArray); // json[]
- register(3807, parseJsonArray); // jsonb[]
- register(3907, parseStringArray); // numrange[]
- register(2951, parseStringArray); // uuid[]
- register(791, parseStringArray); // money[]
- register(1183, parseStringArray); // time[]
- register(1270, parseStringArray); // timetz[]
-};
-
-module.exports = {
- init: init
-};
-
-
-/***/ }),
-
-/***/ 37143:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var EventEmitter = __nccwpck_require__(28614).EventEmitter
-var util = __nccwpck_require__(31669)
-var utils = __nccwpck_require__(36419)
-var sasl = __nccwpck_require__(19481)
-var pgPass = __nccwpck_require__(19713)
-var TypeOverrides = __nccwpck_require__(78873)
-
-var ConnectionParameters = __nccwpck_require__(19112)
-var Query = __nccwpck_require__(31283)
-var defaults = __nccwpck_require__(26419)
-var Connection = __nccwpck_require__(62848)
-
-class Client extends EventEmitter {
- constructor(config) {
- super()
-
- this.connectionParameters = new ConnectionParameters(config)
- this.user = this.connectionParameters.user
- this.database = this.connectionParameters.database
- this.port = this.connectionParameters.port
- this.host = this.connectionParameters.host
-
- // "hiding" the password so it doesn't show up in stack traces
- // or if the client is console.logged
- Object.defineProperty(this, 'password', {
- configurable: true,
- enumerable: false,
- writable: true,
- value: this.connectionParameters.password,
- })
-
- this.replication = this.connectionParameters.replication
-
- var c = config || {}
-
- this._Promise = c.Promise || global.Promise
- this._types = new TypeOverrides(c.types)
- this._ending = false
- this._connecting = false
- this._connected = false
- this._connectionError = false
- this._queryable = true
-
- this.connection =
- c.connection ||
- new Connection({
- stream: c.stream,
- ssl: this.connectionParameters.ssl,
- keepAlive: c.keepAlive || false,
- keepAliveInitialDelayMillis: c.keepAliveInitialDelayMillis || 0,
- encoding: this.connectionParameters.client_encoding || 'utf8',
- })
- this.queryQueue = []
- this.binary = c.binary || defaults.binary
- this.processID = null
- this.secretKey = null
- this.ssl = this.connectionParameters.ssl || false
- // As with Password, make SSL->Key (the private key) non-enumerable.
- // It won't show up in stack traces
- // or if the client is console.logged
- if (this.ssl && this.ssl.key) {
- Object.defineProperty(this.ssl, 'key', {
- enumerable: false,
- })
- }
-
- this._connectionTimeoutMillis = c.connectionTimeoutMillis || 0
- }
-
- _errorAllQueries(err) {
- const enqueueError = (query) => {
- process.nextTick(() => {
- query.handleError(err, this.connection)
- })
- }
-
- if (this.activeQuery) {
- enqueueError(this.activeQuery)
- this.activeQuery = null
- }
-
- this.queryQueue.forEach(enqueueError)
- this.queryQueue.length = 0
- }
-
- _connect(callback) {
- var self = this
- var con = this.connection
- this._connectionCallback = callback
-
- if (this._connecting || this._connected) {
- const err = new Error('Client has already been connected. You cannot reuse a client.')
- process.nextTick(() => {
- callback(err)
- })
- return
- }
- this._connecting = true
-
- this.connectionTimeoutHandle
- if (this._connectionTimeoutMillis > 0) {
- this.connectionTimeoutHandle = setTimeout(() => {
- con._ending = true
- con.stream.destroy(new Error('timeout expired'))
- }, this._connectionTimeoutMillis)
- }
-
- if (this.host && this.host.indexOf('/') === 0) {
- con.connect(this.host + '/.s.PGSQL.' + this.port)
- } else {
- con.connect(this.port, this.host)
- }
-
- // once connection is established send startup message
- con.on('connect', function () {
- if (self.ssl) {
- con.requestSsl()
- } else {
- con.startup(self.getStartupConf())
- }
- })
-
- con.on('sslconnect', function () {
- con.startup(self.getStartupConf())
- })
-
- this._attachListeners(con)
-
- con.once('end', () => {
- const error = this._ending ? new Error('Connection terminated') : new Error('Connection terminated unexpectedly')
-
- clearTimeout(this.connectionTimeoutHandle)
- this._errorAllQueries(error)
-
- if (!this._ending) {
- // if the connection is ended without us calling .end()
- // on this client then we have an unexpected disconnection
- // treat this as an error unless we've already emitted an error
- // during connection.
- if (this._connecting && !this._connectionError) {
- if (this._connectionCallback) {
- this._connectionCallback(error)
- } else {
- this._handleErrorEvent(error)
- }
- } else if (!this._connectionError) {
- this._handleErrorEvent(error)
- }
- }
-
- process.nextTick(() => {
- this.emit('end')
- })
- })
- }
-
- connect(callback) {
- if (callback) {
- this._connect(callback)
- return
- }
-
- return new this._Promise((resolve, reject) => {
- this._connect((error) => {
- if (error) {
- reject(error)
- } else {
- resolve()
- }
- })
- })
- }
-
- _attachListeners(con) {
- // password request handling
- con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this))
- // password request handling
- con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this))
- // password request handling (SASL)
- con.on('authenticationSASL', this._handleAuthSASL.bind(this))
- con.on('authenticationSASLContinue', this._handleAuthSASLContinue.bind(this))
- con.on('authenticationSASLFinal', this._handleAuthSASLFinal.bind(this))
- con.on('backendKeyData', this._handleBackendKeyData.bind(this))
- con.on('error', this._handleErrorEvent.bind(this))
- con.on('errorMessage', this._handleErrorMessage.bind(this))
- con.on('readyForQuery', this._handleReadyForQuery.bind(this))
- con.on('notice', this._handleNotice.bind(this))
- con.on('rowDescription', this._handleRowDescription.bind(this))
- con.on('dataRow', this._handleDataRow.bind(this))
- con.on('portalSuspended', this._handlePortalSuspended.bind(this))
- con.on('emptyQuery', this._handleEmptyQuery.bind(this))
- con.on('commandComplete', this._handleCommandComplete.bind(this))
- con.on('parseComplete', this._handleParseComplete.bind(this))
- con.on('copyInResponse', this._handleCopyInResponse.bind(this))
- con.on('copyData', this._handleCopyData.bind(this))
- con.on('notification', this._handleNotification.bind(this))
- }
-
- // TODO(bmc): deprecate pgpass "built in" integration since this.password can be a function
- // it can be supplied by the user if required - this is a breaking change!
- _checkPgPass(cb) {
- const con = this.connection
- if (typeof this.password === 'function') {
- this._Promise
- .resolve()
- .then(() => this.password())
- .then((pass) => {
- if (pass !== undefined) {
- if (typeof pass !== 'string') {
- con.emit('error', new TypeError('Password must be a string'))
- return
- }
- this.connectionParameters.password = this.password = pass
- } else {
- this.connectionParameters.password = this.password = null
- }
- cb()
- })
- .catch((err) => {
- con.emit('error', err)
- })
- } else if (this.password !== null) {
- cb()
- } else {
- pgPass(this.connectionParameters, (pass) => {
- if (undefined !== pass) {
- this.connectionParameters.password = this.password = pass
- }
- cb()
- })
- }
- }
-
- _handleAuthCleartextPassword(msg) {
- this._checkPgPass(() => {
- this.connection.password(this.password)
- })
- }
-
- _handleAuthMD5Password(msg) {
- this._checkPgPass(() => {
- const hashedPassword = utils.postgresMd5PasswordHash(this.user, this.password, msg.salt)
- this.connection.password(hashedPassword)
- })
- }
-
- _handleAuthSASL(msg) {
- this._checkPgPass(() => {
- this.saslSession = sasl.startSession(msg.mechanisms)
- this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response)
- })
- }
-
- _handleAuthSASLContinue(msg) {
- sasl.continueSession(this.saslSession, this.password, msg.data)
- this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)
- }
-
- _handleAuthSASLFinal(msg) {
- sasl.finalizeSession(this.saslSession, msg.data)
- this.saslSession = null
- }
-
- _handleBackendKeyData(msg) {
- this.processID = msg.processID
- this.secretKey = msg.secretKey
- }
-
- _handleReadyForQuery(msg) {
- if (this._connecting) {
- this._connecting = false
- this._connected = true
- clearTimeout(this.connectionTimeoutHandle)
-
- // process possible callback argument to Client#connect
- if (this._connectionCallback) {
- this._connectionCallback(null, this)
- // remove callback for proper error handling
- // after the connect event
- this._connectionCallback = null
- }
- this.emit('connect')
- }
- const { activeQuery } = this
- this.activeQuery = null
- this.readyForQuery = true
- if (activeQuery) {
- activeQuery.handleReadyForQuery(this.connection)
- }
- this._pulseQueryQueue()
- }
-
- // if we receieve an error event or error message
- // during the connection process we handle it here
- _handleErrorWhileConnecting(err) {
- if (this._connectionError) {
- // TODO(bmc): this is swallowing errors - we shouldn't do this
- return
- }
- this._connectionError = true
- clearTimeout(this.connectionTimeoutHandle)
- if (this._connectionCallback) {
- return this._connectionCallback(err)
- }
- this.emit('error', err)
- }
-
- // if we're connected and we receive an error event from the connection
- // this means the socket is dead - do a hard abort of all queries and emit
- // the socket error on the client as well
- _handleErrorEvent(err) {
- if (this._connecting) {
- return this._handleErrorWhileConnecting(err)
- }
- this._queryable = false
- this._errorAllQueries(err)
- this.emit('error', err)
- }
-
- // handle error messages from the postgres backend
- _handleErrorMessage(msg) {
- if (this._connecting) {
- return this._handleErrorWhileConnecting(msg)
- }
- const activeQuery = this.activeQuery
-
- if (!activeQuery) {
- this._handleErrorEvent(msg)
- return
- }
-
- this.activeQuery = null
- activeQuery.handleError(msg, this.connection)
- }
-
- _handleRowDescription(msg) {
- // delegate rowDescription to active query
- this.activeQuery.handleRowDescription(msg)
- }
-
- _handleDataRow(msg) {
- // delegate dataRow to active query
- this.activeQuery.handleDataRow(msg)
- }
-
- _handlePortalSuspended(msg) {
- // delegate portalSuspended to active query
- this.activeQuery.handlePortalSuspended(this.connection)
- }
-
- _handleEmptyQuery(msg) {
- // delegate emptyQuery to active query
- this.activeQuery.handleEmptyQuery(this.connection)
- }
-
- _handleCommandComplete(msg) {
- // delegate commandComplete to active query
- this.activeQuery.handleCommandComplete(msg, this.connection)
- }
-
- _handleParseComplete(msg) {
- // if a prepared statement has a name and properly parses
- // we track that its already been executed so we don't parse
- // it again on the same client
- if (this.activeQuery.name) {
- this.connection.parsedStatements[this.activeQuery.name] = this.activeQuery.text
- }
- }
-
- _handleCopyInResponse(msg) {
- this.activeQuery.handleCopyInResponse(this.connection)
- }
-
- _handleCopyData(msg) {
- this.activeQuery.handleCopyData(msg, this.connection)
- }
-
- _handleNotification(msg) {
- this.emit('notification', msg)
- }
-
- _handleNotice(msg) {
- this.emit('notice', msg)
- }
-
- getStartupConf() {
- var params = this.connectionParameters
-
- var data = {
- user: params.user,
- database: params.database,
- }
-
- var appName = params.application_name || params.fallback_application_name
- if (appName) {
- data.application_name = appName
- }
- if (params.replication) {
- data.replication = '' + params.replication
- }
- if (params.statement_timeout) {
- data.statement_timeout = String(parseInt(params.statement_timeout, 10))
- }
- if (params.idle_in_transaction_session_timeout) {
- data.idle_in_transaction_session_timeout = String(parseInt(params.idle_in_transaction_session_timeout, 10))
- }
- if (params.options) {
- data.options = params.options
- }
-
- return data
- }
-
- cancel(client, query) {
- if (client.activeQuery === query) {
- var con = this.connection
-
- if (this.host && this.host.indexOf('/') === 0) {
- con.connect(this.host + '/.s.PGSQL.' + this.port)
- } else {
- con.connect(this.port, this.host)
- }
-
- // once connection is established send cancel message
- con.on('connect', function () {
- con.cancel(client.processID, client.secretKey)
- })
- } else if (client.queryQueue.indexOf(query) !== -1) {
- client.queryQueue.splice(client.queryQueue.indexOf(query), 1)
- }
- }
-
- setTypeParser(oid, format, parseFn) {
- return this._types.setTypeParser(oid, format, parseFn)
- }
-
- getTypeParser(oid, format) {
- return this._types.getTypeParser(oid, format)
- }
-
- // Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
- escapeIdentifier(str) {
- return '"' + str.replace(/"/g, '""') + '"'
- }
-
- // Ported from PostgreSQL 9.2.4 source code in src/interfaces/libpq/fe-exec.c
- escapeLiteral(str) {
- var hasBackslash = false
- var escaped = "'"
-
- for (var i = 0; i < str.length; i++) {
- var c = str[i]
- if (c === "'") {
- escaped += c + c
- } else if (c === '\\') {
- escaped += c + c
- hasBackslash = true
- } else {
- escaped += c
- }
- }
-
- escaped += "'"
-
- if (hasBackslash === true) {
- escaped = ' E' + escaped
- }
-
- return escaped
- }
-
- _pulseQueryQueue() {
- if (this.readyForQuery === true) {
- this.activeQuery = this.queryQueue.shift()
- if (this.activeQuery) {
- this.readyForQuery = false
- this.hasExecuted = true
-
- const queryError = this.activeQuery.submit(this.connection)
- if (queryError) {
- process.nextTick(() => {
- this.activeQuery.handleError(queryError, this.connection)
- this.readyForQuery = true
- this._pulseQueryQueue()
- })
- }
- } else if (this.hasExecuted) {
- this.activeQuery = null
- this.emit('drain')
- }
- }
- }
-
- query(config, values, callback) {
- // can take in strings, config object or query object
- var query
- var result
- var readTimeout
- var readTimeoutTimer
- var queryCallback
-
- if (config === null || config === undefined) {
- throw new TypeError('Client was passed a null or undefined query')
- } else if (typeof config.submit === 'function') {
- readTimeout = config.query_timeout || this.connectionParameters.query_timeout
- result = query = config
- if (typeof values === 'function') {
- query.callback = query.callback || values
- }
- } else {
- readTimeout = this.connectionParameters.query_timeout
- query = new Query(config, values, callback)
- if (!query.callback) {
- result = new this._Promise((resolve, reject) => {
- query.callback = (err, res) => (err ? reject(err) : resolve(res))
- })
- }
- }
-
- if (readTimeout) {
- queryCallback = query.callback
-
- readTimeoutTimer = setTimeout(() => {
- var error = new Error('Query read timeout')
-
- process.nextTick(() => {
- query.handleError(error, this.connection)
- })
-
- queryCallback(error)
-
- // we already returned an error,
- // just do nothing if query completes
- query.callback = () => {}
-
- // Remove from queue
- var index = this.queryQueue.indexOf(query)
- if (index > -1) {
- this.queryQueue.splice(index, 1)
- }
-
- this._pulseQueryQueue()
- }, readTimeout)
-
- query.callback = (err, res) => {
- clearTimeout(readTimeoutTimer)
- queryCallback(err, res)
- }
- }
-
- if (this.binary && !query.binary) {
- query.binary = true
- }
-
- if (query._result && !query._result._types) {
- query._result._types = this._types
- }
-
- if (!this._queryable) {
- process.nextTick(() => {
- query.handleError(new Error('Client has encountered a connection error and is not queryable'), this.connection)
- })
- return result
- }
-
- if (this._ending) {
- process.nextTick(() => {
- query.handleError(new Error('Client was closed and is not queryable'), this.connection)
- })
- return result
- }
-
- this.queryQueue.push(query)
- this._pulseQueryQueue()
- return result
- }
-
- end(cb) {
- this._ending = true
-
- // if we have never connected, then end is a noop, callback immediately
- if (!this.connection._connecting) {
- if (cb) {
- cb()
- } else {
- return this._Promise.resolve()
- }
- }
-
- if (this.activeQuery || !this._queryable) {
- // if we have an active query we need to force a disconnect
- // on the socket - otherwise a hung query could block end forever
- this.connection.stream.destroy()
- } else {
- this.connection.end()
- }
-
- if (cb) {
- this.connection.once('end', cb)
- } else {
- return new this._Promise((resolve) => {
- this.connection.once('end', resolve)
- })
- }
- }
-}
-
-// expose a Query constructor
-Client.Query = Query
-
-module.exports = Client
-
-
-/***/ }),
-
-/***/ 19112:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var dns = __nccwpck_require__(40881)
-
-var defaults = __nccwpck_require__(26419)
-
-var parse = __nccwpck_require__(38961).parse // parses a connection string
-
-var val = function (key, config, envVar) {
- if (envVar === undefined) {
- envVar = process.env['PG' + key.toUpperCase()]
- } else if (envVar === false) {
- // do nothing ... use false
- } else {
- envVar = process.env[envVar]
- }
-
- return config[key] || envVar || defaults[key]
-}
-
-var readSSLConfigFromEnvironment = function () {
- switch (process.env.PGSSLMODE) {
- case 'disable':
- return false
- case 'prefer':
- case 'require':
- case 'verify-ca':
- case 'verify-full':
- return true
- case 'no-verify':
- return { rejectUnauthorized: false }
- }
- return defaults.ssl
-}
-
-// Convert arg to a string, surround in single quotes, and escape single quotes and backslashes
-var quoteParamValue = function (value) {
- return "'" + ('' + value).replace(/\\/g, '\\\\').replace(/'/g, "\\'") + "'"
-}
-
-var add = function (params, config, paramName) {
- var value = config[paramName]
- if (value !== undefined && value !== null) {
- params.push(paramName + '=' + quoteParamValue(value))
- }
-}
-
-class ConnectionParameters {
- constructor(config) {
- // if a string is passed, it is a raw connection string so we parse it into a config
- config = typeof config === 'string' ? parse(config) : config || {}
-
- // if the config has a connectionString defined, parse IT into the config we use
- // this will override other default values with what is stored in connectionString
- if (config.connectionString) {
- config = Object.assign({}, config, parse(config.connectionString))
- }
-
- this.user = val('user', config)
- this.database = val('database', config)
-
- if (this.database === undefined) {
- this.database = this.user
- }
-
- this.port = parseInt(val('port', config), 10)
- this.host = val('host', config)
-
- // "hiding" the password so it doesn't show up in stack traces
- // or if the client is console.logged
- Object.defineProperty(this, 'password', {
- configurable: true,
- enumerable: false,
- writable: true,
- value: val('password', config),
- })
-
- this.binary = val('binary', config)
- this.options = val('options', config)
-
- this.ssl = typeof config.ssl === 'undefined' ? readSSLConfigFromEnvironment() : config.ssl
-
- if (typeof this.ssl === 'string') {
- if (this.ssl === 'true') {
- this.ssl = true
- }
- }
- // support passing in ssl=no-verify via connection string
- if (this.ssl === 'no-verify') {
- this.ssl = { rejectUnauthorized: false }
- }
- if (this.ssl && this.ssl.key) {
- Object.defineProperty(this.ssl, 'key', {
- enumerable: false,
- })
- }
-
- this.client_encoding = val('client_encoding', config)
- this.replication = val('replication', config)
- // a domain socket begins with '/'
- this.isDomainSocket = !(this.host || '').indexOf('/')
-
- this.application_name = val('application_name', config, 'PGAPPNAME')
- this.fallback_application_name = val('fallback_application_name', config, false)
- this.statement_timeout = val('statement_timeout', config, false)
- this.idle_in_transaction_session_timeout = val('idle_in_transaction_session_timeout', config, false)
- this.query_timeout = val('query_timeout', config, false)
-
- if (config.connectionTimeoutMillis === undefined) {
- this.connect_timeout = process.env.PGCONNECT_TIMEOUT || 0
- } else {
- this.connect_timeout = Math.floor(config.connectionTimeoutMillis / 1000)
- }
-
- if (config.keepAlive === false) {
- this.keepalives = 0
- } else if (config.keepAlive === true) {
- this.keepalives = 1
- }
-
- if (typeof config.keepAliveInitialDelayMillis === 'number') {
- this.keepalives_idle = Math.floor(config.keepAliveInitialDelayMillis / 1000)
- }
- }
-
- getLibpqConnectionString(cb) {
- var params = []
- add(params, this, 'user')
- add(params, this, 'password')
- add(params, this, 'port')
- add(params, this, 'application_name')
- add(params, this, 'fallback_application_name')
- add(params, this, 'connect_timeout')
- add(params, this, 'options')
-
- var ssl = typeof this.ssl === 'object' ? this.ssl : this.ssl ? { sslmode: this.ssl } : {}
- add(params, ssl, 'sslmode')
- add(params, ssl, 'sslca')
- add(params, ssl, 'sslkey')
- add(params, ssl, 'sslcert')
- add(params, ssl, 'sslrootcert')
-
- if (this.database) {
- params.push('dbname=' + quoteParamValue(this.database))
- }
- if (this.replication) {
- params.push('replication=' + quoteParamValue(this.replication))
- }
- if (this.host) {
- params.push('host=' + quoteParamValue(this.host))
- }
- if (this.isDomainSocket) {
- return cb(null, params.join(' '))
- }
- if (this.client_encoding) {
- params.push('client_encoding=' + quoteParamValue(this.client_encoding))
- }
- dns.lookup(this.host, function (err, address) {
- if (err) return cb(err, null)
- params.push('hostaddr=' + quoteParamValue(address))
- return cb(null, params.join(' '))
- })
- }
-}
-
-module.exports = ConnectionParameters
-
-
-/***/ }),
-
-/***/ 62848:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var net = __nccwpck_require__(11631)
-var EventEmitter = __nccwpck_require__(28614).EventEmitter
-var util = __nccwpck_require__(31669)
-
-const { parse, serialize } = __nccwpck_require__(21113)
-
-const flushBuffer = serialize.flush()
-const syncBuffer = serialize.sync()
-const endBuffer = serialize.end()
-
-// TODO(bmc) support binary mode at some point
-class Connection extends EventEmitter {
- constructor(config) {
- super()
- config = config || {}
- this.stream = config.stream || new net.Socket()
- this._keepAlive = config.keepAlive
- this._keepAliveInitialDelayMillis = config.keepAliveInitialDelayMillis
- this.lastBuffer = false
- this.parsedStatements = {}
- this.ssl = config.ssl || false
- this._ending = false
- this._emitMessage = false
- var self = this
- this.on('newListener', function (eventName) {
- if (eventName === 'message') {
- self._emitMessage = true
- }
- })
- }
-
- connect(port, host) {
- var self = this
-
- this._connecting = true
- this.stream.setNoDelay(true)
- this.stream.connect(port, host)
-
- this.stream.once('connect', function () {
- if (self._keepAlive) {
- self.stream.setKeepAlive(true, self._keepAliveInitialDelayMillis)
- }
- self.emit('connect')
- })
-
- const reportStreamError = function (error) {
- // errors about disconnections should be ignored during disconnect
- if (self._ending && (error.code === 'ECONNRESET' || error.code === 'EPIPE')) {
- return
- }
- self.emit('error', error)
- }
- this.stream.on('error', reportStreamError)
-
- this.stream.on('close', function () {
- self.emit('end')
- })
-
- if (!this.ssl) {
- return this.attachListeners(this.stream)
- }
-
- this.stream.once('data', function (buffer) {
- var responseCode = buffer.toString('utf8')
- switch (responseCode) {
- case 'S': // Server supports SSL connections, continue with a secure connection
- break
- case 'N': // Server does not support SSL connections
- self.stream.end()
- return self.emit('error', new Error('The server does not support SSL connections'))
- default:
- // Any other response byte, including 'E' (ErrorResponse) indicating a server error
- self.stream.end()
- return self.emit('error', new Error('There was an error establishing an SSL connection'))
- }
- var tls = __nccwpck_require__(4016)
- const options = {
- socket: self.stream,
- }
-
- if (self.ssl !== true) {
- Object.assign(options, self.ssl)
-
- if ('key' in self.ssl) {
- options.key = self.ssl.key
- }
- }
-
- if (net.isIP(host) === 0) {
- options.servername = host
- }
- try {
- self.stream = tls.connect(options)
- } catch (err) {
- return self.emit('error', err)
- }
- self.attachListeners(self.stream)
- self.stream.on('error', reportStreamError)
-
- self.emit('sslconnect')
- })
- }
-
- attachListeners(stream) {
- stream.on('end', () => {
- this.emit('end')
- })
- parse(stream, (msg) => {
- var eventName = msg.name === 'error' ? 'errorMessage' : msg.name
- if (this._emitMessage) {
- this.emit('message', msg)
- }
- this.emit(eventName, msg)
- })
- }
-
- requestSsl() {
- this.stream.write(serialize.requestSsl())
- }
-
- startup(config) {
- this.stream.write(serialize.startup(config))
- }
-
- cancel(processID, secretKey) {
- this._send(serialize.cancel(processID, secretKey))
- }
-
- password(password) {
- this._send(serialize.password(password))
- }
-
- sendSASLInitialResponseMessage(mechanism, initialResponse) {
- this._send(serialize.sendSASLInitialResponseMessage(mechanism, initialResponse))
- }
-
- sendSCRAMClientFinalMessage(additionalData) {
- this._send(serialize.sendSCRAMClientFinalMessage(additionalData))
- }
-
- _send(buffer) {
- if (!this.stream.writable) {
- return false
- }
- return this.stream.write(buffer)
- }
-
- query(text) {
- this._send(serialize.query(text))
- }
-
- // send parse message
- parse(query) {
- this._send(serialize.parse(query))
- }
-
- // send bind message
- bind(config) {
- this._send(serialize.bind(config))
- }
-
- // send execute message
- execute(config) {
- this._send(serialize.execute(config))
- }
-
- flush() {
- if (this.stream.writable) {
- this.stream.write(flushBuffer)
- }
- }
-
- sync() {
- this._ending = true
- this._send(flushBuffer)
- this._send(syncBuffer)
- }
-
- end() {
- // 0x58 = 'X'
- this._ending = true
- if (!this._connecting || !this.stream.writable) {
- this.stream.end()
- return
- }
- return this.stream.write(endBuffer, () => {
- this.stream.end()
- })
- }
-
- close(msg) {
- this._send(serialize.close(msg))
- }
-
- describe(msg) {
- this._send(serialize.describe(msg))
- }
-
- sendCopyFromChunk(chunk) {
- this._send(serialize.copyData(chunk))
- }
-
- endCopyFrom() {
- this._send(serialize.copyDone())
- }
-
- sendCopyFail(msg) {
- this._send(serialize.copyFail(msg))
- }
-}
-
-module.exports = Connection
-
-
-/***/ }),
-
-/***/ 26419:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-module.exports = {
- // database host. defaults to localhost
- host: 'localhost',
-
- // database user's name
- user: process.platform === 'win32' ? process.env.USERNAME : process.env.USER,
-
- // name of database to connect
- database: undefined,
-
- // database user's password
- password: null,
-
- // a Postgres connection string to be used instead of setting individual connection items
- // NOTE: Setting this value will cause it to override any other value (such as database or user) defined
- // in the defaults object.
- connectionString: undefined,
-
- // database port
- port: 5432,
-
- // number of rows to return at a time from a prepared statement's
- // portal. 0 will return all rows at once
- rows: 0,
-
- // binary result mode
- binary: false,
-
- // Connection pool options - see https://github.com/brianc/node-pg-pool
-
- // number of connections to use in connection pool
- // 0 will disable connection pooling
- max: 10,
-
- // max milliseconds a client can go unused before it is removed
- // from the pool and destroyed
- idleTimeoutMillis: 30000,
-
- client_encoding: '',
-
- ssl: false,
-
- application_name: undefined,
-
- fallback_application_name: undefined,
-
- options: undefined,
-
- parseInputDatesAsUTC: false,
-
- // max milliseconds any query using this connection will execute for before timing out in error.
- // false=unlimited
- statement_timeout: false,
-
- // Terminate any session with an open transaction that has been idle for longer than the specified duration in milliseconds
- // false=unlimited
- idle_in_transaction_session_timeout: false,
-
- // max milliseconds to wait for query to complete (client side)
- query_timeout: false,
-
- connect_timeout: 0,
-
- keepalives: 1,
-
- keepalives_idle: 0,
-}
-
-var pgTypes = __nccwpck_require__(77929)
-// save default parsers
-var parseBigInteger = pgTypes.getTypeParser(20, 'text')
-var parseBigIntegerArray = pgTypes.getTypeParser(1016, 'text')
-
-// parse int8 so you can get your count values as actual numbers
-module.exports.__defineSetter__('parseInt8', function (val) {
- pgTypes.setTypeParser(20, 'text', val ? pgTypes.getTypeParser(23, 'text') : parseBigInteger)
- pgTypes.setTypeParser(1016, 'text', val ? pgTypes.getTypeParser(1007, 'text') : parseBigIntegerArray)
-})
-
-
-/***/ }),
-
-/***/ 44194:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var Client = __nccwpck_require__(37143)
-var defaults = __nccwpck_require__(26419)
-var Connection = __nccwpck_require__(62848)
-var Pool = __nccwpck_require__(99599)
-
-const poolFactory = (Client) => {
- return class BoundPool extends Pool {
- constructor(options) {
- super(options, Client)
- }
- }
-}
-
-var PG = function (clientConstructor) {
- this.defaults = defaults
- this.Client = clientConstructor
- this.Query = this.Client.Query
- this.Pool = poolFactory(this.Client)
- this._pools = []
- this.Connection = Connection
- this.types = __nccwpck_require__(77929)
-}
-
-if (typeof process.env.NODE_PG_FORCE_NATIVE !== 'undefined') {
- module.exports = new PG(__nccwpck_require__(43148))
-} else {
- module.exports = new PG(Client)
-
- // lazy require native module...the native module may not have installed
- Object.defineProperty(module.exports, "native", ({
- configurable: true,
- enumerable: false,
- get() {
- var native = null
- try {
- native = new PG(__nccwpck_require__(43148))
- } catch (err) {
- if (err.code !== 'MODULE_NOT_FOUND') {
- throw err
- }
- }
-
- // overwrite module.exports.native so that getter is never called again
- Object.defineProperty(module.exports, "native", ({
- value: native,
- }))
-
- return native
- },
- }))
-}
-
-
-/***/ }),
-
-/***/ 1094:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-// eslint-disable-next-line
-var Native = __nccwpck_require__(38889)
-var TypeOverrides = __nccwpck_require__(78873)
-var pkg = __nccwpck_require__(60257)
-var EventEmitter = __nccwpck_require__(28614).EventEmitter
-var util = __nccwpck_require__(31669)
-var ConnectionParameters = __nccwpck_require__(19112)
-
-var NativeQuery = __nccwpck_require__(91886)
-
-var Client = (module.exports = function (config) {
- EventEmitter.call(this)
- config = config || {}
-
- this._Promise = config.Promise || global.Promise
- this._types = new TypeOverrides(config.types)
-
- this.native = new Native({
- types: this._types,
- })
-
- this._queryQueue = []
- this._ending = false
- this._connecting = false
- this._connected = false
- this._queryable = true
-
- // keep these on the object for legacy reasons
- // for the time being. TODO: deprecate all this jazz
- var cp = (this.connectionParameters = new ConnectionParameters(config))
- this.user = cp.user
-
- // "hiding" the password so it doesn't show up in stack traces
- // or if the client is console.logged
- Object.defineProperty(this, 'password', {
- configurable: true,
- enumerable: false,
- writable: true,
- value: cp.password,
- })
- this.database = cp.database
- this.host = cp.host
- this.port = cp.port
-
- // a hash to hold named queries
- this.namedQueries = {}
-})
-
-Client.Query = NativeQuery
-
-util.inherits(Client, EventEmitter)
-
-Client.prototype._errorAllQueries = function (err) {
- const enqueueError = (query) => {
- process.nextTick(() => {
- query.native = this.native
- query.handleError(err)
- })
- }
-
- if (this._hasActiveQuery()) {
- enqueueError(this._activeQuery)
- this._activeQuery = null
- }
-
- this._queryQueue.forEach(enqueueError)
- this._queryQueue.length = 0
-}
-
-// connect to the backend
-// pass an optional callback to be called once connected
-// or with an error if there was a connection error
-Client.prototype._connect = function (cb) {
- var self = this
-
- if (this._connecting) {
- process.nextTick(() => cb(new Error('Client has already been connected. You cannot reuse a client.')))
- return
- }
-
- this._connecting = true
-
- this.connectionParameters.getLibpqConnectionString(function (err, conString) {
- if (err) return cb(err)
- self.native.connect(conString, function (err) {
- if (err) {
- self.native.end()
- return cb(err)
- }
-
- // set internal states to connected
- self._connected = true
-
- // handle connection errors from the native layer
- self.native.on('error', function (err) {
- self._queryable = false
- self._errorAllQueries(err)
- self.emit('error', err)
- })
-
- self.native.on('notification', function (msg) {
- self.emit('notification', {
- channel: msg.relname,
- payload: msg.extra,
- })
- })
-
- // signal we are connected now
- self.emit('connect')
- self._pulseQueryQueue(true)
-
- cb()
- })
- })
-}
-
-Client.prototype.connect = function (callback) {
- if (callback) {
- this._connect(callback)
- return
- }
-
- return new this._Promise((resolve, reject) => {
- this._connect((error) => {
- if (error) {
- reject(error)
- } else {
- resolve()
- }
- })
- })
-}
-
-// send a query to the server
-// this method is highly overloaded to take
-// 1) string query, optional array of parameters, optional function callback
-// 2) object query with {
-// string query
-// optional array values,
-// optional function callback instead of as a separate parameter
-// optional string name to name & cache the query plan
-// optional string rowMode = 'array' for an array of results
-// }
-Client.prototype.query = function (config, values, callback) {
- var query
- var result
- var readTimeout
- var readTimeoutTimer
- var queryCallback
-
- if (config === null || config === undefined) {
- throw new TypeError('Client was passed a null or undefined query')
- } else if (typeof config.submit === 'function') {
- readTimeout = config.query_timeout || this.connectionParameters.query_timeout
- result = query = config
- // accept query(new Query(...), (err, res) => { }) style
- if (typeof values === 'function') {
- config.callback = values
- }
- } else {
- readTimeout = this.connectionParameters.query_timeout
- query = new NativeQuery(config, values, callback)
- if (!query.callback) {
- let resolveOut, rejectOut
- result = new this._Promise((resolve, reject) => {
- resolveOut = resolve
- rejectOut = reject
- })
- query.callback = (err, res) => (err ? rejectOut(err) : resolveOut(res))
- }
- }
-
- if (readTimeout) {
- queryCallback = query.callback
-
- readTimeoutTimer = setTimeout(() => {
- var error = new Error('Query read timeout')
-
- process.nextTick(() => {
- query.handleError(error, this.connection)
- })
-
- queryCallback(error)
-
- // we already returned an error,
- // just do nothing if query completes
- query.callback = () => {}
-
- // Remove from queue
- var index = this._queryQueue.indexOf(query)
- if (index > -1) {
- this._queryQueue.splice(index, 1)
- }
-
- this._pulseQueryQueue()
- }, readTimeout)
-
- query.callback = (err, res) => {
- clearTimeout(readTimeoutTimer)
- queryCallback(err, res)
- }
- }
-
- if (!this._queryable) {
- query.native = this.native
- process.nextTick(() => {
- query.handleError(new Error('Client has encountered a connection error and is not queryable'))
- })
- return result
- }
-
- if (this._ending) {
- query.native = this.native
- process.nextTick(() => {
- query.handleError(new Error('Client was closed and is not queryable'))
- })
- return result
- }
-
- this._queryQueue.push(query)
- this._pulseQueryQueue()
- return result
-}
-
-// disconnect from the backend server
-Client.prototype.end = function (cb) {
- var self = this
-
- this._ending = true
-
- if (!this._connected) {
- this.once('connect', this.end.bind(this, cb))
- }
- var result
- if (!cb) {
- result = new this._Promise(function (resolve, reject) {
- cb = (err) => (err ? reject(err) : resolve())
- })
- }
- this.native.end(function () {
- self._errorAllQueries(new Error('Connection terminated'))
-
- process.nextTick(() => {
- self.emit('end')
- if (cb) cb()
- })
- })
- return result
-}
-
-Client.prototype._hasActiveQuery = function () {
- return this._activeQuery && this._activeQuery.state !== 'error' && this._activeQuery.state !== 'end'
-}
-
-Client.prototype._pulseQueryQueue = function (initialConnection) {
- if (!this._connected) {
- return
- }
- if (this._hasActiveQuery()) {
- return
- }
- var query = this._queryQueue.shift()
- if (!query) {
- if (!initialConnection) {
- this.emit('drain')
- }
- return
- }
- this._activeQuery = query
- query.submit(this)
- var self = this
- query.once('_done', function () {
- self._pulseQueryQueue()
- })
-}
-
-// attempt to cancel an in-progress query
-Client.prototype.cancel = function (query) {
- if (this._activeQuery === query) {
- this.native.cancel(function () {})
- } else if (this._queryQueue.indexOf(query) !== -1) {
- this._queryQueue.splice(this._queryQueue.indexOf(query), 1)
- }
-}
-
-Client.prototype.setTypeParser = function (oid, format, parseFn) {
- return this._types.setTypeParser(oid, format, parseFn)
-}
-
-Client.prototype.getTypeParser = function (oid, format) {
- return this._types.getTypeParser(oid, format)
-}
-
-
-/***/ }),
-
-/***/ 43148:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-module.exports = __nccwpck_require__(1094)
-
-
-/***/ }),
-
-/***/ 91886:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var EventEmitter = __nccwpck_require__(28614).EventEmitter
-var util = __nccwpck_require__(31669)
-var utils = __nccwpck_require__(36419)
-
-var NativeQuery = (module.exports = function (config, values, callback) {
- EventEmitter.call(this)
- config = utils.normalizeQueryConfig(config, values, callback)
- this.text = config.text
- this.values = config.values
- this.name = config.name
- this.callback = config.callback
- this.state = 'new'
- this._arrayMode = config.rowMode === 'array'
-
- // if the 'row' event is listened for
- // then emit them as they come in
- // without setting singleRowMode to true
- // this has almost no meaning because libpq
- // reads all rows into memory befor returning any
- this._emitRowEvents = false
- this.on(
- 'newListener',
- function (event) {
- if (event === 'row') this._emitRowEvents = true
- }.bind(this)
- )
-})
-
-util.inherits(NativeQuery, EventEmitter)
-
-var errorFieldMap = {
- /* eslint-disable quote-props */
- sqlState: 'code',
- statementPosition: 'position',
- messagePrimary: 'message',
- context: 'where',
- schemaName: 'schema',
- tableName: 'table',
- columnName: 'column',
- dataTypeName: 'dataType',
- constraintName: 'constraint',
- sourceFile: 'file',
- sourceLine: 'line',
- sourceFunction: 'routine',
-}
-
-NativeQuery.prototype.handleError = function (err) {
- // copy pq error fields into the error object
- var fields = this.native.pq.resultErrorFields()
- if (fields) {
- for (var key in fields) {
- var normalizedFieldName = errorFieldMap[key] || key
- err[normalizedFieldName] = fields[key]
- }
- }
- if (this.callback) {
- this.callback(err)
- } else {
- this.emit('error', err)
- }
- this.state = 'error'
-}
-
-NativeQuery.prototype.then = function (onSuccess, onFailure) {
- return this._getPromise().then(onSuccess, onFailure)
-}
-
-NativeQuery.prototype.catch = function (callback) {
- return this._getPromise().catch(callback)
-}
-
-NativeQuery.prototype._getPromise = function () {
- if (this._promise) return this._promise
- this._promise = new Promise(
- function (resolve, reject) {
- this._once('end', resolve)
- this._once('error', reject)
- }.bind(this)
- )
- return this._promise
-}
-
-NativeQuery.prototype.submit = function (client) {
- this.state = 'running'
- var self = this
- this.native = client.native
- client.native.arrayMode = this._arrayMode
-
- var after = function (err, rows, results) {
- client.native.arrayMode = false
- setImmediate(function () {
- self.emit('_done')
- })
-
- // handle possible query error
- if (err) {
- return self.handleError(err)
- }
-
- // emit row events for each row in the result
- if (self._emitRowEvents) {
- if (results.length > 1) {
- rows.forEach((rowOfRows, i) => {
- rowOfRows.forEach((row) => {
- self.emit('row', row, results[i])
- })
- })
- } else {
- rows.forEach(function (row) {
- self.emit('row', row, results)
- })
- }
- }
-
- // handle successful result
- self.state = 'end'
- self.emit('end', results)
- if (self.callback) {
- self.callback(null, results)
- }
- }
-
- if (process.domain) {
- after = process.domain.bind(after)
- }
-
- // named query
- if (this.name) {
- if (this.name.length > 63) {
- /* eslint-disable no-console */
- console.error('Warning! Postgres only supports 63 characters for query names.')
- console.error('You supplied %s (%s)', this.name, this.name.length)
- console.error('This can cause conflicts and silent errors executing queries')
- /* eslint-enable no-console */
- }
- var values = (this.values || []).map(utils.prepareValue)
-
- // check if the client has already executed this named query
- // if so...just execute it again - skip the planning phase
- if (client.namedQueries[this.name]) {
- if (this.text && client.namedQueries[this.name] !== this.text) {
- const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
- return after(err)
- }
- return client.native.execute(this.name, values, after)
- }
- // plan the named query the first time, then execute it
- return client.native.prepare(this.name, this.text, values.length, function (err) {
- if (err) return after(err)
- client.namedQueries[self.name] = self.text
- return self.native.execute(self.name, values, after)
- })
- } else if (this.values) {
- if (!Array.isArray(this.values)) {
- const err = new Error('Query values must be an array')
- return after(err)
- }
- var vals = this.values.map(utils.prepareValue)
- client.native.query(this.text, vals, after)
- } else {
- client.native.query(this.text, after)
- }
-}
-
-
-/***/ }),
-
-/***/ 31283:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const { EventEmitter } = __nccwpck_require__(28614)
-
-const Result = __nccwpck_require__(26736)
-const utils = __nccwpck_require__(36419)
-
-class Query extends EventEmitter {
- constructor(config, values, callback) {
- super()
-
- config = utils.normalizeQueryConfig(config, values, callback)
-
- this.text = config.text
- this.values = config.values
- this.rows = config.rows
- this.types = config.types
- this.name = config.name
- this.binary = config.binary
- // use unique portal name each time
- this.portal = config.portal || ''
- this.callback = config.callback
- this._rowMode = config.rowMode
- if (process.domain && config.callback) {
- this.callback = process.domain.bind(config.callback)
- }
- this._result = new Result(this._rowMode, this.types)
-
- // potential for multiple results
- this._results = this._result
- this.isPreparedStatement = false
- this._canceledDueToError = false
- this._promise = null
- }
-
- requiresPreparation() {
- // named queries must always be prepared
- if (this.name) {
- return true
- }
- // always prepare if there are max number of rows expected per
- // portal execution
- if (this.rows) {
- return true
- }
- // don't prepare empty text queries
- if (!this.text) {
- return false
- }
- // prepare if there are values
- if (!this.values) {
- return false
- }
- return this.values.length > 0
- }
-
- _checkForMultirow() {
- // if we already have a result with a command property
- // then we've already executed one query in a multi-statement simple query
- // turn our results into an array of results
- if (this._result.command) {
- if (!Array.isArray(this._results)) {
- this._results = [this._result]
- }
- this._result = new Result(this._rowMode, this.types)
- this._results.push(this._result)
- }
- }
-
- // associates row metadata from the supplied
- // message with this query object
- // metadata used when parsing row results
- handleRowDescription(msg) {
- this._checkForMultirow()
- this._result.addFields(msg.fields)
- this._accumulateRows = this.callback || !this.listeners('row').length
- }
-
- handleDataRow(msg) {
- let row
-
- if (this._canceledDueToError) {
- return
- }
-
- try {
- row = this._result.parseRow(msg.fields)
- } catch (err) {
- this._canceledDueToError = err
- return
- }
-
- this.emit('row', row, this._result)
- if (this._accumulateRows) {
- this._result.addRow(row)
- }
- }
-
- handleCommandComplete(msg, connection) {
- this._checkForMultirow()
- this._result.addCommandComplete(msg)
- // need to sync after each command complete of a prepared statement
- // if we were using a row count which results in multiple calls to _getRows
- if (this.rows) {
- connection.sync()
- }
- }
-
- // if a named prepared statement is created with empty query text
- // the backend will send an emptyQuery message but *not* a command complete message
- // since we pipeline sync immediately after execute we don't need to do anything here
- // unless we have rows specified, in which case we did not pipeline the intial sync call
- handleEmptyQuery(connection) {
- if (this.rows) {
- connection.sync()
- }
- }
-
- handleError(err, connection) {
- // need to sync after error during a prepared statement
- if (this._canceledDueToError) {
- err = this._canceledDueToError
- this._canceledDueToError = false
- }
- // if callback supplied do not emit error event as uncaught error
- // events will bubble up to node process
- if (this.callback) {
- return this.callback(err)
- }
- this.emit('error', err)
- }
-
- handleReadyForQuery(con) {
- if (this._canceledDueToError) {
- return this.handleError(this._canceledDueToError, con)
- }
- if (this.callback) {
- this.callback(null, this._results)
- }
- this.emit('end', this._results)
- }
-
- submit(connection) {
- if (typeof this.text !== 'string' && typeof this.name !== 'string') {
- return new Error('A query must have either text or a name. Supplying neither is unsupported.')
- }
- const previous = connection.parsedStatements[this.name]
- if (this.text && previous && this.text !== previous) {
- return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
- }
- if (this.values && !Array.isArray(this.values)) {
- return new Error('Query values must be an array')
- }
- if (this.requiresPreparation()) {
- this.prepare(connection)
- } else {
- connection.query(this.text)
- }
- return null
- }
-
- hasBeenParsed(connection) {
- return this.name && connection.parsedStatements[this.name]
- }
-
- handlePortalSuspended(connection) {
- this._getRows(connection, this.rows)
- }
-
- _getRows(connection, rows) {
- connection.execute({
- portal: this.portal,
- rows: rows,
- })
- // if we're not reading pages of rows send the sync command
- // to indicate the pipeline is finished
- if (!rows) {
- connection.sync()
- } else {
- // otherwise flush the call out to read more rows
- connection.flush()
- }
- }
-
- // http://developer.postgresql.org/pgdocs/postgres/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
- prepare(connection) {
- // prepared statements need sync to be called after each command
- // complete or when an error is encountered
- this.isPreparedStatement = true
-
- // TODO refactor this poor encapsulation
- if (!this.hasBeenParsed(connection)) {
- connection.parse({
- text: this.text,
- name: this.name,
- types: this.types,
- })
- }
-
- // because we're mapping user supplied values to
- // postgres wire protocol compatible values it could
- // throw an exception, so try/catch this section
- try {
- connection.bind({
- portal: this.portal,
- statement: this.name,
- values: this.values,
- binary: this.binary,
- valueMapper: utils.prepareValue,
- })
- } catch (err) {
- this.handleError(err, connection)
- return
- }
-
- connection.describe({
- type: 'P',
- name: this.portal || '',
- })
-
- this._getRows(connection, this.rows)
- }
-
- handleCopyInResponse(connection) {
- connection.sendCopyFail('No source stream defined')
- }
-
- // eslint-disable-next-line no-unused-vars
- handleCopyData(msg, connection) {
- // noop
- }
-}
-
-module.exports = Query
-
-
-/***/ }),
-
-/***/ 26736:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var types = __nccwpck_require__(77929)
-
-var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/
-
-// result object returned from query
-// in the 'end' event and also
-// passed as second argument to provided callback
-class Result {
- constructor(rowMode, types) {
- this.command = null
- this.rowCount = null
- this.oid = null
- this.rows = []
- this.fields = []
- this._parsers = undefined
- this._types = types
- this.RowCtor = null
- this.rowAsArray = rowMode === 'array'
- if (this.rowAsArray) {
- this.parseRow = this._parseRowAsArray
- }
- }
-
- // adds a command complete message
- addCommandComplete(msg) {
- var match
- if (msg.text) {
- // pure javascript
- match = matchRegexp.exec(msg.text)
- } else {
- // native bindings
- match = matchRegexp.exec(msg.command)
- }
- if (match) {
- this.command = match[1]
- if (match[3]) {
- // COMMMAND OID ROWS
- this.oid = parseInt(match[2], 10)
- this.rowCount = parseInt(match[3], 10)
- } else if (match[2]) {
- // COMMAND ROWS
- this.rowCount = parseInt(match[2], 10)
- }
- }
- }
-
- _parseRowAsArray(rowData) {
- var row = new Array(rowData.length)
- for (var i = 0, len = rowData.length; i < len; i++) {
- var rawValue = rowData[i]
- if (rawValue !== null) {
- row[i] = this._parsers[i](rawValue)
- } else {
- row[i] = null
- }
- }
- return row
- }
-
- parseRow(rowData) {
- var row = {}
- for (var i = 0, len = rowData.length; i < len; i++) {
- var rawValue = rowData[i]
- var field = this.fields[i].name
- if (rawValue !== null) {
- row[field] = this._parsers[i](rawValue)
- } else {
- row[field] = null
- }
- }
- return row
- }
-
- addRow(row) {
- this.rows.push(row)
- }
-
- addFields(fieldDescriptions) {
- // clears field definitions
- // multiple query statements in 1 action can result in multiple sets
- // of rowDescriptions...eg: 'select NOW(); select 1::int;'
- // you need to reset the fields
- this.fields = fieldDescriptions
- if (this.fields.length) {
- this._parsers = new Array(fieldDescriptions.length)
- }
- for (var i = 0; i < fieldDescriptions.length; i++) {
- var desc = fieldDescriptions[i]
- if (this._types) {
- this._parsers[i] = this._types.getTypeParser(desc.dataTypeID, desc.format || 'text')
- } else {
- this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text')
- }
- }
- }
-}
-
-module.exports = Result
-
-
-/***/ }),
-
-/***/ 19481:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-const crypto = __nccwpck_require__(76417)
-
-function startSession(mechanisms) {
- if (mechanisms.indexOf('SCRAM-SHA-256') === -1) {
- throw new Error('SASL: Only mechanism SCRAM-SHA-256 is currently supported')
- }
-
- const clientNonce = crypto.randomBytes(18).toString('base64')
-
- return {
- mechanism: 'SCRAM-SHA-256',
- clientNonce,
- response: 'n,,n=*,r=' + clientNonce,
- message: 'SASLInitialResponse',
- }
-}
-
-function continueSession(session, password, serverData) {
- if (session.message !== 'SASLInitialResponse') {
- throw new Error('SASL: Last message was not SASLInitialResponse')
- }
-
- const sv = extractVariablesFromFirstServerMessage(serverData)
-
- if (!sv.nonce.startsWith(session.clientNonce)) {
- throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce')
- }
-
- var saltBytes = Buffer.from(sv.salt, 'base64')
-
- var saltedPassword = Hi(password, saltBytes, sv.iteration)
-
- var clientKey = createHMAC(saltedPassword, 'Client Key')
- var storedKey = crypto.createHash('sha256').update(clientKey).digest()
-
- var clientFirstMessageBare = 'n=*,r=' + session.clientNonce
- var serverFirstMessage = 'r=' + sv.nonce + ',s=' + sv.salt + ',i=' + sv.iteration
-
- var clientFinalMessageWithoutProof = 'c=biws,r=' + sv.nonce
-
- var authMessage = clientFirstMessageBare + ',' + serverFirstMessage + ',' + clientFinalMessageWithoutProof
-
- var clientSignature = createHMAC(storedKey, authMessage)
- var clientProofBytes = xorBuffers(clientKey, clientSignature)
- var clientProof = clientProofBytes.toString('base64')
-
- var serverKey = createHMAC(saltedPassword, 'Server Key')
- var serverSignatureBytes = createHMAC(serverKey, authMessage)
-
- session.message = 'SASLResponse'
- session.serverSignature = serverSignatureBytes.toString('base64')
- session.response = clientFinalMessageWithoutProof + ',p=' + clientProof
-}
-
-function finalizeSession(session, serverData) {
- if (session.message !== 'SASLResponse') {
- throw new Error('SASL: Last message was not SASLResponse')
- }
-
- var serverSignature
-
- String(serverData)
- .split(',')
- .forEach(function (part) {
- switch (part[0]) {
- case 'v':
- serverSignature = part.substr(2)
- break
- }
- })
-
- if (serverSignature !== session.serverSignature) {
- throw new Error('SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match')
- }
-}
-
-function extractVariablesFromFirstServerMessage(data) {
- var nonce, salt, iteration
-
- String(data)
- .split(',')
- .forEach(function (part) {
- switch (part[0]) {
- case 'r':
- nonce = part.substr(2)
- break
- case 's':
- salt = part.substr(2)
- break
- case 'i':
- iteration = parseInt(part.substr(2), 10)
- break
- }
- })
-
- if (!nonce) {
- throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing')
- }
-
- if (!salt) {
- throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing')
- }
-
- if (!iteration) {
- throw new Error('SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing')
- }
-
- return {
- nonce,
- salt,
- iteration,
- }
-}
-
-function xorBuffers(a, b) {
- if (!Buffer.isBuffer(a)) a = Buffer.from(a)
- if (!Buffer.isBuffer(b)) b = Buffer.from(b)
- var res = []
- if (a.length > b.length) {
- for (var i = 0; i < b.length; i++) {
- res.push(a[i] ^ b[i])
- }
- } else {
- for (var j = 0; j < a.length; j++) {
- res.push(a[j] ^ b[j])
- }
- }
- return Buffer.from(res)
-}
-
-function createHMAC(key, msg) {
- return crypto.createHmac('sha256', key).update(msg).digest()
-}
-
-function Hi(password, saltBytes, iterations) {
- var ui1 = createHMAC(password, Buffer.concat([saltBytes, Buffer.from([0, 0, 0, 1])]))
- var ui = ui1
- for (var i = 0; i < iterations - 1; i++) {
- ui1 = createHMAC(password, ui1)
- ui = xorBuffers(ui, ui1)
- }
-
- return ui
-}
-
-module.exports = {
- startSession,
- continueSession,
- finalizeSession,
-}
-
-
-/***/ }),
-
-/***/ 78873:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var types = __nccwpck_require__(77929)
-
-function TypeOverrides(userTypes) {
- this._types = userTypes || types
- this.text = {}
- this.binary = {}
-}
-
-TypeOverrides.prototype.getOverrides = function (format) {
- switch (format) {
- case 'text':
- return this.text
- case 'binary':
- return this.binary
- default:
- return {}
- }
-}
-
-TypeOverrides.prototype.setTypeParser = function (oid, format, parseFn) {
- if (typeof format === 'function') {
- parseFn = format
- format = 'text'
- }
- this.getOverrides(format)[oid] = parseFn
-}
-
-TypeOverrides.prototype.getTypeParser = function (oid, format) {
- format = format || 'text'
- return this.getOverrides(format)[oid] || this._types.getTypeParser(oid, format)
-}
-
-module.exports = TypeOverrides
-
-
-/***/ }),
-
-/***/ 36419:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-const crypto = __nccwpck_require__(76417)
-
-const defaults = __nccwpck_require__(26419)
-
-function escapeElement(elementRepresentation) {
- var escaped = elementRepresentation.replace(/\\/g, '\\\\').replace(/"/g, '\\"')
-
- return '"' + escaped + '"'
-}
-
-// convert a JS array to a postgres array literal
-// uses comma separator so won't work for types like box that use
-// a different array separator.
-function arrayString(val) {
- var result = '{'
- for (var i = 0; i < val.length; i++) {
- if (i > 0) {
- result = result + ','
- }
- if (val[i] === null || typeof val[i] === 'undefined') {
- result = result + 'NULL'
- } else if (Array.isArray(val[i])) {
- result = result + arrayString(val[i])
- } else if (val[i] instanceof Buffer) {
- result += '\\\\x' + val[i].toString('hex')
- } else {
- result += escapeElement(prepareValue(val[i]))
- }
- }
- result = result + '}'
- return result
-}
-
-// converts values from javascript types
-// to their 'raw' counterparts for use as a postgres parameter
-// note: you can override this function to provide your own conversion mechanism
-// for complex types, etc...
-var prepareValue = function (val, seen) {
- // null and undefined are both null for postgres
- if (val == null) {
- return null
- }
- if (val instanceof Buffer) {
- return val
- }
- if (ArrayBuffer.isView(val)) {
- var buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength)
- if (buf.length === val.byteLength) {
- return buf
- }
- return buf.slice(val.byteOffset, val.byteOffset + val.byteLength) // Node.js v4 does not support those Buffer.from params
- }
- if (val instanceof Date) {
- if (defaults.parseInputDatesAsUTC) {
- return dateToStringUTC(val)
- } else {
- return dateToString(val)
- }
- }
- if (Array.isArray(val)) {
- return arrayString(val)
- }
- if (typeof val === 'object') {
- return prepareObject(val, seen)
- }
- return val.toString()
-}
-
-function prepareObject(val, seen) {
- if (val && typeof val.toPostgres === 'function') {
- seen = seen || []
- if (seen.indexOf(val) !== -1) {
- throw new Error('circular reference detected while preparing "' + val + '" for query')
- }
- seen.push(val)
-
- return prepareValue(val.toPostgres(prepareValue), seen)
- }
- return JSON.stringify(val)
-}
-
-function pad(number, digits) {
- number = '' + number
- while (number.length < digits) {
- number = '0' + number
- }
- return number
-}
-
-function dateToString(date) {
- var offset = -date.getTimezoneOffset()
-
- var year = date.getFullYear()
- var isBCYear = year < 1
- if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation
-
- var ret =
- pad(year, 4) +
- '-' +
- pad(date.getMonth() + 1, 2) +
- '-' +
- pad(date.getDate(), 2) +
- 'T' +
- pad(date.getHours(), 2) +
- ':' +
- pad(date.getMinutes(), 2) +
- ':' +
- pad(date.getSeconds(), 2) +
- '.' +
- pad(date.getMilliseconds(), 3)
-
- if (offset < 0) {
- ret += '-'
- offset *= -1
- } else {
- ret += '+'
- }
-
- ret += pad(Math.floor(offset / 60), 2) + ':' + pad(offset % 60, 2)
- if (isBCYear) ret += ' BC'
- return ret
-}
-
-function dateToStringUTC(date) {
- var year = date.getUTCFullYear()
- var isBCYear = year < 1
- if (isBCYear) year = Math.abs(year) + 1 // negative years are 1 off their BC representation
-
- var ret =
- pad(year, 4) +
- '-' +
- pad(date.getUTCMonth() + 1, 2) +
- '-' +
- pad(date.getUTCDate(), 2) +
- 'T' +
- pad(date.getUTCHours(), 2) +
- ':' +
- pad(date.getUTCMinutes(), 2) +
- ':' +
- pad(date.getUTCSeconds(), 2) +
- '.' +
- pad(date.getUTCMilliseconds(), 3)
-
- ret += '+00:00'
- if (isBCYear) ret += ' BC'
- return ret
-}
-
-function normalizeQueryConfig(config, values, callback) {
- // can take in strings or config objects
- config = typeof config === 'string' ? { text: config } : config
- if (values) {
- if (typeof values === 'function') {
- config.callback = values
- } else {
- config.values = values
- }
- }
- if (callback) {
- config.callback = callback
- }
- return config
-}
-
-const md5 = function (string) {
- return crypto.createHash('md5').update(string, 'utf-8').digest('hex')
-}
-
-// See AuthenticationMD5Password at https://www.postgresql.org/docs/current/static/protocol-flow.html
-const postgresMd5PasswordHash = function (user, password, salt) {
- var inner = md5(password + user)
- var outer = md5(Buffer.concat([Buffer.from(inner), salt]))
- return 'md5' + outer
-}
-
-module.exports = {
- prepareValue: function prepareValueWrapper(value) {
- // this ensures that extra arguments do not get passed into prepareValue
- // by accident, eg: from calling values.map(utils.prepareValue)
- return prepareValue(value)
- },
- normalizeQueryConfig,
- postgresMd5PasswordHash,
- md5,
-}
-
-
-/***/ }),
-
-/***/ 16926:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var path = __nccwpck_require__(85622)
- , Stream = __nccwpck_require__(92413).Stream
- , split = __nccwpck_require__(15000)
- , util = __nccwpck_require__(31669)
- , defaultPort = 5432
- , isWin = (process.platform === 'win32')
- , warnStream = process.stderr
-;
-
-
-var S_IRWXG = 56 // 00070(8)
- , S_IRWXO = 7 // 00007(8)
- , S_IFMT = 61440 // 00170000(8)
- , S_IFREG = 32768 // 0100000(8)
-;
-function isRegFile(mode) {
- return ((mode & S_IFMT) == S_IFREG);
-}
-
-var fieldNames = [ 'host', 'port', 'database', 'user', 'password' ];
-var nrOfFields = fieldNames.length;
-var passKey = fieldNames[ nrOfFields -1 ];
-
-
-function warn() {
- var isWritable = (
- warnStream instanceof Stream &&
- true === warnStream.writable
- );
-
- if (isWritable) {
- var args = Array.prototype.slice.call(arguments).concat("\n");
- warnStream.write( util.format.apply(util, args) );
- }
-}
-
-
-Object.defineProperty(module.exports, "isWin", ({
- get : function() {
- return isWin;
- } ,
- set : function(val) {
- isWin = val;
- }
-}));
-
-
-module.exports.warnTo = function(stream) {
- var old = warnStream;
- warnStream = stream;
- return old;
-};
-
-module.exports.getFileName = function(rawEnv){
- var env = rawEnv || process.env;
- var file = env.PGPASSFILE || (
- isWin ?
- path.join( env.APPDATA || './' , 'postgresql', 'pgpass.conf' ) :
- path.join( env.HOME || './', '.pgpass' )
- );
- return file;
-};
-
-module.exports.usePgPass = function(stats, fname) {
- if (Object.prototype.hasOwnProperty.call(process.env, 'PGPASSWORD')) {
- return false;
- }
-
- if (isWin) {
- return true;
- }
-
- fname = fname || '';
-
- if (! isRegFile(stats.mode)) {
- warn('WARNING: password file "%s" is not a plain file', fname);
- return false;
- }
-
- if (stats.mode & (S_IRWXG | S_IRWXO)) {
- /* If password file is insecure, alert the user and ignore it. */
- warn('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less', fname);
- return false;
- }
-
- return true;
-};
-
-
-var matcher = module.exports.match = function(connInfo, entry) {
- return fieldNames.slice(0, -1).reduce(function(prev, field, idx){
- if (idx == 1) {
- // the port
- if ( Number( connInfo[field] || defaultPort ) === Number( entry[field] ) ) {
- return prev && true;
- }
- }
- return prev && (
- entry[field] === '*' ||
- entry[field] === connInfo[field]
- );
- }, true);
-};
-
-
-module.exports.getPassword = function(connInfo, stream, cb) {
- var pass;
- var lineStream = stream.pipe(split());
-
- function onLine(line) {
- var entry = parseLine(line);
- if (entry && isValidEntry(entry) && matcher(connInfo, entry)) {
- pass = entry[passKey];
- lineStream.end(); // -> calls onEnd(), but pass is set now
- }
- }
-
- var onEnd = function() {
- stream.destroy();
- cb(pass);
- };
-
- var onErr = function(err) {
- stream.destroy();
- warn('WARNING: error on reading file: %s', err);
- cb(undefined);
- };
-
- stream.on('error', onErr);
- lineStream
- .on('data', onLine)
- .on('end', onEnd)
- .on('error', onErr)
- ;
-
-};
-
-
-var parseLine = module.exports.parseLine = function(line) {
- if (line.length < 11 || line.match(/^\s+#/)) {
- return null;
- }
-
- var curChar = '';
- var prevChar = '';
- var fieldIdx = 0;
- var startIdx = 0;
- var endIdx = 0;
- var obj = {};
- var isLastField = false;
- var addToObj = function(idx, i0, i1) {
- var field = line.substring(i0, i1);
-
- if (! Object.hasOwnProperty.call(process.env, 'PGPASS_NO_DEESCAPE')) {
- field = field.replace(/\\([:\\])/g, '$1');
- }
-
- obj[ fieldNames[idx] ] = field;
- };
-
- for (var i = 0 ; i < line.length-1 ; i += 1) {
- curChar = line.charAt(i+1);
- prevChar = line.charAt(i);
-
- isLastField = (fieldIdx == nrOfFields-1);
-
- if (isLastField) {
- addToObj(fieldIdx, startIdx);
- break;
- }
-
- if (i >= 0 && curChar == ':' && prevChar !== '\\') {
- addToObj(fieldIdx, startIdx, i+1);
-
- startIdx = i+2;
- fieldIdx += 1;
- }
- }
-
- obj = ( Object.keys(obj).length === nrOfFields ) ? obj : null;
-
- return obj;
-};
-
-
-var isValidEntry = module.exports.isValidEntry = function(entry){
- var rules = {
- // host
- 0 : function(x){
- return x.length > 0;
- } ,
- // port
- 1 : function(x){
- if (x === '*') {
- return true;
- }
- x = Number(x);
- return (
- isFinite(x) &&
- x > 0 &&
- x < 9007199254740992 &&
- Math.floor(x) === x
- );
- } ,
- // database
- 2 : function(x){
- return x.length > 0;
- } ,
- // username
- 3 : function(x){
- return x.length > 0;
- } ,
- // password
- 4 : function(x){
- return x.length > 0;
- }
- };
-
- for (var idx = 0 ; idx < fieldNames.length ; idx += 1) {
- var rule = rules[idx];
- var value = entry[ fieldNames[idx] ] || '';
-
- var res = rule(value);
- if (!res) {
- return false;
- }
- }
-
- return true;
-};
-
-
-
-/***/ }),
-
-/***/ 19713:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var path = __nccwpck_require__(85622)
- , fs = __nccwpck_require__(35747)
- , helper = __nccwpck_require__(16926)
-;
-
-
-module.exports = function(connInfo, cb) {
- var file = helper.getFileName();
-
- fs.stat(file, function(err, stat){
- if (err || !helper.usePgPass(stat, file)) {
- return cb(undefined);
- }
-
- var st = fs.createReadStream(file);
-
- helper.getPassword(connInfo, st, cb);
- });
-};
-
-module.exports.warnTo = helper.warnTo;
-
-
-/***/ }),
-
-/***/ 34702:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-
-
-exports.parse = function (source, transform) {
- return new ArrayParser(source, transform).parse()
-}
-
-class ArrayParser {
- constructor (source, transform) {
- this.source = source
- this.transform = transform || identity
- this.position = 0
- this.entries = []
- this.recorded = []
- this.dimension = 0
- }
-
- isEof () {
- return this.position >= this.source.length
- }
-
- nextCharacter () {
- var character = this.source[this.position++]
- if (character === '\\') {
- return {
- value: this.source[this.position++],
- escaped: true
- }
- }
- return {
- value: character,
- escaped: false
- }
- }
-
- record (character) {
- this.recorded.push(character)
- }
-
- newEntry (includeEmpty) {
- var entry
- if (this.recorded.length > 0 || includeEmpty) {
- entry = this.recorded.join('')
- if (entry === 'NULL' && !includeEmpty) {
- entry = null
- }
- if (entry !== null) entry = this.transform(entry)
- this.entries.push(entry)
- this.recorded = []
- }
- }
-
- consumeDimensions () {
- if (this.source[0] === '[') {
- while (!this.isEof()) {
- var char = this.nextCharacter()
- if (char.value === '=') break
- }
- }
- }
-
- parse (nested) {
- var character, parser, quote
- this.consumeDimensions()
- while (!this.isEof()) {
- character = this.nextCharacter()
- if (character.value === '{' && !quote) {
- this.dimension++
- if (this.dimension > 1) {
- parser = new ArrayParser(this.source.substr(this.position - 1), this.transform)
- this.entries.push(parser.parse(true))
- this.position += parser.position - 2
- }
- } else if (character.value === '}' && !quote) {
- this.dimension--
- if (!this.dimension) {
- this.newEntry()
- if (nested) return this.entries
- }
- } else if (character.value === '"' && !character.escaped) {
- if (quote) this.newEntry(true)
- quote = !quote
- } else if (character.value === ',' && !quote) {
- this.newEntry()
- } else {
- this.record(character.value)
- }
- }
- if (this.dimension !== 0) {
- throw new Error('array dimension not balanced')
- }
- return this.entries
- }
-}
-
-function identity (value) {
- return value
-}
-
-
-/***/ }),
-
-/***/ 79377:
-/***/ ((module) => {
-
-"use strict";
-
-
-module.exports = function parseBytea (input) {
- if (/^\\x/.test(input)) {
- // new 'hex' style response (pg >9.0)
- return new Buffer(input.substr(2), 'hex')
- }
- var output = ''
- var i = 0
- while (i < input.length) {
- if (input[i] !== '\\') {
- output += input[i]
- ++i
- } else {
- if (/[0-7]{3}/.test(input.substr(i + 1, 3))) {
- output += String.fromCharCode(parseInt(input.substr(i + 1, 3), 8))
- i += 4
- } else {
- var backslashes = 1
- while (i + backslashes < input.length && input[i + backslashes] === '\\') {
- backslashes++
- }
- for (var k = 0; k < Math.floor(backslashes / 2); ++k) {
- output += '\\'
- }
- i += Math.floor(backslashes / 2) * 2
- }
- }
- }
- return new Buffer(output, 'binary')
-}
-
-
-/***/ }),
-
-/***/ 13264:
-/***/ ((module) => {
-
-"use strict";
-
-
-var DATE_TIME = /(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/
-var DATE = /^(\d{1,})-(\d{2})-(\d{2})( BC)?$/
-var TIME_ZONE = /([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/
-var INFINITY = /^-?infinity$/
-
-module.exports = function parseDate (isoDate) {
- if (INFINITY.test(isoDate)) {
- // Capitalize to Infinity before passing to Number
- return Number(isoDate.replace('i', 'I'))
- }
- var matches = DATE_TIME.exec(isoDate)
-
- if (!matches) {
- // Force YYYY-MM-DD dates to be parsed as local time
- return getDate(isoDate) || null
- }
-
- var isBC = !!matches[8]
- var year = parseInt(matches[1], 10)
- if (isBC) {
- year = bcYearToNegativeYear(year)
- }
-
- var month = parseInt(matches[2], 10) - 1
- var day = matches[3]
- var hour = parseInt(matches[4], 10)
- var minute = parseInt(matches[5], 10)
- var second = parseInt(matches[6], 10)
-
- var ms = matches[7]
- ms = ms ? 1000 * parseFloat(ms) : 0
-
- var date
- var offset = timeZoneOffset(isoDate)
- if (offset != null) {
- date = new Date(Date.UTC(year, month, day, hour, minute, second, ms))
-
- // Account for years from 0 to 99 being interpreted as 1900-1999
- // by Date.UTC / the multi-argument form of the Date constructor
- if (is0To99(year)) {
- date.setUTCFullYear(year)
- }
-
- if (offset !== 0) {
- date.setTime(date.getTime() - offset)
- }
- } else {
- date = new Date(year, month, day, hour, minute, second, ms)
-
- if (is0To99(year)) {
- date.setFullYear(year)
- }
- }
-
- return date
-}
-
-function getDate (isoDate) {
- var matches = DATE.exec(isoDate)
- if (!matches) {
- return
- }
-
- var year = parseInt(matches[1], 10)
- var isBC = !!matches[4]
- if (isBC) {
- year = bcYearToNegativeYear(year)
- }
-
- var month = parseInt(matches[2], 10) - 1
- var day = matches[3]
- // YYYY-MM-DD will be parsed as local time
- var date = new Date(year, month, day)
-
- if (is0To99(year)) {
- date.setFullYear(year)
- }
-
- return date
-}
-
-// match timezones:
-// Z (UTC)
-// -05
-// +06:30
-function timeZoneOffset (isoDate) {
- if (isoDate.endsWith('+00')) {
- return 0
- }
-
- var zone = TIME_ZONE.exec(isoDate.split(' ')[1])
- if (!zone) return
- var type = zone[1]
-
- if (type === 'Z') {
- return 0
- }
- var sign = type === '-' ? -1 : 1
- var offset = parseInt(zone[2], 10) * 3600 +
- parseInt(zone[3] || 0, 10) * 60 +
- parseInt(zone[4] || 0, 10)
-
- return offset * sign * 1000
-}
-
-function bcYearToNegativeYear (year) {
- // Account for numerical difference between representations of BC years
- // See: https://github.com/bendrucker/postgres-date/issues/5
- return -(year - 1)
-}
-
-function is0To99 (num) {
- return num >= 0 && num < 100
-}
-
-
-/***/ }),
-
-/***/ 19991:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var extend = __nccwpck_require__(98736)
-
-module.exports = PostgresInterval
-
-function PostgresInterval (raw) {
- if (!(this instanceof PostgresInterval)) {
- return new PostgresInterval(raw)
- }
- extend(this, parse(raw))
-}
-var properties = ['seconds', 'minutes', 'hours', 'days', 'months', 'years']
-PostgresInterval.prototype.toPostgres = function () {
- var filtered = properties.filter(this.hasOwnProperty, this)
-
- // In addition to `properties`, we need to account for fractions of seconds.
- if (this.milliseconds && filtered.indexOf('seconds') < 0) {
- filtered.push('seconds')
- }
-
- if (filtered.length === 0) return '0'
- return filtered
- .map(function (property) {
- var value = this[property] || 0
-
- // Account for fractional part of seconds,
- // remove trailing zeroes.
- if (property === 'seconds' && this.milliseconds) {
- value = (value + this.milliseconds / 1000).toFixed(6).replace(/\.?0+$/, '')
- }
-
- return value + ' ' + property
- }, this)
- .join(' ')
-}
-
-var propertiesISOEquivalent = {
- years: 'Y',
- months: 'M',
- days: 'D',
- hours: 'H',
- minutes: 'M',
- seconds: 'S'
-}
-var dateProperties = ['years', 'months', 'days']
-var timeProperties = ['hours', 'minutes', 'seconds']
-// according to ISO 8601
-PostgresInterval.prototype.toISOString = PostgresInterval.prototype.toISO = function () {
- var datePart = dateProperties
- .map(buildProperty, this)
- .join('')
-
- var timePart = timeProperties
- .map(buildProperty, this)
- .join('')
-
- return 'P' + datePart + 'T' + timePart
-
- function buildProperty (property) {
- var value = this[property] || 0
-
- // Account for fractional part of seconds,
- // remove trailing zeroes.
- if (property === 'seconds' && this.milliseconds) {
- value = (value + this.milliseconds / 1000).toFixed(6).replace(/0+$/, '')
- }
-
- return value + propertiesISOEquivalent[property]
- }
-}
-
-var NUMBER = '([+-]?\\d+)'
-var YEAR = NUMBER + '\\s+years?'
-var MONTH = NUMBER + '\\s+mons?'
-var DAY = NUMBER + '\\s+days?'
-var TIME = '([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?'
-var INTERVAL = new RegExp([YEAR, MONTH, DAY, TIME].map(function (regexString) {
- return '(' + regexString + ')?'
-})
- .join('\\s*'))
-
-// Positions of values in regex match
-var positions = {
- years: 2,
- months: 4,
- days: 6,
- hours: 9,
- minutes: 10,
- seconds: 11,
- milliseconds: 12
-}
-// We can use negative time
-var negatives = ['hours', 'minutes', 'seconds', 'milliseconds']
-
-function parseMilliseconds (fraction) {
- // add omitted zeroes
- var microseconds = fraction + '000000'.slice(fraction.length)
- return parseInt(microseconds, 10) / 1000
-}
-
-function parse (interval) {
- if (!interval) return {}
- var matches = INTERVAL.exec(interval)
- var isNegative = matches[8] === '-'
- return Object.keys(positions)
- .reduce(function (parsed, property) {
- var position = positions[property]
- var value = matches[position]
- // no empty string
- if (!value) return parsed
- // milliseconds are actually microseconds (up to 6 digits)
- // with omitted trailing zeroes.
- value = property === 'milliseconds'
- ? parseMilliseconds(value)
- : parseInt(value, 10)
- // no zeros
- if (!value) return parsed
- if (isNegative && ~negatives.indexOf(property)) {
- value *= -1
- }
- parsed[property] = value
- return parsed
- }, {})
-}
-
-
-/***/ }),
-
-/***/ 47810:
-/***/ ((module) => {
-
-"use strict";
-
-
-if (typeof process === 'undefined' ||
- !process.version ||
- process.version.indexOf('v0.') === 0 ||
- process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
- module.exports = { nextTick: nextTick };
-} else {
- module.exports = process
-}
-
-function nextTick(fn, arg1, arg2, arg3) {
- if (typeof fn !== 'function') {
- throw new TypeError('"callback" argument must be a function');
- }
- var len = arguments.length;
- var args, i;
- switch (len) {
- case 0:
- case 1:
- return process.nextTick(fn);
- case 2:
- return process.nextTick(function afterTickOne() {
- fn.call(null, arg1);
- });
- case 3:
- return process.nextTick(function afterTickTwo() {
- fn.call(null, arg1, arg2);
- });
- case 4:
- return process.nextTick(function afterTickThree() {
- fn.call(null, arg1, arg2, arg3);
- });
- default:
- args = new Array(len - 1);
- i = 0;
- while (i < args.length) {
- args[i++] = arguments[i];
- }
- return process.nextTick(function afterTick() {
- fn.apply(null, args);
- });
- }
-}
-
-
-
-/***/ }),
-
-/***/ 29975:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-/*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */
-
-
-
-var Punycode = __nccwpck_require__(94213);
-
-
-var internals = {};
-
-
-//
-// Read rules from file.
-//
-internals.rules = __nccwpck_require__(2156).map(function (rule) {
-
- return {
- rule: rule,
- suffix: rule.replace(/^(\*\.|\!)/, ''),
- punySuffix: -1,
- wildcard: rule.charAt(0) === '*',
- exception: rule.charAt(0) === '!'
- };
-});
-
-
-//
-// Check is given string ends with `suffix`.
-//
-internals.endsWith = function (str, suffix) {
-
- return str.indexOf(suffix, str.length - suffix.length) !== -1;
-};
-
-
-//
-// Find rule for a given domain.
-//
-internals.findRule = function (domain) {
-
- var punyDomain = Punycode.toASCII(domain);
- return internals.rules.reduce(function (memo, rule) {
-
- if (rule.punySuffix === -1){
- rule.punySuffix = Punycode.toASCII(rule.suffix);
- }
- if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) {
- return memo;
- }
- // This has been commented out as it never seems to run. This is because
- // sub tlds always appear after their parents and we never find a shorter
- // match.
- //if (memo) {
- // var memoSuffix = Punycode.toASCII(memo.suffix);
- // if (memoSuffix.length >= punySuffix.length) {
- // return memo;
- // }
- //}
- return rule;
- }, null);
-};
-
-
-//
-// Error codes and messages.
-//
-exports.errorCodes = {
- DOMAIN_TOO_SHORT: 'Domain name too short.',
- DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.',
- LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.',
- LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.',
- LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.',
- LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.',
- LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.'
-};
-
-
-//
-// Validate domain name and throw if not valid.
-//
-// From wikipedia:
-//
-// Hostnames are composed of series of labels concatenated with dots, as are all
-// domain names. Each label must be between 1 and 63 characters long, and the
-// entire hostname (including the delimiting dots) has a maximum of 255 chars.
-//
-// Allowed chars:
-//
-// * `a-z`
-// * `0-9`
-// * `-` but not as a starting or ending character
-// * `.` as a separator for the textual portions of a domain name
-//
-// * http://en.wikipedia.org/wiki/Domain_name
-// * http://en.wikipedia.org/wiki/Hostname
-//
-internals.validate = function (input) {
-
- // Before we can validate we need to take care of IDNs with unicode chars.
- var ascii = Punycode.toASCII(input);
-
- if (ascii.length < 1) {
- return 'DOMAIN_TOO_SHORT';
- }
- if (ascii.length > 255) {
- return 'DOMAIN_TOO_LONG';
- }
-
- // Check each part's length and allowed chars.
- var labels = ascii.split('.');
- var label;
-
- for (var i = 0; i < labels.length; ++i) {
- label = labels[i];
- if (!label.length) {
- return 'LABEL_TOO_SHORT';
- }
- if (label.length > 63) {
- return 'LABEL_TOO_LONG';
- }
- if (label.charAt(0) === '-') {
- return 'LABEL_STARTS_WITH_DASH';
- }
- if (label.charAt(label.length - 1) === '-') {
- return 'LABEL_ENDS_WITH_DASH';
- }
- if (!/^[a-z0-9\-]+$/.test(label)) {
- return 'LABEL_INVALID_CHARS';
- }
- }
-};
-
-
-//
-// Public API
-//
-
-
-//
-// Parse domain.
-//
-exports.parse = function (input) {
-
- if (typeof input !== 'string') {
- throw new TypeError('Domain name must be a string.');
- }
-
- // Force domain to lowercase.
- var domain = input.slice(0).toLowerCase();
-
- // Handle FQDN.
- // TODO: Simply remove trailing dot?
- if (domain.charAt(domain.length - 1) === '.') {
- domain = domain.slice(0, domain.length - 1);
- }
-
- // Validate and sanitise input.
- var error = internals.validate(domain);
- if (error) {
- return {
- input: input,
- error: {
- message: exports.errorCodes[error],
- code: error
- }
- };
- }
-
- var parsed = {
- input: input,
- tld: null,
- sld: null,
- domain: null,
- subdomain: null,
- listed: false
- };
-
- var domainParts = domain.split('.');
-
- // Non-Internet TLD
- if (domainParts[domainParts.length - 1] === 'local') {
- return parsed;
- }
-
- var handlePunycode = function () {
-
- if (!/xn--/.test(domain)) {
- return parsed;
- }
- if (parsed.domain) {
- parsed.domain = Punycode.toASCII(parsed.domain);
- }
- if (parsed.subdomain) {
- parsed.subdomain = Punycode.toASCII(parsed.subdomain);
- }
- return parsed;
- };
-
- var rule = internals.findRule(domain);
-
- // Unlisted tld.
- if (!rule) {
- if (domainParts.length < 2) {
- return parsed;
- }
- parsed.tld = domainParts.pop();
- parsed.sld = domainParts.pop();
- parsed.domain = [parsed.sld, parsed.tld].join('.');
- if (domainParts.length) {
- parsed.subdomain = domainParts.pop();
- }
- return handlePunycode();
- }
-
- // At this point we know the public suffix is listed.
- parsed.listed = true;
-
- var tldParts = rule.suffix.split('.');
- var privateParts = domainParts.slice(0, domainParts.length - tldParts.length);
-
- if (rule.exception) {
- privateParts.push(tldParts.shift());
- }
-
- parsed.tld = tldParts.join('.');
-
- if (!privateParts.length) {
- return handlePunycode();
- }
-
- if (rule.wildcard) {
- tldParts.unshift(privateParts.pop());
- parsed.tld = tldParts.join('.');
- }
-
- if (!privateParts.length) {
- return handlePunycode();
- }
-
- parsed.sld = privateParts.pop();
- parsed.domain = [parsed.sld, parsed.tld].join('.');
-
- if (privateParts.length) {
- parsed.subdomain = privateParts.join('.');
- }
-
- return handlePunycode();
-};
-
-
-//
-// Get domain.
-//
-exports.get = function (domain) {
-
- if (!domain) {
- return null;
- }
- return exports.parse(domain).domain || null;
-};
-
-
-//
-// Check whether domain belongs to a known public suffix.
-//
-exports.isValid = function (domain) {
-
- var parsed = exports.parse(domain);
- return Boolean(parsed.domain && parsed.listed);
-};
-
-
-/***/ }),
-
-/***/ 74907:
-/***/ ((module) => {
-
-"use strict";
-
-
-var replace = String.prototype.replace;
-var percentTwenties = /%20/g;
-
-module.exports = {
- 'default': 'RFC3986',
- formatters: {
- RFC1738: function (value) {
- return replace.call(value, percentTwenties, '+');
- },
- RFC3986: function (value) {
- return value;
- }
- },
- RFC1738: 'RFC1738',
- RFC3986: 'RFC3986'
-};
-
-
-/***/ }),
-
-/***/ 22760:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var stringify = __nccwpck_require__(79954);
-var parse = __nccwpck_require__(33912);
-var formats = __nccwpck_require__(74907);
-
-module.exports = {
- formats: formats,
- parse: parse,
- stringify: stringify
-};
-
-
-/***/ }),
-
-/***/ 33912:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var utils = __nccwpck_require__(72360);
-
-var has = Object.prototype.hasOwnProperty;
-
-var defaults = {
- allowDots: false,
- allowPrototypes: false,
- arrayLimit: 20,
- decoder: utils.decode,
- delimiter: '&',
- depth: 5,
- parameterLimit: 1000,
- plainObjects: false,
- strictNullHandling: false
-};
-
-var parseValues = function parseQueryStringValues(str, options) {
- var obj = {};
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
- var parts = cleanStr.split(options.delimiter, limit);
-
- for (var i = 0; i < parts.length; ++i) {
- var part = parts[i];
-
- var bracketEqualsPos = part.indexOf(']=');
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
-
- var key, val;
- if (pos === -1) {
- key = options.decoder(part, defaults.decoder);
- val = options.strictNullHandling ? null : '';
- } else {
- key = options.decoder(part.slice(0, pos), defaults.decoder);
- val = options.decoder(part.slice(pos + 1), defaults.decoder);
- }
- if (has.call(obj, key)) {
- obj[key] = [].concat(obj[key]).concat(val);
- } else {
- obj[key] = val;
- }
- }
-
- return obj;
-};
-
-var parseObject = function (chain, val, options) {
- var leaf = val;
-
- for (var i = chain.length - 1; i >= 0; --i) {
- var obj;
- var root = chain[i];
-
- if (root === '[]') {
- obj = [];
- obj = obj.concat(leaf);
- } else {
- obj = options.plainObjects ? Object.create(null) : {};
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
- var index = parseInt(cleanRoot, 10);
- if (
- !isNaN(index)
- && root !== cleanRoot
- && String(index) === cleanRoot
- && index >= 0
- && (options.parseArrays && index <= options.arrayLimit)
- ) {
- obj = [];
- obj[index] = leaf;
- } else {
- obj[cleanRoot] = leaf;
- }
- }
-
- leaf = obj;
- }
-
- return leaf;
-};
-
-var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
- if (!givenKey) {
- return;
- }
-
- // Transform dot notation to bracket notation
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
-
- // The regex chunks
-
- var brackets = /(\[[^[\]]*])/;
- var child = /(\[[^[\]]*])/g;
-
- // Get the parent
-
- var segment = brackets.exec(key);
- var parent = segment ? key.slice(0, segment.index) : key;
-
- // Stash the parent if it exists
-
- var keys = [];
- if (parent) {
- // If we aren't using plain objects, optionally prefix keys
- // that would overwrite object prototype properties
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
- if (!options.allowPrototypes) {
- return;
- }
- }
-
- keys.push(parent);
- }
-
- // Loop through children appending to the array until we hit depth
-
- var i = 0;
- while ((segment = child.exec(key)) !== null && i < options.depth) {
- i += 1;
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
- if (!options.allowPrototypes) {
- return;
- }
- }
- keys.push(segment[1]);
- }
-
- // If there's a remainder, just add whatever is left
-
- if (segment) {
- keys.push('[' + key.slice(segment.index) + ']');
- }
-
- return parseObject(keys, val, options);
-};
-
-module.exports = function (str, opts) {
- var options = opts ? utils.assign({}, opts) : {};
-
- if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
- throw new TypeError('Decoder has to be a function.');
- }
-
- options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
- options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
- options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
- options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
- options.parseArrays = options.parseArrays !== false;
- options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
- options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
- options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
- options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
- options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
- options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
-
- if (str === '' || str === null || typeof str === 'undefined') {
- return options.plainObjects ? Object.create(null) : {};
- }
-
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
- var obj = options.plainObjects ? Object.create(null) : {};
-
- // Iterate over the keys and setup the new object
-
- var keys = Object.keys(tempObj);
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
- var newObj = parseKeys(key, tempObj[key], options);
- obj = utils.merge(obj, newObj, options);
- }
-
- return utils.compact(obj);
-};
-
-
-/***/ }),
-
-/***/ 79954:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var utils = __nccwpck_require__(72360);
-var formats = __nccwpck_require__(74907);
-
-var arrayPrefixGenerators = {
- brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
- return prefix + '[]';
- },
- indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
- return prefix + '[' + key + ']';
- },
- repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
- return prefix;
- }
-};
-
-var toISO = Date.prototype.toISOString;
-
-var defaults = {
- delimiter: '&',
- encode: true,
- encoder: utils.encode,
- encodeValuesOnly: false,
- serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
- return toISO.call(date);
- },
- skipNulls: false,
- strictNullHandling: false
-};
-
-var stringify = function stringify( // eslint-disable-line func-name-matching
- object,
- prefix,
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encoder,
- filter,
- sort,
- allowDots,
- serializeDate,
- formatter,
- encodeValuesOnly
-) {
- var obj = object;
- if (typeof filter === 'function') {
- obj = filter(prefix, obj);
- } else if (obj instanceof Date) {
- obj = serializeDate(obj);
- } else if (obj === null) {
- if (strictNullHandling) {
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
- }
-
- obj = '';
- }
-
- if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
- if (encoder) {
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
- }
- return [formatter(prefix) + '=' + formatter(String(obj))];
- }
-
- var values = [];
-
- if (typeof obj === 'undefined') {
- return values;
- }
-
- var objKeys;
- if (Array.isArray(filter)) {
- objKeys = filter;
- } else {
- var keys = Object.keys(obj);
- objKeys = sort ? keys.sort(sort) : keys;
- }
-
- for (var i = 0; i < objKeys.length; ++i) {
- var key = objKeys[i];
-
- if (skipNulls && obj[key] === null) {
- continue;
- }
-
- if (Array.isArray(obj)) {
- values = values.concat(stringify(
- obj[key],
- generateArrayPrefix(prefix, key),
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encoder,
- filter,
- sort,
- allowDots,
- serializeDate,
- formatter,
- encodeValuesOnly
- ));
- } else {
- values = values.concat(stringify(
- obj[key],
- prefix + (allowDots ? '.' + key : '[' + key + ']'),
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encoder,
- filter,
- sort,
- allowDots,
- serializeDate,
- formatter,
- encodeValuesOnly
- ));
- }
- }
-
- return values;
-};
-
-module.exports = function (object, opts) {
- var obj = object;
- var options = opts ? utils.assign({}, opts) : {};
-
- if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
- throw new TypeError('Encoder has to be a function.');
- }
-
- var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
- var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
- var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
- var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
- var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
- var sort = typeof options.sort === 'function' ? options.sort : null;
- var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
- var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
- var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
- if (typeof options.format === 'undefined') {
- options.format = formats['default'];
- } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
- throw new TypeError('Unknown format option provided.');
- }
- var formatter = formats.formatters[options.format];
- var objKeys;
- var filter;
-
- if (typeof options.filter === 'function') {
- filter = options.filter;
- obj = filter('', obj);
- } else if (Array.isArray(options.filter)) {
- filter = options.filter;
- objKeys = filter;
- }
-
- var keys = [];
-
- if (typeof obj !== 'object' || obj === null) {
- return '';
- }
-
- var arrayFormat;
- if (options.arrayFormat in arrayPrefixGenerators) {
- arrayFormat = options.arrayFormat;
- } else if ('indices' in options) {
- arrayFormat = options.indices ? 'indices' : 'repeat';
- } else {
- arrayFormat = 'indices';
- }
-
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
-
- if (!objKeys) {
- objKeys = Object.keys(obj);
- }
-
- if (sort) {
- objKeys.sort(sort);
- }
-
- for (var i = 0; i < objKeys.length; ++i) {
- var key = objKeys[i];
-
- if (skipNulls && obj[key] === null) {
- continue;
- }
-
- keys = keys.concat(stringify(
- obj[key],
- key,
- generateArrayPrefix,
- strictNullHandling,
- skipNulls,
- encode ? encoder : null,
- filter,
- sort,
- allowDots,
- serializeDate,
- formatter,
- encodeValuesOnly
- ));
- }
-
- var joined = keys.join(delimiter);
- var prefix = options.addQueryPrefix === true ? '?' : '';
-
- return joined.length > 0 ? prefix + joined : '';
-};
-
-
-/***/ }),
-
-/***/ 72360:
-/***/ ((module) => {
-
-"use strict";
-
-
-var has = Object.prototype.hasOwnProperty;
-
-var hexTable = (function () {
- var array = [];
- for (var i = 0; i < 256; ++i) {
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
- }
-
- return array;
-}());
-
-var compactQueue = function compactQueue(queue) {
- var obj;
-
- while (queue.length) {
- var item = queue.pop();
- obj = item.obj[item.prop];
-
- if (Array.isArray(obj)) {
- var compacted = [];
-
- for (var j = 0; j < obj.length; ++j) {
- if (typeof obj[j] !== 'undefined') {
- compacted.push(obj[j]);
- }
- }
-
- item.obj[item.prop] = compacted;
- }
- }
-
- return obj;
-};
-
-var arrayToObject = function arrayToObject(source, options) {
- var obj = options && options.plainObjects ? Object.create(null) : {};
- for (var i = 0; i < source.length; ++i) {
- if (typeof source[i] !== 'undefined') {
- obj[i] = source[i];
- }
- }
-
- return obj;
-};
-
-var merge = function merge(target, source, options) {
- if (!source) {
- return target;
- }
-
- if (typeof source !== 'object') {
- if (Array.isArray(target)) {
- target.push(source);
- } else if (typeof target === 'object') {
- if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
- target[source] = true;
- }
- } else {
- return [target, source];
- }
-
- return target;
- }
-
- if (typeof target !== 'object') {
- return [target].concat(source);
- }
-
- var mergeTarget = target;
- if (Array.isArray(target) && !Array.isArray(source)) {
- mergeTarget = arrayToObject(target, options);
- }
-
- if (Array.isArray(target) && Array.isArray(source)) {
- source.forEach(function (item, i) {
- if (has.call(target, i)) {
- if (target[i] && typeof target[i] === 'object') {
- target[i] = merge(target[i], item, options);
- } else {
- target.push(item);
- }
- } else {
- target[i] = item;
- }
- });
- return target;
- }
-
- return Object.keys(source).reduce(function (acc, key) {
- var value = source[key];
-
- if (has.call(acc, key)) {
- acc[key] = merge(acc[key], value, options);
- } else {
- acc[key] = value;
- }
- return acc;
- }, mergeTarget);
-};
-
-var assign = function assignSingleSource(target, source) {
- return Object.keys(source).reduce(function (acc, key) {
- acc[key] = source[key];
- return acc;
- }, target);
-};
-
-var decode = function (str) {
- try {
- return decodeURIComponent(str.replace(/\+/g, ' '));
- } catch (e) {
- return str;
- }
-};
-
-var encode = function encode(str) {
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
- // It has been adapted here for stricter adherence to RFC 3986
- if (str.length === 0) {
- return str;
- }
-
- var string = typeof str === 'string' ? str : String(str);
-
- var out = '';
- for (var i = 0; i < string.length; ++i) {
- var c = string.charCodeAt(i);
-
- if (
- c === 0x2D // -
- || c === 0x2E // .
- || c === 0x5F // _
- || c === 0x7E // ~
- || (c >= 0x30 && c <= 0x39) // 0-9
- || (c >= 0x41 && c <= 0x5A) // a-z
- || (c >= 0x61 && c <= 0x7A) // A-Z
- ) {
- out += string.charAt(i);
- continue;
- }
-
- if (c < 0x80) {
- out = out + hexTable[c];
- continue;
- }
-
- if (c < 0x800) {
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
- continue;
- }
-
- if (c < 0xD800 || c >= 0xE000) {
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
- continue;
- }
-
- i += 1;
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
- out += hexTable[0xF0 | (c >> 18)]
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
- + hexTable[0x80 | (c & 0x3F)];
- }
-
- return out;
-};
-
-var compact = function compact(value) {
- var queue = [{ obj: { o: value }, prop: 'o' }];
- var refs = [];
-
- for (var i = 0; i < queue.length; ++i) {
- var item = queue[i];
- var obj = item.obj[item.prop];
-
- var keys = Object.keys(obj);
- for (var j = 0; j < keys.length; ++j) {
- var key = keys[j];
- var val = obj[key];
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
- queue.push({ obj: obj, prop: key });
- refs.push(val);
- }
- }
- }
-
- return compactQueue(queue);
-};
-
-var isRegExp = function isRegExp(obj) {
- return Object.prototype.toString.call(obj) === '[object RegExp]';
-};
-
-var isBuffer = function isBuffer(obj) {
- if (obj === null || typeof obj === 'undefined') {
- return false;
- }
-
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
-};
-
-module.exports = {
- arrayToObject: arrayToObject,
- assign: assign,
- compact: compact,
- decode: decode,
- encode: encode,
- isBuffer: isBuffer,
- isRegExp: isRegExp,
- merge: merge
-};
-
-
-/***/ }),
-
-/***/ 41359:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a duplex stream is just a stream that is both readable and writable.
-// Since JS doesn't have multiple prototypal inheritance, this class
-// prototypally inherits from Readable, and then parasitically from
-// Writable.
-
-
-
-/**/
-
-var pna = __nccwpck_require__(47810);
-/**/
-
-/**/
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- keys.push(key);
- }return keys;
-};
-/**/
-
-module.exports = Duplex;
-
-/**/
-var util = Object.create(__nccwpck_require__(95898));
-util.inherits = __nccwpck_require__(44124);
-/**/
-
-var Readable = __nccwpck_require__(51433);
-var Writable = __nccwpck_require__(26993);
-
-util.inherits(Duplex, Readable);
-
-{
- // avoid scope creep, the keys array can then be collected
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
- }
-}
-
-function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
-
- Readable.call(this, options);
- Writable.call(this, options);
-
- if (options && options.readable === false) this.readable = false;
-
- if (options && options.writable === false) this.writable = false;
-
- this.allowHalfOpen = true;
- if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
-
- this.once('end', onend);
-}
-
-Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._writableState.highWaterMark;
- }
-});
-
-// the no-half-open enforcer
-function onend() {
- // if we allow half-open state, or if the writable side ended,
- // then we're ok.
- if (this.allowHalfOpen || this._writableState.ended) return;
-
- // no more data can be written.
- // But allow more writes to happen in this tick.
- pna.nextTick(onEndNT, this);
-}
-
-function onEndNT(self) {
- self.end();
-}
-
-Object.defineProperty(Duplex.prototype, 'destroyed', {
- get: function () {
- if (this._readableState === undefined || this._writableState === undefined) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (this._readableState === undefined || this._writableState === undefined) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
- }
-});
-
-Duplex.prototype._destroy = function (err, cb) {
- this.push(null);
- this.end();
-
- pna.nextTick(cb, err);
-};
-
-/***/ }),
-
-/***/ 81542:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a passthrough stream.
-// basically just the most minimal sort of Transform stream.
-// Every written chunk gets output as-is.
-
-
-
-module.exports = PassThrough;
-
-var Transform = __nccwpck_require__(34415);
-
-/**/
-var util = Object.create(__nccwpck_require__(95898));
-util.inherits = __nccwpck_require__(44124);
-/**/
-
-util.inherits(PassThrough, Transform);
-
-function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
-
- Transform.call(this, options);
-}
-
-PassThrough.prototype._transform = function (chunk, encoding, cb) {
- cb(null, chunk);
-};
-
-/***/ }),
-
-/***/ 51433:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
-/**/
-
-var pna = __nccwpck_require__(47810);
-/**/
-
-module.exports = Readable;
-
-/**/
-var isArray = __nccwpck_require__(20893);
-/**/
-
-/**/
-var Duplex;
-/**/
-
-Readable.ReadableState = ReadableState;
-
-/**/
-var EE = __nccwpck_require__(28614).EventEmitter;
-
-var EElistenerCount = function (emitter, type) {
- return emitter.listeners(type).length;
-};
-/**/
-
-/**/
-var Stream = __nccwpck_require__(62387);
-/**/
-
-/**/
-
-var Buffer = __nccwpck_require__(21867).Buffer;
-var OurUint8Array = global.Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-
-/**/
-
-/**/
-var util = Object.create(__nccwpck_require__(95898));
-util.inherits = __nccwpck_require__(44124);
-/**/
-
-/**/
-var debugUtil = __nccwpck_require__(31669);
-var debug = void 0;
-if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
-} else {
- debug = function () {};
-}
-/**/
-
-var BufferList = __nccwpck_require__(27053);
-var destroyImpl = __nccwpck_require__(97049);
-var StringDecoder;
-
-util.inherits(Readable, Stream);
-
-var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
-
-function prependListener(emitter, event, fn) {
- // Sadly this is not cacheable as some libraries bundle their own
- // event emitter implementation with them.
- if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
-
- // This is a hack to make sure that our error handler is attached before any
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
-}
-
-function ReadableState(options, stream) {
- Duplex = Duplex || __nccwpck_require__(41359);
-
- options = options || {};
-
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- var isDuplex = stream instanceof Duplex;
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
-
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
-
- // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- var hwm = options.highWaterMark;
- var readableHwm = options.readableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
-
- if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
-
- // cast to ints.
- this.highWaterMark = Math.floor(this.highWaterMark);
-
- // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
-
- // a flag to be able to tell if the event 'readable'/'data' is emitted
- // immediately, or on a later tick. We set this to true at first, because
- // any actions that shouldn't happen until "later" should generally also
- // not happen before the first read call.
- this.sync = true;
-
- // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
-
- // has it been destroyed
- this.destroyed = false;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0;
-
- // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
-
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder) StringDecoder = __nccwpck_require__(94841)/* .StringDecoder */ .s;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
-}
-
-function Readable(options) {
- Duplex = Duplex || __nccwpck_require__(41359);
-
- if (!(this instanceof Readable)) return new Readable(options);
-
- this._readableState = new ReadableState(options, this);
-
- // legacy
- this.readable = true;
-
- if (options) {
- if (typeof options.read === 'function') this._read = options.read;
-
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- }
-
- Stream.call(this);
-}
-
-Object.defineProperty(Readable.prototype, 'destroyed', {
- get: function () {
- if (this._readableState === undefined) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._readableState) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- }
-});
-
-Readable.prototype.destroy = destroyImpl.destroy;
-Readable.prototype._undestroy = destroyImpl.undestroy;
-Readable.prototype._destroy = function (err, cb) {
- this.push(null);
- cb(err);
-};
-
-// Manually shove something into the read() buffer.
-// This returns true if the highWaterMark has not been hit yet,
-// similar to how Writable.write() returns true if you should
-// write() some more.
-Readable.prototype.push = function (chunk, encoding) {
- var state = this._readableState;
- var skipChunkCheck;
-
- if (!state.objectMode) {
- if (typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = '';
- }
- skipChunkCheck = true;
- }
- } else {
- skipChunkCheck = true;
- }
-
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
-};
-
-// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function (chunk) {
- return readableAddChunk(this, chunk, null, true, false);
-};
-
-function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- var state = stream._readableState;
- if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit('error', er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
-
- if (addToFront) {
- if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- stream.emit('error', new Error('stream.push() after EOF'));
- } else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
- }
- } else if (!addToFront) {
- state.reading = false;
- }
- }
-
- return needMoreData(state);
-}
-
-function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- stream.emit('data', chunk);
- stream.read(0);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
-
- if (state.needReadable) emitReadable(stream);
- }
- maybeReadMore(stream, state);
-}
-
-function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- return er;
-}
-
-// if it's past the high water mark, we can push in some more.
-// Also, if we have no data yet, we can stand some
-// more bytes. This is to work around cases where hwm=0,
-// such as the repl. Also, if the push() triggered a
-// readable event, and the user called read(largeNumber) such that
-// needReadable was set, then we ought to push more, so that another
-// 'readable' event will be triggered.
-function needMoreData(state) {
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
-}
-
-Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
-};
-
-// backwards compatibility.
-Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = __nccwpck_require__(94841)/* .StringDecoder */ .s;
- this._readableState.decoder = new StringDecoder(enc);
- this._readableState.encoding = enc;
- return this;
-};
-
-// Don't raise the hwm > 8MB
-var MAX_HWM = 0x800000;
-function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
-}
-
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- }
- // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n;
- // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
-}
-
-// you can override either this method, or the async _read(n) below.
-Readable.prototype.read = function (n) {
- debug('read', n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
-
- if (n !== 0) state.emittedReadable = false;
-
- // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
- return null;
- }
-
- n = howMuchToRead(n, state);
-
- // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
- return null;
- }
-
- // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
-
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
- debug('need readable', doRead);
-
- // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- }
-
- // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading) {
- doRead = false;
- debug('reading or ended', doRead);
- } else if (doRead) {
- debug('do read');
- state.reading = true;
- state.sync = true;
- // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true;
- // call internal read method
- this._read(state.highWaterMark);
- state.sync = false;
- // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
- }
-
- var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
-
- if (ret === null) {
- state.needReadable = true;
- n = 0;
- } else {
- state.length -= n;
- }
-
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true;
-
- // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
-
- if (ret !== null) this.emit('data', ret);
-
- return ret;
-};
-
-function onEofChunk(stream, state) {
- if (state.ended) return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
-
- // emit 'readable' now to make sure it gets picked up.
- emitReadable(stream);
-}
-
-// Don't emit readable right away in sync mode, because this can trigger
-// another read() call => stack overflow. This way, it might trigger
-// a nextTick recursion warning, but that's not so bad.
-function emitReadable(stream) {
- var state = stream._readableState;
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
- }
-}
-
-function emitReadable_(stream) {
- debug('emit readable');
- stream.emit('readable');
- flow(stream);
-}
-
-// at this point, the user has presumably seen the 'readable' event,
-// and called read() to consume some data. that may have triggered
-// in turn another _read(n) call, in which case reading = true if
-// it's in progress.
-// However, if we're not ended, or reading, and the length < hwm,
-// then go ahead and try to read some more preemptively.
-function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- pna.nextTick(maybeReadMore_, stream, state);
- }
-}
-
-function maybeReadMore_(stream, state) {
- var len = state.length;
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
- debug('maybeReadMore read 0');
- stream.read(0);
- if (len === state.length)
- // didn't get any data, stop spinning.
- break;else len = state.length;
- }
- state.readingMore = false;
-}
-
-// abstract method. to be overridden in specific implementation classes.
-// call cb(er, data) where data is <= n in length.
-// for virtual (non-string, non-buffer) streams, "length" is somewhat
-// arbitrary, and perhaps not very meaningful.
-Readable.prototype._read = function (n) {
- this.emit('error', new Error('_read() is not implemented'));
-};
-
-Readable.prototype.pipe = function (dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
-
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
-
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
-
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
-
- dest.on('unpipe', onunpipe);
- function onunpipe(readable, unpipeInfo) {
- debug('onunpipe');
- if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
- }
- }
-
- function onend() {
- debug('onend');
- dest.end();
- }
-
- // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
-
- var cleanedUp = false;
- function cleanup() {
- debug('cleanup');
- // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', unpipe);
- src.removeListener('data', ondata);
-
- cleanedUp = true;
-
- // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
- }
-
- // If the user pushes more data while we're writing to dest then we'll end up
- // in ondata again. However, we only want to increase awaitDrain once because
- // dest will only emit one 'drain' event for the multiple writes.
- // => Introduce a guard on increasing awaitDrain.
- var increasedAwaitDrain = false;
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- increasedAwaitDrain = false;
- var ret = dest.write(chunk);
- if (false === ret && !increasedAwaitDrain) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
- increasedAwaitDrain = true;
- }
- src.pause();
- }
- }
-
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
- }
-
- // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror);
-
- // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
-
- function unpipe() {
- debug('unpipe');
- src.unpipe(dest);
- }
-
- // tell the dest that it's being piped to
- dest.emit('pipe', src);
-
- // start the flow if it hasn't been started already.
- if (!state.flowing) {
- debug('pipe resume');
- src.resume();
- }
-
- return dest;
-};
-
-function pipeOnDrain(src) {
- return function () {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
-}
-
-Readable.prototype.unpipe = function (dest) {
- var state = this._readableState;
- var unpipeInfo = { hasUnpiped: false };
-
- // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this;
-
- // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
-
- if (!dest) dest = state.pipes;
-
- // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest) dest.emit('unpipe', this, unpipeInfo);
- return this;
- }
-
- // slow case. multiple pipe destinations.
-
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
-
- for (var i = 0; i < len; i++) {
- dests[i].emit('unpipe', this, unpipeInfo);
- }return this;
- }
-
- // try to find the right one.
- var index = indexOf(state.pipes, dest);
- if (index === -1) return this;
-
- state.pipes.splice(index, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
-
- dest.emit('unpipe', this, unpipeInfo);
-
- return this;
-};
-
-// set up data events if they are asked for
-// Ensure readable listeners eventually get something
-Readable.prototype.on = function (ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
-
- if (ev === 'data') {
- // Start flowing on next tick if stream isn't explicitly paused
- if (this._readableState.flowing !== false) this.resume();
- } else if (ev === 'readable') {
- var state = this._readableState;
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.emittedReadable = false;
- if (!state.reading) {
- pna.nextTick(nReadingNextTick, this);
- } else if (state.length) {
- emitReadable(this);
- }
- }
- }
-
- return res;
-};
-Readable.prototype.addListener = Readable.prototype.on;
-
-function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
-}
-
-// pause() and resume() are remnants of the legacy readable stream API
-// If the user uses them, then switch into old mode.
-Readable.prototype.resume = function () {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume');
- state.flowing = true;
- resume(this, state);
- }
- return this;
-};
-
-function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- pna.nextTick(resume_, stream, state);
- }
-}
-
-function resume_(stream, state) {
- if (!state.reading) {
- debug('resume read 0');
- stream.read(0);
- }
-
- state.resumeScheduled = false;
- state.awaitDrain = 0;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
-}
-
-Readable.prototype.pause = function () {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (false !== this._readableState.flowing) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- return this;
-};
-
-function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null) {}
-}
-
-// wrap an old-style stream as the async data source.
-// This is *not* part of the readable stream interface.
-// It is an ugly unfortunate mess of history.
-Readable.prototype.wrap = function (stream) {
- var _this = this;
-
- var state = this._readableState;
- var paused = false;
-
- stream.on('end', function () {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) _this.push(chunk);
- }
-
- _this.push(null);
- });
-
- stream.on('data', function (chunk) {
- debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk);
-
- // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
-
- var ret = _this.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
-
- // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function (method) {
- return function () {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- }
-
- // proxy certain important events.
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- }
-
- // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- this._read = function (n) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
-
- return this;
-};
-
-Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._readableState.highWaterMark;
- }
-});
-
-// exposed for testing purposes only.
-Readable._fromList = fromList;
-
-// Pluck off n bytes from an array of buffers.
-// Length is the combined lengths of all the buffers in the list.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
-
- var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = fromListPartial(n, state.buffer, state.decoder);
- }
-
- return ret;
-}
-
-// Extracts only enough buffered data to satisfy the amount requested.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromListPartial(n, list, hasStrings) {
- var ret;
- if (n < list.head.data.length) {
- // slice is the same for buffers and strings
- ret = list.head.data.slice(0, n);
- list.head.data = list.head.data.slice(n);
- } else if (n === list.head.data.length) {
- // first chunk is a perfect match
- ret = list.shift();
- } else {
- // result spans more than one buffer
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
- }
- return ret;
-}
-
-// Copies a specified amount of characters from the list of buffered data
-// chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBufferString(n, list) {
- var p = list.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
-}
-
-// Copies a specified amount of bytes from the list of buffered data chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBuffer(n, list) {
- var ret = Buffer.allocUnsafe(n);
- var p = list.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
-}
-
-function endReadable(stream) {
- var state = stream._readableState;
-
- // If we get here before consuming all the bytes, then that is a
- // bug in node. Should never happen.
- if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
-
- if (!state.endEmitted) {
- state.ended = true;
- pna.nextTick(endReadableNT, state, stream);
- }
-}
-
-function endReadableNT(state, stream) {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- }
-}
-
-function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
-}
-
-/***/ }),
-
-/***/ 34415:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// a transform stream is a readable/writable stream where you do
-// something with the data. Sometimes it's called a "filter",
-// but that's not a great name for it, since that implies a thing where
-// some bits pass through, and others are simply ignored. (That would
-// be a valid example of a transform, of course.)
-//
-// While the output is causally related to the input, it's not a
-// necessarily symmetric or synchronous transformation. For example,
-// a zlib stream might take multiple plain-text writes(), and then
-// emit a single compressed chunk some time in the future.
-//
-// Here's how this works:
-//
-// The Transform stream has all the aspects of the readable and writable
-// stream classes. When you write(chunk), that calls _write(chunk,cb)
-// internally, and returns false if there's a lot of pending writes
-// buffered up. When you call read(), that calls _read(n) until
-// there's enough pending readable data buffered up.
-//
-// In a transform stream, the written data is placed in a buffer. When
-// _read(n) is called, it transforms the queued up data, calling the
-// buffered _write cb's as it consumes chunks. If consuming a single
-// written chunk would result in multiple output chunks, then the first
-// outputted bit calls the readcb, and subsequent chunks just go into
-// the read buffer, and will cause it to emit 'readable' if necessary.
-//
-// This way, back-pressure is actually determined by the reading side,
-// since _read has to be called to start processing a new chunk. However,
-// a pathological inflate type of transform can cause excessive buffering
-// here. For example, imagine a stream where every byte of input is
-// interpreted as an integer from 0-255, and then results in that many
-// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
-// 1kb of data being output. In this case, you could write a very small
-// amount of input, and end up with a very large amount of output. In
-// such a pathological inflating mechanism, there'd be no way to tell
-// the system to stop doing the transform. A single 4MB write could
-// cause the system to run out of memory.
-//
-// However, even in such a pathological case, only a single written chunk
-// would be consumed, and then the rest would wait (un-transformed) until
-// the results of the previous transformed chunk were consumed.
-
-
-
-module.exports = Transform;
-
-var Duplex = __nccwpck_require__(41359);
-
-/**/
-var util = Object.create(__nccwpck_require__(95898));
-util.inherits = __nccwpck_require__(44124);
-/**/
-
-util.inherits(Transform, Duplex);
-
-function afterTransform(er, data) {
- var ts = this._transformState;
- ts.transforming = false;
-
- var cb = ts.writecb;
-
- if (!cb) {
- return this.emit('error', new Error('write callback called multiple times'));
- }
-
- ts.writechunk = null;
- ts.writecb = null;
-
- if (data != null) // single equals check for both `null` and `undefined`
- this.push(data);
-
- cb(er);
-
- var rs = this._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
- }
-}
-
-function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
-
- Duplex.call(this, options);
-
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- };
-
- // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true;
-
- // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
-
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
-
- if (typeof options.flush === 'function') this._flush = options.flush;
- }
-
- // When the writable side finishes, then flush out anything remaining.
- this.on('prefinish', prefinish);
-}
-
-function prefinish() {
- var _this = this;
-
- if (typeof this._flush === 'function') {
- this._flush(function (er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
-}
-
-Transform.prototype.push = function (chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
-};
-
-// This is the part where you do stuff!
-// override this function in implementation classes.
-// 'chunk' is an input chunk.
-//
-// Call `push(newChunk)` to pass along transformed output
-// to the readable side. You may call 'push' zero or more times.
-//
-// Call `cb(err)` when you are done with this chunk. If you pass
-// an error, then that'll put the hurt on the whole operation. If you
-// never call cb(), then you'll never get another chunk.
-Transform.prototype._transform = function (chunk, encoding, cb) {
- throw new Error('_transform() is not implemented');
-};
-
-Transform.prototype._write = function (chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
- }
-};
-
-// Doesn't matter what the args are here.
-// _transform does all the work.
-// That we got here means that the readable side wants more data.
-Transform.prototype._read = function (n) {
- var ts = this._transformState;
-
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
-};
-
-Transform.prototype._destroy = function (err, cb) {
- var _this2 = this;
-
- Duplex.prototype._destroy.call(this, err, function (err2) {
- cb(err2);
- _this2.emit('close');
- });
-};
-
-function done(stream, er, data) {
- if (er) return stream.emit('error', er);
-
- if (data != null) // single equals check for both `null` and `undefined`
- stream.push(data);
-
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
-
- if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
-
- return stream.push(null);
-}
-
-/***/ }),
-
-/***/ 26993:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-
-"use strict";
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-// A bit simpler than readable streams.
-// Implement an async ._write(chunk, encoding, cb), and it'll handle all
-// the drain event emission and buffering.
-
-
-
-/**/
-
-var pna = __nccwpck_require__(47810);
-/**/
-
-module.exports = Writable;
-
-/* */
-function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
-}
-
-// It seems a linked list but it is not
-// there will be only 2 of these for each stream
-function CorkedRequest(state) {
- var _this = this;
-
- this.next = null;
- this.entry = null;
- this.finish = function () {
- onCorkedFinish(_this, state);
- };
-}
-/* */
-
-/**/
-var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
-/**/
-
-/**/
-var Duplex;
-/**/
-
-Writable.WritableState = WritableState;
-
-/**/
-var util = Object.create(__nccwpck_require__(95898));
-util.inherits = __nccwpck_require__(44124);
-/**/
-
-/**/
-var internalUtil = {
- deprecate: __nccwpck_require__(65278)
-};
-/**/
-
-/**/
-var Stream = __nccwpck_require__(62387);
-/**/
-
-/**/
-
-var Buffer = __nccwpck_require__(21867).Buffer;
-var OurUint8Array = global.Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-
-/**/
-
-var destroyImpl = __nccwpck_require__(97049);
-
-util.inherits(Writable, Stream);
-
-function nop() {}
-
-function WritableState(options, stream) {
- Duplex = Duplex || __nccwpck_require__(41359);
-
- options = options || {};
-
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- var isDuplex = stream instanceof Duplex;
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
-
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
-
- // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- var hwm = options.highWaterMark;
- var writableHwm = options.writableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
-
- if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
-
- // cast to ints.
- this.highWaterMark = Math.floor(this.highWaterMark);
-
- // if _final has been called
- this.finalCalled = false;
-
- // drain event flag.
- this.needDrain = false;
- // at the start of calling end()
- this.ending = false;
- // when end() has been called, and returned
- this.ended = false;
- // when 'finish' is emitted
- this.finished = false;
-
- // has it been destroyed
- this.destroyed = false;
-
- // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0;
-
- // a flag to see when we're in the middle of a write.
- this.writing = false;
-
- // when true all writes will be buffered until .uncork() call
- this.corked = 0;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false;
-
- // the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
- onwrite(stream, er);
- };
-
- // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null;
-
- // the amount that is being written when _write is called.
- this.writelen = 0;
-
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
-
- // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0;
-
- // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false;
-
- // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false;
-
- // count buffered requests
- this.bufferedRequestCount = 0;
+ _poolDestroy (tedious) {
+ return new shared.Promise((resolve, reject) => {
+ if (!tedious) {
+ resolve()
+ return
+ }
+ debug('connection(%d): destroying', IDS.get(tedious))
- // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
-}
+ if (tedious.closed) {
+ debug('connection(%d): already closed', IDS.get(tedious))
+ resolve()
+ } else {
+ tedious.once('end', () => {
+ debug('connection(%d): destroyed', IDS.get(tedious))
+ resolve()
+ })
-WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
+ tedious.close()
+ }
+ })
}
- return out;
-};
-
-(function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function () {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
- });
- } catch (_) {}
-})();
-
-// Test _writableState for inheritance to account for Duplex streams,
-// whose prototype chain only points to Readable.
-var realHasInstance;
-if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function (object) {
- if (realHasInstance.call(this, object)) return true;
- if (this !== Writable) return false;
-
- return object && object._writableState instanceof WritableState;
- }
- });
-} else {
- realHasInstance = function (object) {
- return object instanceof this;
- };
}
-function Writable(options) {
- Duplex = Duplex || __nccwpck_require__(41359);
-
- // Writable ctor is applied to Duplexes, too.
- // `realHasInstance` is necessary because using plain `instanceof`
- // would return false, as no `_writableState` property is attached.
+module.exports = ConnectionPool
- // Trying to use the custom `instanceof` for Writable here will also break the
- // Node.js LazyTransform implementation, which has a non-trivial getter for
- // `_writableState` that would lead to infinite recursion.
- if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
- return new Writable(options);
- }
- this._writableState = new WritableState(options, this);
+/***/ }),
- // legacy.
- this.writable = true;
+/***/ 37197:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
+'use struct'
- if (typeof options.writev === 'function') this._writev = options.writev;
+const base = __nccwpck_require__(26042)
+const ConnectionPool = __nccwpck_require__(89)
+const Transaction = __nccwpck_require__(41670)
+const Request = __nccwpck_require__(22906)
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
+module.exports = Object.assign({
+ ConnectionPool,
+ Transaction,
+ Request,
+ PreparedStatement: base.PreparedStatement
+}, base.exports)
- if (typeof options.final === 'function') this._final = options.final;
+Object.defineProperty(module.exports, "Promise", ({
+ enumerable: true,
+ get: () => {
+ return base.Promise
+ },
+ set: (value) => {
+ base.Promise = value
}
+}))
- Stream.call(this);
-}
-
-// Otherwise people can pipe Writable streams, which is just wrong.
-Writable.prototype.pipe = function () {
- this.emit('error', new Error('Cannot pipe, not readable'));
-};
+base.driver.name = 'tedious'
+base.driver.ConnectionPool = ConnectionPool
+base.driver.Transaction = Transaction
+base.driver.Request = Request
-function writeAfterEnd(stream, cb) {
- var er = new Error('write after end');
- // TODO: defer error events consistently everywhere, not just the cb
- stream.emit('error', er);
- pna.nextTick(cb, er);
-}
-// Checks that a user-supplied chunk is valid, especially for the particular
-// mode the stream is in. Currently this means that `null` is never accepted
-// and undefined/non-string values are only allowed in object mode.
-function validChunk(stream, state, chunk, cb) {
- var valid = true;
- var er = false;
+/***/ }),
- if (chunk === null) {
- er = new TypeError('May not write null values to stream');
- } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- if (er) {
- stream.emit('error', er);
- pna.nextTick(cb, er);
- valid = false;
- }
- return valid;
-}
+/***/ 22906:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-Writable.prototype.write = function (chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
+"use strict";
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
+const tds = __nccwpck_require__(62459)
+const debug = __nccwpck_require__(38237)('mssql:tedi')
+const BaseRequest = __nccwpck_require__(65225)
+const RequestError = __nccwpck_require__(31296)
+const { IDS, objectHasProperty } = __nccwpck_require__(14178)
+const { TYPES, DECLARATIONS, declare, cast } = __nccwpck_require__(62388)
+const Table = __nccwpck_require__(67417)
+const { PARSERS: UDT } = __nccwpck_require__(33199)
- if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+const JSON_COLUMN_ID = 'JSON_F52E2B61-18A1-11d1-B105-00805F49916B'
+const XML_COLUMN_ID = 'XML_F52E2B61-18A1-11d1-B105-00805F49916B'
- if (typeof cb !== 'function') cb = nop;
+const N_TYPES = {
+ BitN: 0x68,
+ DateTimeN: 0x6F,
+ DecimalN: 0x6A,
+ FloatN: 0x6D,
+ IntN: 0x26,
+ MoneyN: 0x6E,
+ NumericN: 0x6C
+}
- if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+const getTediousType = function (type) {
+ switch (type) {
+ case TYPES.VarChar: return tds.TYPES.VarChar
+ case TYPES.NVarChar: return tds.TYPES.NVarChar
+ case TYPES.Text: return tds.TYPES.Text
+ case TYPES.Int: return tds.TYPES.Int
+ case TYPES.BigInt: return tds.TYPES.BigInt
+ case TYPES.TinyInt: return tds.TYPES.TinyInt
+ case TYPES.SmallInt: return tds.TYPES.SmallInt
+ case TYPES.Bit: return tds.TYPES.Bit
+ case TYPES.Float: return tds.TYPES.Float
+ case TYPES.Decimal: return tds.TYPES.Decimal
+ case TYPES.Numeric: return tds.TYPES.Numeric
+ case TYPES.Real: return tds.TYPES.Real
+ case TYPES.Money: return tds.TYPES.Money
+ case TYPES.SmallMoney: return tds.TYPES.SmallMoney
+ case TYPES.Time: return tds.TYPES.Time
+ case TYPES.Date: return tds.TYPES.Date
+ case TYPES.DateTime: return tds.TYPES.DateTime
+ case TYPES.DateTime2: return tds.TYPES.DateTime2
+ case TYPES.DateTimeOffset: return tds.TYPES.DateTimeOffset
+ case TYPES.SmallDateTime: return tds.TYPES.SmallDateTime
+ case TYPES.UniqueIdentifier: return tds.TYPES.UniqueIdentifier
+ case TYPES.Xml: return tds.TYPES.NVarChar
+ case TYPES.Char: return tds.TYPES.Char
+ case TYPES.NChar: return tds.TYPES.NChar
+ case TYPES.NText: return tds.TYPES.NVarChar
+ case TYPES.Image: return tds.TYPES.Image
+ case TYPES.Binary: return tds.TYPES.Binary
+ case TYPES.VarBinary: return tds.TYPES.VarBinary
+ case TYPES.UDT: case TYPES.Geography: case TYPES.Geometry: return tds.TYPES.UDT
+ case TYPES.TVP: return tds.TYPES.TVP
+ case TYPES.Variant: return tds.TYPES.Variant
+ default: return type
}
+}
- return ret;
-};
-
-Writable.prototype.cork = function () {
- var state = this._writableState;
-
- state.corked++;
-};
-
-Writable.prototype.uncork = function () {
- var state = this._writableState;
-
- if (state.corked) {
- state.corked--;
+const getMssqlType = function (type, length) {
+ if (typeof type !== 'object') return undefined
- if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ switch (type) {
+ case tds.TYPES.Char: return TYPES.Char
+ case tds.TYPES.NChar: return TYPES.NChar
+ case tds.TYPES.VarChar: return TYPES.VarChar
+ case tds.TYPES.NVarChar: return TYPES.NVarChar
+ case tds.TYPES.Text: return TYPES.Text
+ case tds.TYPES.NText: return TYPES.NText
+ case tds.TYPES.Int: return TYPES.Int
+ case tds.TYPES.BigInt: return TYPES.BigInt
+ case tds.TYPES.TinyInt: return TYPES.TinyInt
+ case tds.TYPES.SmallInt: return TYPES.SmallInt
+ case tds.TYPES.Bit: return TYPES.Bit
+ case tds.TYPES.Float: return TYPES.Float
+ case tds.TYPES.Real: return TYPES.Real
+ case tds.TYPES.Money: return TYPES.Money
+ case tds.TYPES.SmallMoney: return TYPES.SmallMoney
+ case tds.TYPES.Numeric: return TYPES.Numeric
+ case tds.TYPES.Decimal: return TYPES.Decimal
+ case tds.TYPES.DateTime: return TYPES.DateTime
+ case tds.TYPES.Time: return TYPES.Time
+ case tds.TYPES.Date: return TYPES.Date
+ case tds.TYPES.DateTime2: return TYPES.DateTime2
+ case tds.TYPES.DateTimeOffset: return TYPES.DateTimeOffset
+ case tds.TYPES.SmallDateTime: return TYPES.SmallDateTime
+ case tds.TYPES.UniqueIdentifier: return TYPES.UniqueIdentifier
+ case tds.TYPES.Image: return TYPES.Image
+ case tds.TYPES.Binary: return TYPES.Binary
+ case tds.TYPES.VarBinary: return TYPES.VarBinary
+ case tds.TYPES.Xml: return TYPES.Xml
+ case tds.TYPES.UDT: return TYPES.UDT
+ case tds.TYPES.TVP: return TYPES.TVP
+ case tds.TYPES.Variant: return TYPES.Variant
+ default:
+ switch (type.id) {
+ case N_TYPES.BitN: return TYPES.Bit
+ case N_TYPES.NumericN: return TYPES.Numeric
+ case N_TYPES.DecimalN: return TYPES.Decimal
+ case N_TYPES.IntN:
+ if (length === 8) return TYPES.BigInt
+ if (length === 4) return TYPES.Int
+ if (length === 2) return TYPES.SmallInt
+ return TYPES.TinyInt
+ case N_TYPES.FloatN:
+ if (length === 8) return TYPES.Float
+ return TYPES.Real
+ case N_TYPES.MoneyN:
+ if (length === 8) return TYPES.Money
+ return TYPES.SmallMoney
+ case N_TYPES.DateTimeN:
+ if (length === 8) return TYPES.DateTime
+ return TYPES.SmallDateTime
+ }
}
-};
+}
-Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
- this._writableState.defaultEncoding = encoding;
- return this;
-};
+const createColumns = function (metadata, arrayRowMode) {
+ let out = {}
+ if (arrayRowMode) out = []
+ for (let index = 0, length = metadata.length; index < length; index++) {
+ const column = metadata[index]
+ const outColumn = {
+ index,
+ name: column.colName,
+ length: column.dataLength,
+ type: getMssqlType(column.type, column.dataLength),
+ scale: column.scale,
+ precision: column.precision,
+ nullable: !!(column.flags & 0x01),
+ caseSensitive: !!(column.flags & 0x02),
+ identity: !!(column.flags & 0x10),
+ readOnly: !(column.flags & 0x0C)
+ }
-function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
- }
- return chunk;
-}
+ if (column.udtInfo) {
+ outColumn.udt = {
+ name: column.udtInfo.typeName,
+ database: column.udtInfo.dbname,
+ schema: column.udtInfo.owningSchema,
+ assembly: column.udtInfo.assemblyName
+ }
-Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._writableState.highWaterMark;
- }
-});
+ if (DECLARATIONS[column.udtInfo.typeName]) {
+ outColumn.type = DECLARATIONS[column.udtInfo.typeName]
+ }
+ }
-// if we're already writing something, then just put this
-// in the queue, and wait our turn. Otherwise, call _write
-// If we return false, then we need a drain event, so set that flag.
-function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = 'buffer';
- chunk = newChunk;
+ if (arrayRowMode) {
+ out.push(outColumn)
+ } else {
+ out[column.colName] = outColumn
}
}
- var len = state.objectMode ? 1 : chunk.length;
-
- state.length += len;
- var ret = state.length < state.highWaterMark;
- // we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
+ return out
+}
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk: chunk,
- encoding: encoding,
- isBuf: isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
+const valueCorrection = function (value, metadata) {
+ if ((metadata.type === tds.TYPES.UDT) && (value != null)) {
+ if (UDT[metadata.udtInfo.typeName]) {
+ return UDT[metadata.udtInfo.typeName](value)
} else {
- state.bufferedRequest = state.lastBufferedRequest;
+ return value
}
- state.bufferedRequestCount += 1;
} else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
+ return value
}
-
- return ret;
}
-function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
-}
+const parameterCorrection = function (value) {
+ if (value instanceof Table) {
+ const tvp = {
+ name: value.name,
+ schema: value.schema,
+ columns: [],
+ rows: value.rows
+ }
-function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
+ for (const col of value.columns) {
+ tvp.columns.push({
+ name: col.name,
+ type: getTediousType(col.type),
+ length: col.length,
+ scale: col.scale,
+ precision: col.precision
+ })
+ }
- if (sync) {
- // defer the callback if we are being called synchronously
- // to avoid piling up things on the stack
- pna.nextTick(cb, er);
- // this can emit finish, and it will always happen
- // after error
- pna.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
+ return tvp
} else {
- // the caller expect this to happen before if
- // it is async
- cb(er);
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
- // this can emit finish, but finish must
- // always follow error
- finishMaybe(stream, state);
+ return value
}
}
-function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
-}
-
-function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
+class Request extends BaseRequest {
+ /*
+ Execute specified sql batch.
+ */
- onwriteStateUpdate(state);
+ _batch (batch, callback) {
+ this._isBatch = true
+ this._query(batch, callback)
+ }
- if (er) onwriteError(stream, state, sync, er, cb);else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state);
+ /*
+ Bulk load.
+ */
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
+ _bulk (table, options, callback) {
+ super._bulk(table, options, err => {
+ if (err) return callback(err)
- if (sync) {
- /**/
- asyncWrite(afterWrite, stream, state, finished, cb);
- /**/
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
-}
+ table._makeBulk()
-function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
-}
+ if (!table.name) {
+ return callback(new RequestError('Table name must be specified for bulk insert.', 'ENAME'))
+ }
-// Must force callback to be called on nextTick, so that we don't
-// emit 'drain' before the write() consumer gets the 'false' return
-// value, and has a chance to attach a 'drain' listener.
-function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
-}
+ if (table.name.charAt(0) === '@') {
+ return callback(new RequestError("You can't use table variables for bulk insert.", 'ENAME'))
+ }
-// if there's something in the buffer waiting, then process it
-function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
+ const errors = []
+ const errorHandlers = {}
+ let hasReturned = false
- if (stream._writev && entry && entry.next) {
- // Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
+ const handleError = (doReturn, connection, info) => {
+ let err = new Error(info.message)
+ err.info = info
+ err = new RequestError(err, 'EREQUEST')
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf) allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
+ if (this.stream) {
+ this.emit('error', err)
+ } else {
+ if (doReturn && !hasReturned) {
+ if (connection) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
+ }
- doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+ this.parent.release(connection)
+ }
- // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
- } else {
- // Slow case, write chunks one-by-one
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
+ hasReturned = true
+ callback(err)
+ }
+ }
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--;
- // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- break;
+ // we must collect errors even in stream mode
+ errors.push(err)
}
- }
- if (entry === null) state.lastBufferedRequest = null;
- }
+ const handleInfo = msg => {
+ this.emit('info', {
+ message: msg.message,
+ number: msg.number,
+ state: msg.state,
+ class: msg.class,
+ lineNumber: msg.lineNumber,
+ serverName: msg.serverName,
+ procName: msg.procName
+ })
+ }
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
-}
+ this.parent.acquire(this, (err, connection) => {
+ if (err) return callback(err)
-Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new Error('_write() is not implemented'));
-};
+ debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
-Writable.prototype._writev = null;
+ if (this.canceled) {
+ debug('request(%d): canceled', IDS.get(this))
+ this.parent.release(connection)
+ return callback(new RequestError('Canceled.', 'ECANCEL'))
+ }
-Writable.prototype.end = function (chunk, encoding, cb) {
- var state = this._writableState;
+ this._cancel = () => {
+ debug('request(%d): cancel', IDS.get(this))
+ connection.cancel()
+ }
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
+ // attach handler to handle multiple error messages
+ connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
+ connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
+ connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+ const done = (err, rowCount) => {
+ // to make sure we handle no-sql errors as well
+ if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
+ err = new RequestError(err, 'EREQUEST')
+ if (this.stream) this.emit('error', err)
+ errors.push(err)
+ }
- // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
+ delete this._cancel
- // ignore unnecessary end() calls.
- if (!state.ending && !state.finished) endWritable(this, state, cb);
-};
+ let error
+ if (errors.length && !this.stream) {
+ error = errors.pop()
+ error.precedingErrors = errors
+ }
-function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
-}
-function callFinal(stream, state) {
- stream._final(function (err) {
- state.pendingcb--;
- if (err) {
- stream.emit('error', err);
- }
- state.prefinished = true;
- stream.emit('prefinish');
- finishMaybe(stream, state);
- });
-}
-function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === 'function') {
- state.pendingcb++;
- state.finalCalled = true;
- pna.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit('prefinish');
- }
- }
-}
+ if (!hasReturned) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
+ }
-function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- prefinish(stream, state);
- if (state.pendingcb === 0) {
- state.finished = true;
- stream.emit('finish');
- }
- }
- return need;
-}
+ this.parent.release(connection)
+ hasReturned = true
-function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
- }
- state.ended = true;
- stream.writable = false;
-}
+ if (this.stream) {
+ callback(null, rowCount)
+ } else {
+ callback(error, rowCount)
+ }
+ }
+ }
-function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
- if (state.corkedRequestsFree) {
- state.corkedRequestsFree.next = corkReq;
- } else {
- state.corkedRequestsFree = corkReq;
- }
-}
+ const bulk = connection.newBulkLoad(table.path, options, done)
-Object.defineProperty(Writable.prototype, 'destroyed', {
- get: function () {
- if (this._writableState === undefined) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._writableState) {
- return;
- }
+ for (const col of table.columns) {
+ bulk.addColumn(col.name, getTediousType(col.type), { nullable: col.nullable, length: col.length, scale: col.scale, precision: col.precision })
+ }
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._writableState.destroyed = value;
- }
-});
+ for (const row of table.rows) {
+ bulk.addRow(row)
+ }
-Writable.prototype.destroy = destroyImpl.destroy;
-Writable.prototype._undestroy = destroyImpl.undestroy;
-Writable.prototype._destroy = function (err, cb) {
- this.end();
- cb(err);
-};
+ if (table.create) {
+ const objectid = table.temporary ? `tempdb..[${table.name}]` : table.path
+ const req = new tds.Request(`if object_id('${objectid.replace(/'/g, '\'\'')}') is null ${table.declare()}`, err => {
+ if (err) return done(err)
-/***/ }),
+ connection.execBulkLoad(bulk)
+ })
+ this._setCurrentRequest(req)
-/***/ 27053:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ connection.execSqlBatch(req)
+ } else {
+ connection.execBulkLoad(bulk)
+ }
+ })
+ })
+ }
-"use strict";
+ /*
+ Execute specified sql command.
+ */
+ _query (command, callback) {
+ super._query(command, err => {
+ if (err) return callback(err)
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+ const recordsets = []
+ const recordsetcolumns = []
+ const errors = []
+ const errorHandlers = {}
+ const output = {}
+ const rowsAffected = []
-var Buffer = __nccwpck_require__(21867).Buffer;
-var util = __nccwpck_require__(31669);
+ let columns = {}
+ let recordset = []
+ let batchLastRow = null
+ let batchHasOutput = false
+ let isChunkedRecordset = false
+ let chunksBuffer = null
+ let hasReturned = false
-function copyBuffer(src, target, offset) {
- src.copy(target, offset);
-}
+ const handleError = (doReturn, connection, info) => {
+ let err = new Error(info.message)
+ err.info = info
+ err = new RequestError(err, 'EREQUEST')
-module.exports = function () {
- function BufferList() {
- _classCallCheck(this, BufferList);
+ if (this.stream) {
+ this.emit('error', err)
+ } else {
+ if (doReturn && !hasReturned) {
+ if (connection) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
+ }
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
+ this.parent.release(connection)
+ }
- BufferList.prototype.push = function push(v) {
- var entry = { data: v, next: null };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
- };
+ hasReturned = true
+ callback(err)
+ }
+ }
- BufferList.prototype.unshift = function unshift(v) {
- var entry = { data: v, next: this.head };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
- };
+ // we must collect errors even in stream mode
+ errors.push(err)
+ }
- BufferList.prototype.shift = function shift() {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
- };
+ const handleInfo = msg => {
+ this.emit('info', {
+ message: msg.message,
+ number: msg.number,
+ state: msg.state,
+ class: msg.class,
+ lineNumber: msg.lineNumber,
+ serverName: msg.serverName,
+ procName: msg.procName
+ })
+ }
- BufferList.prototype.clear = function clear() {
- this.head = this.tail = null;
- this.length = 0;
- };
+ this.parent.acquire(this, (err, connection, config) => {
+ if (err) return callback(err)
- BufferList.prototype.join = function join(s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }return ret;
- };
+ debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
- BufferList.prototype.concat = function concat(n) {
- if (this.length === 0) return Buffer.alloc(0);
- if (this.length === 1) return this.head.data;
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- };
+ let row
- return BufferList;
-}();
+ if (this.canceled) {
+ debug('request(%d): canceled', IDS.get(this))
+ this.parent.release(connection)
+ return callback(new RequestError('Canceled.', 'ECANCEL'))
+ }
-if (util && util.inspect && util.inspect.custom) {
- module.exports.prototype[util.inspect.custom] = function () {
- var obj = util.inspect({ length: this.length });
- return this.constructor.name + ' ' + obj;
- };
-}
+ this._cancel = () => {
+ debug('request(%d): cancel', IDS.get(this))
+ connection.cancel()
+ }
-/***/ }),
+ // attach handler to handle multiple error messages
+ connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
+ connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
+ connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
-/***/ 97049:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ debug('request(%d): query', IDS.get(this), command)
-"use strict";
+ const req = new tds.Request(command, err => {
+ // to make sure we handle no-sql errors as well
+ if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
+ err = new RequestError(err, 'EREQUEST')
+ if (this.stream) this.emit('error', err)
+ errors.push(err)
+ }
+ // process batch outputs
+ if (batchHasOutput) {
+ if (!this.stream) batchLastRow = recordsets.pop()[0]
-/**/
+ for (const name in batchLastRow) {
+ const value = batchLastRow[name]
+ if (name !== '___return___') {
+ output[name] = value
+ }
+ }
+ }
-var pna = __nccwpck_require__(47810);
-/**/
+ delete this._cancel
-// undocumented cb() API, needed for core, not for public API
-function destroy(err, cb) {
- var _this = this;
+ let error
+ if (errors.length && !this.stream) {
+ error = errors.pop()
+ error.precedingErrors = errors
+ }
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
+ if (!hasReturned) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
+ }
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
- pna.nextTick(emitErrorNT, this, err);
- }
- return this;
- }
+ this.parent.release(connection)
+ hasReturned = true
- // we set destroyed to true before firing error callbacks in order
- // to make it re-entrance safe in case destroy() is called within callbacks
+ if (error) {
+ debug('request(%d): failed', IDS.get(this), error)
+ } else {
+ debug('request(%d): completed', IDS.get(this))
+ }
- if (this._readableState) {
- this._readableState.destroyed = true;
- }
+ if (this.stream) {
+ callback(null, null, output, rowsAffected, recordsetcolumns)
+ } else {
+ callback(error, recordsets, output, rowsAffected, recordsetcolumns)
+ }
+ }
+ })
- // if this is a duplex stream mark the writable part as destroyed as well
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
+ this._setCurrentRequest(req)
- this._destroy(err || null, function (err) {
- if (!cb && err) {
- pna.nextTick(emitErrorNT, _this, err);
- if (_this._writableState) {
- _this._writableState.errorEmitted = true;
- }
- } else if (cb) {
- cb(err);
- }
- });
+ req.on('columnMetadata', metadata => {
+ columns = createColumns(metadata, this.arrayRowMode)
- return this;
-}
+ isChunkedRecordset = false
+ if (metadata.length === 1 && (metadata[0].colName === JSON_COLUMN_ID || metadata[0].colName === XML_COLUMN_ID)) {
+ isChunkedRecordset = true
+ chunksBuffer = []
+ }
-function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
+ if (this.stream) {
+ if (this._isBatch) {
+ // don't stream recordset with output values in batches
+ if (!columns.___return___) {
+ this.emit('recordset', columns)
+ }
+ } else {
+ this.emit('recordset', columns)
+ }
+ }
+ if (this.arrayRowMode) recordsetcolumns.push(columns)
+ })
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
-}
+ const doneHandler = (rowCount, more) => {
+ if (rowCount != null) rowsAffected.push(rowCount)
+ // this function is called even when select only set variables so we should skip adding a new recordset
+ if (Object.keys(columns).length === 0) return
-function emitErrorNT(self, err) {
- self.emit('error', err);
-}
+ if (isChunkedRecordset) {
+ const concatenatedChunks = chunksBuffer.join('')
+ if (columns[JSON_COLUMN_ID] && config.parseJSON === true) {
+ try {
+ if (concatenatedChunks === '') {
+ row = null
+ } else {
+ row = JSON.parse(concatenatedChunks)
+ }
+ } catch (ex) {
+ row = null
+ const ex2 = new RequestError(new Error(`Failed to parse incoming JSON. ${ex.message}`), 'EJSON')
-module.exports = {
- destroy: destroy,
- undestroy: undestroy
-};
+ if (this.stream) this.emit('error', ex2)
-/***/ }),
+ // we must collect errors even in stream mode
+ errors.push(ex2)
+ }
+ } else {
+ row = {}
+ row[Object.keys(columns)[0]] = concatenatedChunks
+ }
-/***/ 62387:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ chunksBuffer = null
-module.exports = __nccwpck_require__(92413);
+ if (this.stream) {
+ this.emit('row', row)
+ } else {
+ recordset.push(row)
+ }
+ }
+ if (!this.stream) {
+ // all rows of current recordset loaded
+ Object.defineProperty(recordset, 'columns', {
+ enumerable: false,
+ configurable: true,
+ value: columns
+ })
-/***/ }),
+ Object.defineProperty(recordset, 'toTable', {
+ enumerable: false,
+ configurable: true,
+ value (name) { return Table.fromRecordset(this, name) }
+ })
-/***/ 51642:
-/***/ ((module, exports, __nccwpck_require__) => {
+ recordsets.push(recordset)
+ }
-var Stream = __nccwpck_require__(92413);
-if (process.env.READABLE_STREAM === 'disable' && Stream) {
- module.exports = Stream;
- exports = module.exports = Stream.Readable;
- exports.Readable = Stream.Readable;
- exports.Writable = Stream.Writable;
- exports.Duplex = Stream.Duplex;
- exports.Transform = Stream.Transform;
- exports.PassThrough = Stream.PassThrough;
- exports.Stream = Stream;
-} else {
- exports = module.exports = __nccwpck_require__(51433);
- exports.Stream = Stream || exports;
- exports.Readable = exports;
- exports.Writable = __nccwpck_require__(26993);
- exports.Duplex = __nccwpck_require__(41359);
- exports.Transform = __nccwpck_require__(34415);
- exports.PassThrough = __nccwpck_require__(81542);
-}
+ recordset = []
+ columns = {}
+ }
+ req.on('doneInProc', doneHandler) // doneInProc handlers are used in both queries and batches
+ req.on('done', doneHandler) // done handlers are used in batches
-/***/ }),
+ req.on('returnValue', (parameterName, value, metadata) => {
+ output[parameterName] = value
+ })
-/***/ 29977:
-/***/ (() => {
+ req.on('row', columns => {
+ if (!recordset) recordset = []
-/*! *****************************************************************************
-Copyright (C) Microsoft. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at http://www.apache.org/licenses/LICENSE-2.0
+ if (isChunkedRecordset) {
+ return chunksBuffer.push(columns[0].value)
+ }
-THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-MERCHANTABLITY OR NON-INFRINGEMENT.
+ if (this.arrayRowMode) {
+ row = []
+ } else {
+ row = {}
+ }
+ for (const col of columns) {
+ col.value = valueCorrection(col.value, col.metadata)
-See the Apache Version 2.0 License for specific language governing permissions
-and limitations under the License.
-***************************************************************************** */
-var Reflect;
-(function (Reflect) {
- // Metadata Proposal
- // https://rbuckton.github.io/reflect-metadata/
- (function (factory) {
- var root = typeof global === "object" ? global :
- typeof self === "object" ? self :
- typeof this === "object" ? this :
- Function("return this;")();
- var exporter = makeExporter(Reflect);
- if (typeof root.Reflect === "undefined") {
- root.Reflect = Reflect;
- }
- else {
- exporter = makeExporter(root.Reflect, exporter);
- }
- factory(exporter);
- function makeExporter(target, previous) {
- return function (key, value) {
- if (typeof target[key] !== "function") {
- Object.defineProperty(target, key, { configurable: true, writable: true, value: value });
- }
- if (previous)
- previous(key, value);
- };
- }
- })(function (exporter) {
- var hasOwn = Object.prototype.hasOwnProperty;
- // feature test for Symbol support
- var supportsSymbol = typeof Symbol === "function";
- var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
- var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
- var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support
- var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support
- var downLevel = !supportsCreate && !supportsProto;
- var HashMap = {
- // create an object in dictionary mode (a.k.a. "slow" mode in v8)
- create: supportsCreate
- ? function () { return MakeDictionary(Object.create(null)); }
- : supportsProto
- ? function () { return MakeDictionary({ __proto__: null }); }
- : function () { return MakeDictionary({}); },
- has: downLevel
- ? function (map, key) { return hasOwn.call(map, key); }
- : function (map, key) { return key in map; },
- get: downLevel
- ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }
- : function (map, key) { return map[key]; },
- };
- // Load global or shim versions of Map, Set, and WeakMap
- var functionPrototype = Object.getPrototypeOf(Function);
- var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
- var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
- var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
- var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
- // [[Metadata]] internal slot
- // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots
- var Metadata = new _WeakMap();
- /**
- * Applies a set of decorators to a property of a target object.
- * @param decorators An array of decorators.
- * @param target The target object.
- * @param propertyKey (Optional) The property key to decorate.
- * @param attributes (Optional) The property descriptor for the target key.
- * @remarks Decorators are applied in reverse order.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * Example = Reflect.decorate(decoratorsArray, Example);
- *
- * // property (on constructor)
- * Reflect.decorate(decoratorsArray, Example, "staticProperty");
- *
- * // property (on prototype)
- * Reflect.decorate(decoratorsArray, Example.prototype, "property");
- *
- * // method (on constructor)
- * Object.defineProperty(Example, "staticMethod",
- * Reflect.decorate(decoratorsArray, Example, "staticMethod",
- * Object.getOwnPropertyDescriptor(Example, "staticMethod")));
- *
- * // method (on prototype)
- * Object.defineProperty(Example.prototype, "method",
- * Reflect.decorate(decoratorsArray, Example.prototype, "method",
- * Object.getOwnPropertyDescriptor(Example.prototype, "method")));
- *
- */
- function decorate(decorators, target, propertyKey, attributes) {
- if (!IsUndefined(propertyKey)) {
- if (!IsArray(decorators))
- throw new TypeError();
- if (!IsObject(target))
- throw new TypeError();
- if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
- throw new TypeError();
- if (IsNull(attributes))
- attributes = undefined;
- propertyKey = ToPropertyKey(propertyKey);
- return DecorateProperty(decorators, target, propertyKey, attributes);
- }
- else {
- if (!IsArray(decorators))
- throw new TypeError();
- if (!IsConstructor(target))
- throw new TypeError();
- return DecorateConstructor(decorators, target);
- }
- }
- exporter("decorate", decorate);
- // 4.1.2 Reflect.metadata(metadataKey, metadataValue)
- // https://rbuckton.github.io/reflect-metadata/#reflect.metadata
- /**
- * A default metadata decorator factory that can be used on a class, class member, or parameter.
- * @param metadataKey The key for the metadata entry.
- * @param metadataValue The value for the metadata entry.
- * @returns A decorator function.
- * @remarks
- * If `metadataKey` is already defined for the target and target key, the
- * metadataValue for that key will be overwritten.
- * @example
- *
- * // constructor
- * @Reflect.metadata(key, value)
- * class Example {
- * }
- *
- * // property (on constructor, TypeScript only)
- * class Example {
- * @Reflect.metadata(key, value)
- * static staticProperty;
- * }
- *
- * // property (on prototype, TypeScript only)
- * class Example {
- * @Reflect.metadata(key, value)
- * property;
- * }
- *
- * // method (on constructor)
- * class Example {
- * @Reflect.metadata(key, value)
- * static staticMethod() { }
- * }
- *
- * // method (on prototype)
- * class Example {
- * @Reflect.metadata(key, value)
- * method() { }
- * }
- *
- */
- function metadata(metadataKey, metadataValue) {
- function decorator(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
- throw new TypeError();
- OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
- }
- return decorator;
- }
- exporter("metadata", metadata);
- /**
- * Define a unique metadata entry on the target.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param metadataValue A value that contains attached metadata.
- * @param target The target object on which to define metadata.
- * @param propertyKey (Optional) The property key for the target.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * Reflect.defineMetadata("custom:annotation", options, Example);
- *
- * // property (on constructor)
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty");
- *
- * // property (on prototype)
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property");
- *
- * // method (on constructor)
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod");
- *
- * // method (on prototype)
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method");
- *
- * // decorator factory as metadata-producing annotation.
- * function MyAnnotation(options): Decorator {
- * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
- * }
- *
- */
- function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
- }
- exporter("defineMetadata", defineMetadata);
- /**
- * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.hasMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function hasMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryHasMetadata(metadataKey, target, propertyKey);
- }
- exporter("hasMetadata", hasMetadata);
- /**
- * Gets a value indicating whether the target object has the provided metadata key defined.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.hasOwnMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function hasOwnMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
- }
- exporter("hasOwnMetadata", hasOwnMetadata);
- /**
- * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function getMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryGetMetadata(metadataKey, target, propertyKey);
- }
- exporter("getMetadata", getMetadata);
- /**
- * Gets the metadata value for the provided metadata key on the target object.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getOwnMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function getOwnMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
- }
- exporter("getOwnMetadata", getOwnMetadata);
- /**
- * Gets the metadata keys defined on the target object or its prototype chain.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns An array of unique metadata keys.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getMetadataKeys(Example);
- *
- * // property (on constructor)
- * result = Reflect.getMetadataKeys(Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getMetadataKeys(Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getMetadataKeys(Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getMetadataKeys(Example.prototype, "method");
- *
- */
- function getMetadataKeys(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryMetadataKeys(target, propertyKey);
- }
- exporter("getMetadataKeys", getMetadataKeys);
- /**
- * Gets the unique metadata keys defined on the target object.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns An array of unique metadata keys.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getOwnMetadataKeys(Example);
- *
- * // property (on constructor)
- * result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
- *
- */
- function getOwnMetadataKeys(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryOwnMetadataKeys(target, propertyKey);
- }
- exporter("getOwnMetadataKeys", getOwnMetadataKeys);
- /**
- * Deletes the metadata entry from the target object with the provided key.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata entry was found and deleted; otherwise, false.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.deleteMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function deleteMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return false;
- if (!metadataMap.delete(metadataKey))
- return false;
- if (metadataMap.size > 0)
- return true;
- var targetMetadata = Metadata.get(target);
- targetMetadata.delete(propertyKey);
- if (targetMetadata.size > 0)
- return true;
- Metadata.delete(target);
- return true;
- }
- exporter("deleteMetadata", deleteMetadata);
- function DecorateConstructor(decorators, target) {
- for (var i = decorators.length - 1; i >= 0; --i) {
- var decorator = decorators[i];
- var decorated = decorator(target);
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
- if (!IsConstructor(decorated))
- throw new TypeError();
- target = decorated;
- }
- }
- return target;
- }
- function DecorateProperty(decorators, target, propertyKey, descriptor) {
- for (var i = decorators.length - 1; i >= 0; --i) {
- var decorator = decorators[i];
- var decorated = decorator(target, propertyKey, descriptor);
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
- if (!IsObject(decorated))
- throw new TypeError();
- descriptor = decorated;
- }
- }
- return descriptor;
- }
- function GetOrCreateMetadataMap(O, P, Create) {
- var targetMetadata = Metadata.get(O);
- if (IsUndefined(targetMetadata)) {
- if (!Create)
- return undefined;
- targetMetadata = new _Map();
- Metadata.set(O, targetMetadata);
- }
- var metadataMap = targetMetadata.get(P);
- if (IsUndefined(metadataMap)) {
- if (!Create)
- return undefined;
- metadataMap = new _Map();
- targetMetadata.set(P, metadataMap);
- }
- return metadataMap;
- }
- // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata
- function OrdinaryHasMetadata(MetadataKey, O, P) {
- var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
- if (hasOwn)
- return true;
- var parent = OrdinaryGetPrototypeOf(O);
- if (!IsNull(parent))
- return OrdinaryHasMetadata(MetadataKey, parent, P);
- return false;
- }
- // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata
- function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return false;
- return ToBoolean(metadataMap.has(MetadataKey));
- }
- // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata
- function OrdinaryGetMetadata(MetadataKey, O, P) {
- var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
- if (hasOwn)
- return OrdinaryGetOwnMetadata(MetadataKey, O, P);
- var parent = OrdinaryGetPrototypeOf(O);
- if (!IsNull(parent))
- return OrdinaryGetMetadata(MetadataKey, parent, P);
- return undefined;
- }
- // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata
- function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return undefined;
- return metadataMap.get(MetadataKey);
- }
- // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata
- function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);
- metadataMap.set(MetadataKey, MetadataValue);
- }
- // 3.1.6.1 OrdinaryMetadataKeys(O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys
- function OrdinaryMetadataKeys(O, P) {
- var ownKeys = OrdinaryOwnMetadataKeys(O, P);
- var parent = OrdinaryGetPrototypeOf(O);
- if (parent === null)
- return ownKeys;
- var parentKeys = OrdinaryMetadataKeys(parent, P);
- if (parentKeys.length <= 0)
- return ownKeys;
- if (ownKeys.length <= 0)
- return parentKeys;
- var set = new _Set();
- var keys = [];
- for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
- var key = ownKeys_1[_i];
- var hasKey = set.has(key);
- if (!hasKey) {
- set.add(key);
- keys.push(key);
- }
- }
- for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
- var key = parentKeys_1[_a];
- var hasKey = set.has(key);
- if (!hasKey) {
- set.add(key);
- keys.push(key);
- }
- }
- return keys;
- }
- // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys
- function OrdinaryOwnMetadataKeys(O, P) {
- var keys = [];
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return keys;
- var keysObj = metadataMap.keys();
- var iterator = GetIterator(keysObj);
- var k = 0;
- while (true) {
- var next = IteratorStep(iterator);
- if (!next) {
- keys.length = k;
- return keys;
- }
- var nextValue = IteratorValue(next);
- try {
- keys[k] = nextValue;
- }
- catch (e) {
- try {
- IteratorClose(iterator);
- }
- finally {
- throw e;
- }
+ if (this.arrayRowMode) {
+ row.push(col.value)
+ } else {
+ const exi = row[col.metadata.colName]
+ if (exi != null) {
+ if (exi instanceof Array) {
+ exi.push(col.value)
+ } else {
+ row[col.metadata.colName] = [exi, col.value]
}
- k++;
- }
- }
- // 6 ECMAScript Data Typ0es and Values
- // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values
- function Type(x) {
- if (x === null)
- return 1 /* Null */;
- switch (typeof x) {
- case "undefined": return 0 /* Undefined */;
- case "boolean": return 2 /* Boolean */;
- case "string": return 3 /* String */;
- case "symbol": return 4 /* Symbol */;
- case "number": return 5 /* Number */;
- case "object": return x === null ? 1 /* Null */ : 6 /* Object */;
- default: return 6 /* Object */;
- }
- }
- // 6.1.1 The Undefined Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type
- function IsUndefined(x) {
- return x === undefined;
- }
- // 6.1.2 The Null Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type
- function IsNull(x) {
- return x === null;
- }
- // 6.1.5 The Symbol Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type
- function IsSymbol(x) {
- return typeof x === "symbol";
- }
- // 6.1.7 The Object Type
- // https://tc39.github.io/ecma262/#sec-object-type
- function IsObject(x) {
- return typeof x === "object" ? x !== null : typeof x === "function";
- }
- // 7.1 Type Conversion
- // https://tc39.github.io/ecma262/#sec-type-conversion
- // 7.1.1 ToPrimitive(input [, PreferredType])
- // https://tc39.github.io/ecma262/#sec-toprimitive
- function ToPrimitive(input, PreferredType) {
- switch (Type(input)) {
- case 0 /* Undefined */: return input;
- case 1 /* Null */: return input;
- case 2 /* Boolean */: return input;
- case 3 /* String */: return input;
- case 4 /* Symbol */: return input;
- case 5 /* Number */: return input;
- }
- var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default";
- var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
- if (exoticToPrim !== undefined) {
- var result = exoticToPrim.call(input, hint);
- if (IsObject(result))
- throw new TypeError();
- return result;
+ } else {
+ row[col.metadata.colName] = col.value
+ }
}
- return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
- }
- // 7.1.1.1 OrdinaryToPrimitive(O, hint)
- // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive
- function OrdinaryToPrimitive(O, hint) {
- if (hint === "string") {
- var toString_1 = O.toString;
- if (IsCallable(toString_1)) {
- var result = toString_1.call(O);
- if (!IsObject(result))
- return result;
- }
- var valueOf = O.valueOf;
- if (IsCallable(valueOf)) {
- var result = valueOf.call(O);
- if (!IsObject(result))
- return result;
- }
+ }
+
+ if (this.stream) {
+ if (this._isBatch) {
+ // dont stream recordset with output values in batches
+ if (row.___return___) {
+ batchLastRow = row
+ } else {
+ this.emit('row', row)
+ }
+ } else {
+ this.emit('row', row)
}
- else {
- var valueOf = O.valueOf;
- if (IsCallable(valueOf)) {
- var result = valueOf.call(O);
- if (!IsObject(result))
- return result;
- }
- var toString_2 = O.toString;
- if (IsCallable(toString_2)) {
- var result = toString_2.call(O);
- if (!IsObject(result))
- return result;
- }
+ } else {
+ recordset.push(row)
+ }
+ })
+
+ if (this._isBatch) {
+ if (Object.keys(this.parameters).length) {
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ let value = getTediousType(param.type).validate(param.value)
+
+ if (value instanceof TypeError) {
+ value = new RequestError(`Validation failed for parameter '${name}'. ${value.message}`, 'EPARAM')
+
+ this.parent.release(connection)
+ return callback(value)
+ }
+
+ param.value = value
}
- throw new TypeError();
- }
- // 7.1.2 ToBoolean(argument)
- // https://tc39.github.io/ecma262/2016/#sec-toboolean
- function ToBoolean(argument) {
- return !!argument;
- }
- // 7.1.12 ToString(argument)
- // https://tc39.github.io/ecma262/#sec-tostring
- function ToString(argument) {
- return "" + argument;
- }
- // 7.1.14 ToPropertyKey(argument)
- // https://tc39.github.io/ecma262/#sec-topropertykey
- function ToPropertyKey(argument) {
- var key = ToPrimitive(argument, 3 /* String */);
- if (IsSymbol(key))
- return key;
- return ToString(key);
- }
- // 7.2 Testing and Comparison Operations
- // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations
- // 7.2.2 IsArray(argument)
- // https://tc39.github.io/ecma262/#sec-isarray
- function IsArray(argument) {
- return Array.isArray
- ? Array.isArray(argument)
- : argument instanceof Object
- ? argument instanceof Array
- : Object.prototype.toString.call(argument) === "[object Array]";
- }
- // 7.2.3 IsCallable(argument)
- // https://tc39.github.io/ecma262/#sec-iscallable
- function IsCallable(argument) {
- // NOTE: This is an approximation as we cannot check for [[Call]] internal method.
- return typeof argument === "function";
- }
- // 7.2.4 IsConstructor(argument)
- // https://tc39.github.io/ecma262/#sec-isconstructor
- function IsConstructor(argument) {
- // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.
- return typeof argument === "function";
- }
- // 7.2.7 IsPropertyKey(argument)
- // https://tc39.github.io/ecma262/#sec-ispropertykey
- function IsPropertyKey(argument) {
- switch (Type(argument)) {
- case 3 /* String */: return true;
- case 4 /* Symbol */: return true;
- default: return false;
+
+ const declarations = []
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ declarations.push(`@${name} ${declare(param.type, param)}`)
}
+
+ const assigns = []
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ assigns.push(`@${name} = ${cast(param.value, param.type, param)}`)
+ }
+
+ const selects = []
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ if (param.io === 2) {
+ selects.push(`@${name} as [${name}]`)
+ }
+ }
+
+ batchHasOutput = selects.length > 0
+
+ req.sqlTextOrProcedure = `declare ${declarations.join(', ')};select ${assigns.join(', ')};${req.sqlTextOrProcedure};${batchHasOutput ? (`select 1 as [___return___], ${selects.join(', ')}`) : ''}`
+ }
+ } else {
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ if (param.io === 1) {
+ req.addParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
+ } else {
+ req.addOutputParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
+ }
+ }
}
- // 7.3 Operations on Objects
- // https://tc39.github.io/ecma262/#sec-operations-on-objects
- // 7.3.9 GetMethod(V, P)
- // https://tc39.github.io/ecma262/#sec-getmethod
- function GetMethod(V, P) {
- var func = V[P];
- if (func === undefined || func === null)
- return undefined;
- if (!IsCallable(func))
- throw new TypeError();
- return func;
- }
- // 7.4 Operations on Iterator Objects
- // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects
- function GetIterator(obj) {
- var method = GetMethod(obj, iteratorSymbol);
- if (!IsCallable(method))
- throw new TypeError(); // from Call
- var iterator = method.call(obj);
- if (!IsObject(iterator))
- throw new TypeError();
- return iterator;
+
+ try {
+ connection[this._isBatch ? 'execSqlBatch' : 'execSql'](req)
+ } catch (error) {
+ handleError(true, connection, error)
}
- // 7.4.4 IteratorValue(iterResult)
- // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue
- function IteratorValue(iterResult) {
- return iterResult.value;
+ })
+ })
+ }
+
+ /*
+ Execute stored procedure with specified parameters.
+ */
+
+ _execute (procedure, callback) {
+ super._execute(procedure, err => {
+ if (err) return callback(err)
+
+ const recordsets = []
+ const recordsetcolumns = []
+ const errors = []
+ const errorHandlers = {}
+ const output = {}
+ const rowsAffected = []
+
+ let columns = {}
+ let recordset = []
+ let returnValue = 0
+ let isChunkedRecordset = false
+ let chunksBuffer = null
+ let hasReturned = false
+
+ const handleError = (doReturn, connection, info) => {
+ let err = new Error(info.message)
+ err.info = info
+ err = new RequestError(err, 'EREQUEST')
+
+ if (this.stream) {
+ this.emit('error', err)
+ } else {
+ if (doReturn && !hasReturned) {
+ if (connection) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
+ }
+
+ this.parent.release(connection)
+ }
+
+ hasReturned = true
+ callback(err)
+ }
}
- // 7.4.5 IteratorStep(iterator)
- // https://tc39.github.io/ecma262/#sec-iteratorstep
- function IteratorStep(iterator) {
- var result = iterator.next();
- return result.done ? false : result;
+
+ // we must collect errors even in stream mode
+ errors.push(err)
+ }
+
+ const handleInfo = msg => {
+ this.emit('info', {
+ message: msg.message,
+ number: msg.number,
+ state: msg.state,
+ class: msg.class,
+ lineNumber: msg.lineNumber,
+ serverName: msg.serverName,
+ procName: msg.procName
+ })
+ }
+
+ this.parent.acquire(this, (err, connection, config) => {
+ if (err) return callback(err)
+
+ debug('connection(%d): borrowed to request #%d', IDS.get(connection), IDS.get(this))
+
+ let row
+
+ if (this.canceled) {
+ debug('request(%d): canceled', IDS.get(this))
+ this.parent.release(connection)
+ return callback(new RequestError('Canceled.', 'ECANCEL'))
}
- // 7.4.6 IteratorClose(iterator, completion)
- // https://tc39.github.io/ecma262/#sec-iteratorclose
- function IteratorClose(iterator) {
- var f = iterator["return"];
- if (f)
- f.call(iterator);
+
+ this._cancel = () => {
+ debug('request(%d): cancel', IDS.get(this))
+ connection.cancel()
}
- // 9.1 Ordinary Object Internal Methods and Internal Slots
- // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots
- // 9.1.1.1 OrdinaryGetPrototypeOf(O)
- // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof
- function OrdinaryGetPrototypeOf(O) {
- var proto = Object.getPrototypeOf(O);
- if (typeof O !== "function" || O === functionPrototype)
- return proto;
- // TypeScript doesn't set __proto__ in ES5, as it's non-standard.
- // Try to determine the superclass constructor. Compatible implementations
- // must either set __proto__ on a subclass constructor to the superclass constructor,
- // or ensure each class has a valid `constructor` property on its prototype that
- // points back to the constructor.
- // If this is not the same as Function.[[Prototype]], then this is definately inherited.
- // This is the case when in ES6 or when using __proto__ in a compatible browser.
- if (proto !== functionPrototype)
- return proto;
- // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.
- var prototype = O.prototype;
- var prototypeProto = prototype && Object.getPrototypeOf(prototype);
- if (prototypeProto == null || prototypeProto === Object.prototype)
- return proto;
- // If the constructor was not a function, then we cannot determine the heritage.
- var constructor = prototypeProto.constructor;
- if (typeof constructor !== "function")
- return proto;
- // If we have some kind of self-reference, then we cannot determine the heritage.
- if (constructor === O)
- return proto;
- // we have a pretty good guess at the heritage.
- return constructor;
+
+ // attach handler to handle multiple error messages
+ connection.on('infoMessage', errorHandlers.infoMessage = handleInfo)
+ connection.on('errorMessage', errorHandlers.errorMessage = handleError.bind(null, false, connection))
+ connection.on('error', errorHandlers.error = handleError.bind(null, true, connection))
+
+ if (debug.enabled) {
+ // log stored procedure executions and provided parameters
+ const params = Object.keys(this.parameters).map(k => this.parameters[k])
+ // cut long string parameters short to keep log somewhat clean
+ const logValue = s => typeof s === 'string' && s.length > 50 ? s.substring(0, 47) + '...' : s
+ // format parameter names as 'my_parameter [sql.Int]'
+ const logName = param => param.name + ' [sql.' + param.type.name + ']'
+ const logParams = {}
+ params.forEach(p => { logParams[logName(p)] = logValue(p.value) })
+ debug('request(%d): execute %s %O', IDS.get(this), procedure, logParams)
}
- // naive Map shim
- function CreateMapPolyfill() {
- var cacheSentinel = {};
- var arraySentinel = [];
- var MapIterator = /** @class */ (function () {
- function MapIterator(keys, values, selector) {
- this._index = 0;
- this._keys = keys;
- this._values = values;
- this._selector = selector;
- }
- MapIterator.prototype["@@iterator"] = function () { return this; };
- MapIterator.prototype[iteratorSymbol] = function () { return this; };
- MapIterator.prototype.next = function () {
- var index = this._index;
- if (index >= 0 && index < this._keys.length) {
- var result = this._selector(this._keys[index], this._values[index]);
- if (index + 1 >= this._keys.length) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- else {
- this._index++;
- }
- return { value: result, done: false };
- }
- return { value: undefined, done: true };
- };
- MapIterator.prototype.throw = function (error) {
- if (this._index >= 0) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- throw error;
- };
- MapIterator.prototype.return = function (value) {
- if (this._index >= 0) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- return { value: value, done: true };
- };
- return MapIterator;
- }());
- return /** @class */ (function () {
- function Map() {
- this._keys = [];
- this._values = [];
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- }
- Object.defineProperty(Map.prototype, "size", {
- get: function () { return this._keys.length; },
- enumerable: true,
- configurable: true
- });
- Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };
- Map.prototype.get = function (key) {
- var index = this._find(key, /*insert*/ false);
- return index >= 0 ? this._values[index] : undefined;
- };
- Map.prototype.set = function (key, value) {
- var index = this._find(key, /*insert*/ true);
- this._values[index] = value;
- return this;
- };
- Map.prototype.delete = function (key) {
- var index = this._find(key, /*insert*/ false);
- if (index >= 0) {
- var size = this._keys.length;
- for (var i = index + 1; i < size; i++) {
- this._keys[i - 1] = this._keys[i];
- this._values[i - 1] = this._values[i];
- }
- this._keys.length--;
- this._values.length--;
- if (key === this._cacheKey) {
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- }
- return true;
- }
- return false;
- };
- Map.prototype.clear = function () {
- this._keys.length = 0;
- this._values.length = 0;
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- };
- Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };
- Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };
- Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };
- Map.prototype["@@iterator"] = function () { return this.entries(); };
- Map.prototype[iteratorSymbol] = function () { return this.entries(); };
- Map.prototype._find = function (key, insert) {
- if (this._cacheKey !== key) {
- this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
- }
- if (this._cacheIndex < 0 && insert) {
- this._cacheIndex = this._keys.length;
- this._keys.push(key);
- this._values.push(undefined);
- }
- return this._cacheIndex;
- };
- return Map;
- }());
- function getKey(key, _) {
- return key;
- }
- function getValue(_, value) {
- return value;
+
+ const req = new tds.Request(procedure, err => {
+ // to make sure we handle no-sql errors as well
+ if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
+ err = new RequestError(err, 'EREQUEST')
+ if (this.stream) this.emit('error', err)
+ errors.push(err)
+ }
+
+ delete this._cancel
+
+ let error
+ if (errors.length && !this.stream) {
+ error = errors.pop()
+ error.precedingErrors = errors
+ }
+
+ if (!hasReturned) {
+ for (const event in errorHandlers) {
+ connection.removeListener(event, errorHandlers[event])
}
- function getEntry(key, value) {
- return [key, value];
+
+ this.parent.release(connection)
+ hasReturned = true
+
+ if (error) {
+ debug('request(%d): failed', IDS.get(this), error)
+ } else {
+ debug('request(%d): complete', IDS.get(this))
}
- }
- // naive Set shim
- function CreateSetPolyfill() {
- return /** @class */ (function () {
- function Set() {
- this._map = new _Map();
- }
- Object.defineProperty(Set.prototype, "size", {
- get: function () { return this._map.size; },
- enumerable: true,
- configurable: true
- });
- Set.prototype.has = function (value) { return this._map.has(value); };
- Set.prototype.add = function (value) { return this._map.set(value, value), this; };
- Set.prototype.delete = function (value) { return this._map.delete(value); };
- Set.prototype.clear = function () { this._map.clear(); };
- Set.prototype.keys = function () { return this._map.keys(); };
- Set.prototype.values = function () { return this._map.values(); };
- Set.prototype.entries = function () { return this._map.entries(); };
- Set.prototype["@@iterator"] = function () { return this.keys(); };
- Set.prototype[iteratorSymbol] = function () { return this.keys(); };
- return Set;
- }());
- }
- // naive WeakMap shim
- function CreateWeakMapPolyfill() {
- var UUID_SIZE = 16;
- var keys = HashMap.create();
- var rootKey = CreateUniqueKey();
- return /** @class */ (function () {
- function WeakMap() {
- this._key = CreateUniqueKey();
- }
- WeakMap.prototype.has = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? HashMap.has(table, this._key) : false;
- };
- WeakMap.prototype.get = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? HashMap.get(table, this._key) : undefined;
- };
- WeakMap.prototype.set = function (target, value) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ true);
- table[this._key] = value;
- return this;
- };
- WeakMap.prototype.delete = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? delete table[this._key] : false;
- };
- WeakMap.prototype.clear = function () {
- // NOTE: not a real clear, just makes the previous data unreachable
- this._key = CreateUniqueKey();
- };
- return WeakMap;
- }());
- function CreateUniqueKey() {
- var key;
- do
- key = "@@WeakMap@@" + CreateUUID();
- while (HashMap.has(keys, key));
- keys[key] = true;
- return key;
+
+ if (this.stream) {
+ callback(null, null, output, returnValue, rowsAffected, recordsetcolumns)
+ } else {
+ callback(error, recordsets, output, returnValue, rowsAffected, recordsetcolumns)
}
- function GetOrCreateWeakMapTable(target, create) {
- if (!hasOwn.call(target, rootKey)) {
- if (!create)
- return undefined;
- Object.defineProperty(target, rootKey, { value: HashMap.create() });
+ }
+ })
+
+ this._setCurrentRequest(req)
+
+ req.on('columnMetadata', metadata => {
+ columns = createColumns(metadata, this.arrayRowMode)
+
+ isChunkedRecordset = false
+ if ((metadata.length === 1) && (metadata[0].colName === JSON_COLUMN_ID || metadata[0].colName === XML_COLUMN_ID)) {
+ isChunkedRecordset = true
+ chunksBuffer = []
+ }
+
+ if (this.stream) this.emit('recordset', columns)
+ if (this.arrayRowMode) recordsetcolumns.push(columns)
+ })
+
+ req.on('row', columns => {
+ if (!recordset) recordset = []
+
+ if (isChunkedRecordset) {
+ return chunksBuffer.push(columns[0].value)
+ }
+
+ if (this.arrayRowMode) {
+ row = []
+ } else {
+ row = {}
+ }
+ for (const col of columns) {
+ col.value = valueCorrection(col.value, col.metadata)
+
+ if (this.arrayRowMode) {
+ row.push(col.value)
+ } else {
+ const exi = row[col.metadata.colName]
+ if (exi != null) {
+ if (exi instanceof Array) {
+ exi.push(col.value)
+ } else {
+ row[col.metadata.colName] = [exi, col.value]
}
- return target[rootKey];
- }
- function FillRandomBytes(buffer, size) {
- for (var i = 0; i < size; ++i)
- buffer[i] = Math.random() * 0xff | 0;
- return buffer;
+ } else {
+ row[col.metadata.colName] = col.value
+ }
}
- function GenRandomBytes(size) {
- if (typeof Uint8Array === "function") {
- if (typeof crypto !== "undefined")
- return crypto.getRandomValues(new Uint8Array(size));
- if (typeof msCrypto !== "undefined")
- return msCrypto.getRandomValues(new Uint8Array(size));
- return FillRandomBytes(new Uint8Array(size), size);
+ }
+
+ if (this.stream) {
+ this.emit('row', row)
+ } else {
+ recordset.push(row)
+ }
+ })
+
+ req.on('doneInProc', (rowCount, more) => {
+ if (rowCount != null) rowsAffected.push(rowCount)
+
+ // filter empty recordsets when NOCOUNT is OFF
+ if (Object.keys(columns).length === 0) return
+
+ if (isChunkedRecordset) {
+ if (columns[JSON_COLUMN_ID] && config.parseJSON === true) {
+ try {
+ if (chunksBuffer.length === 0) {
+ row = null
+ } else {
+ row = JSON.parse(chunksBuffer.join(''))
}
- return FillRandomBytes(new Array(size), size);
+ } catch (ex) {
+ row = null
+ const ex2 = new RequestError(new Error(`Failed to parse incoming JSON. ${ex.message}`), 'EJSON')
+
+ if (this.stream) this.emit('error', ex2)
+
+ // we must collect errors even in stream mode
+ errors.push(ex2)
+ }
+ } else {
+ row = {}
+ row[Object.keys(columns)[0]] = chunksBuffer.join('')
}
- function CreateUUID() {
- var data = GenRandomBytes(UUID_SIZE);
- // mark as random - RFC 4122 § 4.4
- data[6] = data[6] & 0x4f | 0x40;
- data[8] = data[8] & 0xbf | 0x80;
- var result = "";
- for (var offset = 0; offset < UUID_SIZE; ++offset) {
- var byte = data[offset];
- if (offset === 4 || offset === 6 || offset === 8)
- result += "-";
- if (byte < 16)
- result += "0";
- result += byte.toString(16).toLowerCase();
- }
- return result;
+
+ chunksBuffer = null
+
+ if (this.stream) {
+ this.emit('row', row)
+ } else {
+ recordset.push(row)
}
+ }
+
+ if (!this.stream) {
+ // all rows of current recordset loaded
+ Object.defineProperty(recordset, 'columns', {
+ enumerable: false,
+ configurable: true,
+ value: columns
+ })
+
+ Object.defineProperty(recordset, 'toTable', {
+ enumerable: false,
+ configurable: true,
+ value (name) { return Table.fromRecordset(this, name) }
+ })
+
+ recordsets.push(recordset)
+ }
+
+ recordset = []
+ columns = {}
+ })
+
+ req.on('doneProc', (rowCount, more, returnStatus) => {
+ returnValue = returnStatus
+ })
+
+ req.on('returnValue', (parameterName, value, metadata) => {
+ output[parameterName] = value
+ })
+
+ for (const name in this.parameters) {
+ if (!objectHasProperty(this.parameters, name)) {
+ continue
+ }
+ const param = this.parameters[name]
+ if (param.io === 1) {
+ req.addParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
+ } else {
+ req.addOutputParameter(param.name, getTediousType(param.type), parameterCorrection(param.value), { length: param.length, scale: param.scale, precision: param.precision })
+ }
}
- // uses a heuristic used by v8 and chakra to force an object into dictionary mode.
- function MakeDictionary(obj) {
- obj.__ = undefined;
- delete obj.__;
- return obj;
- }
- });
-})(Reflect || (Reflect = {}));
+
+ connection.callProcedure(req)
+ })
+ })
+ }
+
+ _pause () {
+ super._pause()
+ if (this._currentRequest) {
+ this._currentRequest.pause()
+ }
+ }
+
+ _resume () {
+ super._resume()
+ if (this._currentRequest) {
+ this._currentRequest.resume()
+ }
+ }
+}
+
+module.exports = Request
/***/ }),
-/***/ 48699:
+/***/ 41670:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
-// Copyright 2010-2012 Mikeal Rogers
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+const debug = __nccwpck_require__(38237)('mssql:tedi')
+const BaseTransaction = __nccwpck_require__(2555)
+const { IDS } = __nccwpck_require__(14178)
+const TransactionError = __nccwpck_require__(70274)
-var extend = __nccwpck_require__(38171)
-var cookies = __nccwpck_require__(50976)
-var helpers = __nccwpck_require__(74845)
+class Transaction extends BaseTransaction {
+ constructor (parent) {
+ super(parent)
-var paramsHaveRequestBody = helpers.paramsHaveRequestBody
+ this._abort = () => {
+ if (!this._rollbackRequested) {
+ // transaction interrupted because of XACT_ABORT
-// organize params for patch, post, put, head, del
-function initParams (uri, options, callback) {
- if (typeof options === 'function') {
- callback = options
+ const pc = this._acquiredConnection
+
+ // defer releasing so connection can switch from SentClientRequest to LoggedIn state
+ setImmediate(this.parent.release.bind(this.parent), pc)
+
+ this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
+ this._acquiredConnection = null
+ this._acquiredConfig = null
+ this._aborted = true
+
+ this.emit('rollback', true)
+ }
+ }
}
- var params = {}
- if (options !== null && typeof options === 'object') {
- extend(params, options, {uri: uri})
- } else if (typeof uri === 'string') {
- extend(params, {uri: uri})
+ _begin (isolationLevel, callback) {
+ super._begin(isolationLevel, err => {
+ if (err) return callback(err)
+
+ debug('transaction(%d): begin', IDS.get(this))
+
+ this.parent.acquire(this, (err, connection, config) => {
+ if (err) return callback(err)
+
+ this._acquiredConnection = connection
+ this._acquiredConnection.on('rollbackTransaction', this._abort)
+ this._acquiredConfig = config
+
+ connection.beginTransaction(err => {
+ if (err) err = new TransactionError(err)
+
+ debug('transaction(%d): begun', IDS.get(this))
+
+ callback(err)
+ }, this.name, this.isolationLevel)
+ })
+ })
+ }
+
+ _commit (callback) {
+ super._commit(err => {
+ if (err) return callback(err)
+
+ debug('transaction(%d): commit', IDS.get(this))
+
+ this._acquiredConnection.commitTransaction(err => {
+ if (err) err = new TransactionError(err)
+
+ this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
+ this.parent.release(this._acquiredConnection)
+ this._acquiredConnection = null
+ this._acquiredConfig = null
+
+ if (!err) debug('transaction(%d): commited', IDS.get(this))
+
+ callback(err)
+ })
+ })
+ }
+
+ _rollback (callback) {
+ super._rollback(err => {
+ if (err) return callback(err)
+
+ debug('transaction(%d): rollback', IDS.get(this))
+
+ this._acquiredConnection.rollbackTransaction(err => {
+ if (err) err = new TransactionError(err)
+
+ this._acquiredConnection.removeListener('rollbackTransaction', this._abort)
+ this.parent.release(this._acquiredConnection)
+ this._acquiredConnection = null
+ this._acquiredConfig = null
+
+ if (!err) debug('transaction(%d): rolled back', IDS.get(this))
+
+ callback(err)
+ })
+ })
+ }
+}
+
+module.exports = Transaction
+
+
+/***/ }),
+
+/***/ 33199:
+/***/ ((module) => {
+
+"use strict";
+
+
+/* const FIGURE = {
+ INTERIOR_RING: 0x00,
+ STROKE: 0x01,
+ EXTERIOR_RING: 0x02
+};
+
+const FIGURE_V2 = {
+ POINT: 0x00,
+ LINE: 0x01,
+ ARC: 0x02,
+ COMPOSITE_CURVE: 0x03
+};
+
+const SHAPE = {
+ POINT: 0x01,
+ LINESTRING: 0x02,
+ POLYGON: 0x03,
+ MULTIPOINT: 0x04,
+ MULTILINESTRING: 0x05,
+ MULTIPOLYGON: 0x06,
+ GEOMETRY_COLLECTION: 0x07
+};
+
+const SHAPE_V2 = {
+ POINT: 0x01,
+ LINESTRING: 0x02,
+ POLYGON: 0x03,
+ MULTIPOINT: 0x04,
+ MULTILINESTRING: 0x05,
+ MULTIPOLYGON: 0x06,
+ GEOMETRY_COLLECTION: 0x07,
+ CIRCULAR_STRING: 0x08,
+ COMPOUND_CURVE: 0x09,
+ CURVE_POLYGON: 0x0A,
+ FULL_GLOBE: 0x0B
+};
+
+const SEGMENT = {
+ LINE: 0x00,
+ ARC: 0x01,
+ FIRST_LINE: 0x02,
+ FIRST_ARC: 0x03
+}; */
+
+class Point {
+ constructor () {
+ this.x = 0
+ this.y = 0
+ this.z = null
+ this.m = null
+ }
+}
+
+const parsePoints = (buffer, count) => {
+ // s2.1.5 + s2.1.6
+
+ const points = []
+ if (count < 1) {
+ return points
+ }
+
+ for (let i = 1; i <= count; i++) {
+ const point = new Point()
+ points.push(point)
+ point.x = buffer.readDoubleLE(buffer.position)
+ point.y = buffer.readDoubleLE(buffer.position + 8)
+ buffer.position += 16
+ }
+
+ return points
+}
+
+const parseZ = (buffer, points) => {
+ // s2.1.1 + s.2.1.2
+
+ if (points < 1) {
+ return
+ }
+
+ points.forEach(point => {
+ point.z = buffer.readDoubleLE(buffer.position)
+ buffer.position += 8
+ })
+}
+
+const parseM = (buffer, points) => {
+ // s2.1.1 + s.2.1.2
+
+ if (points < 1) {
+ return
+ }
+
+ points.forEach(point => {
+ point.m = buffer.readDoubleLE(buffer.position)
+ buffer.position += 8
+ })
+}
+
+const parseFigures = (buffer, count, properties) => {
+ // s2.1.3
+
+ const figures = []
+ if (count < 1) {
+ return figures
+ }
+
+ if (properties.P) {
+ figures.push({
+ attribute: 0x01,
+ pointOffset: 0
+ })
+ } else if (properties.L) {
+ figures.push({
+ attribute: 0x01,
+ pointOffset: 0
+ })
} else {
- extend(params, uri)
+ for (let i = 1; i <= count; i++) {
+ figures.push({
+ attribute: buffer.readUInt8(buffer.position),
+ pointOffset: buffer.readInt32LE(buffer.position + 1)
+ })
+
+ buffer.position += 5
+ }
}
- params.callback = callback || params.callback
- return params
+ return figures
+}
+
+const parseShapes = (buffer, count, properties) => {
+ // s2.1.4
+
+ const shapes = []
+ if (count < 1) {
+ return shapes
+ }
+
+ if (properties.P) {
+ shapes.push({
+ parentOffset: -1,
+ figureOffset: 0,
+ type: 0x01
+ })
+ } else if (properties.L) {
+ shapes.push({
+ parentOffset: -1,
+ figureOffset: 0,
+ type: 0x02
+ })
+ } else {
+ for (let i = 1; i <= count; i++) {
+ shapes.push({
+ parentOffset: buffer.readInt32LE(buffer.position),
+ figureOffset: buffer.readInt32LE(buffer.position + 4),
+ type: buffer.readUInt8(buffer.position + 8)
+ })
+
+ buffer.position += 9
+ }
+ }
+
+ return shapes
+}
+
+const parseSegments = (buffer, count) => {
+ // s2.1.7
+
+ const segments = []
+ if (count < 1) {
+ return segments
+ }
+
+ for (let i = 1; i <= count; i++) {
+ segments.push({ type: buffer.readUInt8(buffer.position) })
+
+ buffer.position++
+ }
+
+ return segments
+}
+
+const parseGeography = buffer => {
+ // s2.1.1 + s.2.1.2
+
+ const srid = buffer.readInt32LE(0)
+ if (srid === -1) {
+ return null
+ }
+
+ const value = {
+ srid,
+ version: buffer.readUInt8(4)
+ }
+
+ const flags = buffer.readUInt8(5)
+ buffer.position = 6
+
+ // console.log("srid", srid)
+ // console.log("version", version)
+
+ const properties = {
+ Z: (flags & (1 << 0)) > 0,
+ M: (flags & (1 << 1)) > 0,
+ V: (flags & (1 << 2)) > 0,
+ P: (flags & (1 << 3)) > 0,
+ L: (flags & (1 << 4)) > 0
+ }
+
+ if (value.version === 2) {
+ properties.H = (flags & (1 << 3)) > 0
+ }
+
+ // console.log("properties", properties);
+
+ let numberOfPoints
+ if (properties.P) {
+ numberOfPoints = 1
+ } else if (properties.L) {
+ numberOfPoints = 2
+ } else {
+ numberOfPoints = buffer.readUInt32LE(buffer.position)
+ buffer.position += 4
+ }
+
+ // console.log("numberOfPoints", numberOfPoints)
+
+ value.points = parsePoints(buffer, numberOfPoints)
+
+ if (properties.Z) {
+ parseZ(buffer, value.points)
+ }
+
+ if (properties.M) {
+ parseM(buffer, value.points)
+ }
+
+ // console.log("points", points)
+
+ let numberOfFigures
+ if (properties.P) {
+ numberOfFigures = 1
+ } else if (properties.L) {
+ numberOfFigures = 1
+ } else {
+ numberOfFigures = buffer.readUInt32LE(buffer.position)
+ buffer.position += 4
+ }
+
+ // console.log("numberOfFigures", numberOfFigures)
+
+ value.figures = parseFigures(buffer, numberOfFigures, properties)
+
+ // console.log("figures", figures)
+
+ let numberOfShapes
+ if (properties.P) {
+ numberOfShapes = 1
+ } else if (properties.L) {
+ numberOfShapes = 1
+ } else {
+ numberOfShapes = buffer.readUInt32LE(buffer.position)
+ buffer.position += 4
+ }
+
+ // console.log("numberOfShapes", numberOfShapes)
+
+ value.shapes = parseShapes(buffer, numberOfShapes, properties)
+
+ // console.log( "shapes", shapes)
+
+ if (value.version === 2 && buffer.position < buffer.length) {
+ const numberOfSegments = buffer.readUInt32LE(buffer.position)
+ buffer.position += 4
+
+ // console.log("numberOfSegments", numberOfSegments)
+
+ value.segments = parseSegments(buffer, numberOfSegments)
+
+ // console.log("segments", segments)
+ } else {
+ value.segments = []
+ }
+
+ return value
}
-function request (uri, options, callback) {
- if (typeof uri === 'undefined') {
- throw new Error('undefined is not a valid uri or options object.')
+module.exports.PARSERS = {
+ geography (buffer) {
+ return parseGeography(buffer)
+ },
+
+ geometry (buffer) {
+ return parseGeography(buffer)
}
+}
- var params = initParams(uri, options, callback)
- if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
- throw new Error('HTTP HEAD requests MUST NOT include a request body.')
- }
+/***/ }),
- return new request.Request(params)
+/***/ 14178:
+/***/ ((module) => {
+
+const IDS = new WeakMap()
+const INCREMENT = {
+ Connection: 1,
+ ConnectionPool: 1,
+ Request: 1,
+ Transaction: 1,
+ PreparedStatement: 1
}
-function verbFunc (verb) {
- var method = verb.toUpperCase()
- return function (uri, options, callback) {
- var params = initParams(uri, options, callback)
- params.method = method
- return request(params, params.callback)
+module.exports = {
+ objectHasProperty: (object, property) => Object.prototype.hasOwnProperty.call(object, property),
+ INCREMENT: INCREMENT,
+ IDS: {
+ get: IDS.get.bind(IDS),
+ add: (object, type, id) => {
+ if (id) return IDS.set(object, id)
+ IDS.set(object, INCREMENT[type]++)
+ }
}
}
-// define like this to please codeintel/intellisense IDEs
-request.get = verbFunc('get')
-request.head = verbFunc('head')
-request.options = verbFunc('options')
-request.post = verbFunc('post')
-request.put = verbFunc('put')
-request.patch = verbFunc('patch')
-request.del = verbFunc('delete')
-request['delete'] = verbFunc('delete')
-request.jar = function (store) {
- return cookies.jar(store)
-}
+/***/ }),
-request.cookie = function (str) {
- return cookies.parse(str)
-}
+/***/ 73667:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-function wrapRequestMethod (method, options, requester, verb) {
- return function (uri, opts, callback) {
- var params = initParams(uri, opts, callback)
+var Classes = Object.create(null);
- var target = {}
- extend(true, target, options, params)
+/**
+ * Create a new Connection instance.
+ * @param {object|string} config Configuration or connection string for new MySQL connection
+ * @return {Connection} A new MySQL connection
+ * @public
+ */
+exports.createConnection = function createConnection(config) {
+ var Connection = loadClass('Connection');
+ var ConnectionConfig = loadClass('ConnectionConfig');
- target.pool = params.pool || options.pool
+ return new Connection({config: new ConnectionConfig(config)});
+};
- if (verb) {
- target.method = verb.toUpperCase()
- }
+/**
+ * Create a new Pool instance.
+ * @param {object|string} config Configuration or connection string for new MySQL connections
+ * @return {Pool} A new MySQL pool
+ * @public
+ */
+exports.createPool = function createPool(config) {
+ var Pool = loadClass('Pool');
+ var PoolConfig = loadClass('PoolConfig');
- if (typeof requester === 'function') {
- method = requester
- }
+ return new Pool({config: new PoolConfig(config)});
+};
- return method(target, target.callback)
- }
-}
+/**
+ * Create a new PoolCluster instance.
+ * @param {object} [config] Configuration for pool cluster
+ * @return {PoolCluster} New MySQL pool cluster
+ * @public
+ */
+exports.createPoolCluster = function createPoolCluster(config) {
+ var PoolCluster = loadClass('PoolCluster');
-request.defaults = function (options, requester) {
- var self = this
+ return new PoolCluster(config);
+};
- options = options || {}
+/**
+ * Create a new Query instance.
+ * @param {string} sql The SQL for the query
+ * @param {array} [values] Any values to insert into placeholders in sql
+ * @param {function} [callback] The callback to use when query is complete
+ * @return {Query} New query object
+ * @public
+ */
+exports.createQuery = function createQuery(sql, values, callback) {
+ var Connection = loadClass('Connection');
- if (typeof options === 'function') {
- requester = options
- options = {}
- }
+ return Connection.createQuery(sql, values, callback);
+};
- var defaults = wrapRequestMethod(self, options, requester)
+/**
+ * Escape a value for SQL.
+ * @param {*} value The value to escape
+ * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified
+ * @param {string} [timeZone=local] Setting for time zone to use for Date conversion
+ * @return {string} Escaped string value
+ * @public
+ */
+exports.escape = function escape(value, stringifyObjects, timeZone) {
+ var SqlString = loadClass('SqlString');
- var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
- verbs.forEach(function (verb) {
- defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
- })
+ return SqlString.escape(value, stringifyObjects, timeZone);
+};
- defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
- defaults.jar = self.jar
- defaults.defaults = self.defaults
- return defaults
-}
+/**
+ * Escape an identifier for SQL.
+ * @param {*} value The value to escape
+ * @param {boolean} [forbidQualified=false] Setting to treat '.' as part of identifier
+ * @return {string} Escaped string value
+ * @public
+ */
+exports.escapeId = function escapeId(value, forbidQualified) {
+ var SqlString = loadClass('SqlString');
-request.forever = function (agentOptions, optionsArg) {
- var options = {}
- if (optionsArg) {
- extend(options, optionsArg)
- }
- if (agentOptions) {
- options.agentOptions = agentOptions
- }
+ return SqlString.escapeId(value, forbidQualified);
+};
- options.forever = true
- return request.defaults(options)
-}
+/**
+ * Format SQL and replacement values into a SQL string.
+ * @param {string} sql The SQL for the query
+ * @param {array} [values] Any values to insert into placeholders in sql
+ * @param {boolean} [stringifyObjects=false] Setting if objects should be stringified
+ * @param {string} [timeZone=local] Setting for time zone to use for Date conversion
+ * @return {string} Formatted SQL string
+ * @public
+ */
+exports.format = function format(sql, values, stringifyObjects, timeZone) {
+ var SqlString = loadClass('SqlString');
-// Exports
+ return SqlString.format(sql, values, stringifyObjects, timeZone);
+};
-module.exports = request
-request.Request = __nccwpck_require__(70304)
-request.initParams = initParams
+/**
+ * Wrap raw SQL strings from escape overriding.
+ * @param {string} sql The raw SQL
+ * @return {object} Wrapped object
+ * @public
+ */
+exports.raw = function raw(sql) {
+ var SqlString = loadClass('SqlString');
-// Backwards compatibility for request.debug
-Object.defineProperty(request, 'debug', {
- enumerable: true,
- get: function () {
- return request.Request.debug
- },
- set: function (debug) {
- request.Request.debug = debug
+ return SqlString.raw(sql);
+};
+
+/**
+ * The type constants.
+ * @public
+ */
+Object.defineProperty(exports, "Types", ({
+ get: loadClass.bind(null, 'Types')
+}));
+
+/**
+ * Load the given class.
+ * @param {string} className Name of class to default
+ * @return {function|object} Class constructor or exports
+ * @private
+ */
+function loadClass(className) {
+ var Class = Classes[className];
+
+ if (Class !== undefined) {
+ return Class;
}
-})
+ // This uses a switch for static require analysis
+ switch (className) {
+ case 'Connection':
+ Class = __nccwpck_require__(76742);
+ break;
+ case 'ConnectionConfig':
+ Class = __nccwpck_require__(35551);
+ break;
+ case 'Pool':
+ Class = __nccwpck_require__(65942);
+ break;
+ case 'PoolCluster':
+ Class = __nccwpck_require__(90678);
+ break;
+ case 'PoolConfig':
+ Class = __nccwpck_require__(30002);
+ break;
+ case 'SqlString':
+ Class = __nccwpck_require__(27522);
+ break;
+ case 'Types':
+ Class = __nccwpck_require__(81699);
+ break;
+ default:
+ throw new Error('Cannot find class \'' + className + '\'');
+ }
-/***/ }),
+ // Store to prevent invoking require()
+ Classes[className] = Class;
-/***/ 76996:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ return Class;
+}
-"use strict";
+/***/ }),
-var caseless = __nccwpck_require__(35684)
-var uuid = __nccwpck_require__(71435)
-var helpers = __nccwpck_require__(74845)
+/***/ 76742:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-var md5 = helpers.md5
-var toBase64 = helpers.toBase64
+var Crypto = __nccwpck_require__(76417);
+var Events = __nccwpck_require__(28614);
+var Net = __nccwpck_require__(11631);
+var tls = __nccwpck_require__(4016);
+var ConnectionConfig = __nccwpck_require__(35551);
+var Protocol = __nccwpck_require__(23714);
+var SqlString = __nccwpck_require__(27522);
+var Query = __nccwpck_require__(1352);
+var Util = __nccwpck_require__(31669);
-function Auth (request) {
- // define all public properties here
- this.request = request
- this.hasAuth = false
- this.sentAuth = false
- this.bearerToken = null
- this.user = null
- this.pass = null
-}
+module.exports = Connection;
+Util.inherits(Connection, Events.EventEmitter);
+function Connection(options) {
+ Events.EventEmitter.call(this);
-Auth.prototype.basic = function (user, pass, sendImmediately) {
- var self = this
- if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
- self.request.emit('error', new Error('auth() received invalid user or password'))
- }
- self.user = user
- self.pass = pass
- self.hasAuth = true
- var header = user + ':' + (pass || '')
- if (sendImmediately || typeof sendImmediately === 'undefined') {
- var authHeader = 'Basic ' + toBase64(header)
- self.sentAuth = true
- return authHeader
- }
+ this.config = options.config;
+
+ this._socket = options.socket;
+ this._protocol = new Protocol({config: this.config, connection: this});
+ this._connectCalled = false;
+ this.state = 'disconnected';
+ this.threadId = null;
}
-Auth.prototype.bearer = function (bearer, sendImmediately) {
- var self = this
- self.bearerToken = bearer
- self.hasAuth = true
- if (sendImmediately || typeof sendImmediately === 'undefined') {
- if (typeof bearer === 'function') {
- bearer = bearer()
- }
- var authHeader = 'Bearer ' + (bearer || '')
- self.sentAuth = true
- return authHeader
+Connection.createQuery = function createQuery(sql, values, callback) {
+ if (sql instanceof Query) {
+ return sql;
}
-}
-Auth.prototype.digest = function (method, path, authHeader) {
- // TODO: More complete implementation of RFC 2617.
- // - handle challenge.domain
- // - support qop="auth-int" only
- // - handle Authentication-Info (not necessarily?)
- // - check challenge.stale (not necessarily?)
- // - increase nc (not necessarily?)
- // For reference:
- // http://tools.ietf.org/html/rfc2617#section-3
- // https://github.com/bagder/curl/blob/master/lib/http_digest.c
+ var cb = callback;
+ var options = {};
- var self = this
+ if (typeof sql === 'function') {
+ cb = sql;
+ } else if (typeof sql === 'object') {
+ options = Object.create(sql);
- var challenge = {}
- var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
- while (true) {
- var match = re.exec(authHeader)
- if (!match) {
- break
+ if (typeof values === 'function') {
+ cb = values;
+ } else if (values !== undefined) {
+ Object.defineProperty(options, 'values', { value: values });
}
- challenge[match[1]] = match[2] || match[3]
- }
+ } else {
+ options.sql = sql;
- /**
- * RFC 2617: handle both MD5 and MD5-sess algorithms.
- *
- * If the algorithm directive's value is "MD5" or unspecified, then HA1 is
- * HA1=MD5(username:realm:password)
- * If the algorithm directive's value is "MD5-sess", then HA1 is
- * HA1=MD5(MD5(username:realm:password):nonce:cnonce)
- */
- var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
- var ha1 = md5(user + ':' + realm + ':' + pass)
- if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
- return md5(ha1 + ':' + nonce + ':' + cnonce)
- } else {
- return ha1
+ if (typeof values === 'function') {
+ cb = values;
+ } else if (values !== undefined) {
+ options.values = values;
}
}
- var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
- var nc = qop && '00000001'
- var cnonce = qop && uuid().replace(/-/g, '')
- var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
- var ha2 = md5(method + ':' + path)
- var digestResponse = qop
- ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
- : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
- var authValues = {
- username: self.user,
- realm: challenge.realm,
- nonce: challenge.nonce,
- uri: path,
- qop: qop,
- response: digestResponse,
- nc: nc,
- cnonce: cnonce,
- algorithm: challenge.algorithm,
- opaque: challenge.opaque
- }
+ if (cb !== undefined) {
+ cb = wrapCallbackInDomain(null, cb);
- authHeader = []
- for (var k in authValues) {
- if (authValues[k]) {
- if (k === 'qop' || k === 'nc' || k === 'algorithm') {
- authHeader.push(k + '=' + authValues[k])
- } else {
- authHeader.push(k + '="' + authValues[k] + '"')
- }
+ if (cb === undefined) {
+ throw new TypeError('argument callback must be a function when provided');
}
}
- authHeader = 'Digest ' + authHeader.join(', ')
- self.sentAuth = true
- return authHeader
-}
-Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
- var self = this
- var request = self.request
+ return new Query(options, cb);
+};
- var authHeader
- if (bearer === undefined && user === undefined) {
- self.request.emit('error', new Error('no auth mechanism defined'))
- } else if (bearer !== undefined) {
- authHeader = self.bearer(bearer, sendImmediately)
- } else {
- authHeader = self.basic(user, pass, sendImmediately)
- }
- if (authHeader) {
- request.setHeader('authorization', authHeader)
+Connection.prototype.connect = function connect(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
}
-}
-Auth.prototype.onResponse = function (response) {
- var self = this
- var request = self.request
+ if (!this._connectCalled) {
+ this._connectCalled = true;
- if (!self.hasAuth || self.sentAuth) { return null }
+ // Connect either via a UNIX domain socket or a TCP socket.
+ this._socket = (this.config.socketPath)
+ ? Net.createConnection(this.config.socketPath)
+ : Net.createConnection(this.config.port, this.config.host);
- var c = caseless(response.headers)
+ // Connect socket to connection domain
+ if (Events.usingDomains) {
+ this._socket.domain = this.domain;
+ }
- var authHeader = c.get('www-authenticate')
- var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
- request.debug('reauth', authVerb)
+ var connection = this;
+ this._protocol.on('data', function(data) {
+ connection._socket.write(data);
+ });
+ this._socket.on('data', wrapToDomain(connection, function (data) {
+ connection._protocol.write(data);
+ }));
+ this._protocol.on('end', function() {
+ connection._socket.end();
+ });
+ this._socket.on('end', wrapToDomain(connection, function () {
+ connection._protocol.end();
+ }));
- switch (authVerb) {
- case 'basic':
- return self.basic(self.user, self.pass, true)
+ this._socket.on('error', this._handleNetworkError.bind(this));
+ this._socket.on('connect', this._handleProtocolConnect.bind(this));
+ this._protocol.on('handshake', this._handleProtocolHandshake.bind(this));
+ this._protocol.on('initialize', this._handleProtocolInitialize.bind(this));
+ this._protocol.on('unhandledError', this._handleProtocolError.bind(this));
+ this._protocol.on('drain', this._handleProtocolDrain.bind(this));
+ this._protocol.on('end', this._handleProtocolEnd.bind(this));
+ this._protocol.on('enqueue', this._handleProtocolEnqueue.bind(this));
- case 'bearer':
- return self.bearer(self.bearerToken, true)
+ if (this.config.connectTimeout) {
+ var handleConnectTimeout = this._handleConnectTimeout.bind(this);
- case 'digest':
- return self.digest(request.method, request.path, authHeader)
+ this._socket.setTimeout(this.config.connectTimeout, handleConnectTimeout);
+ this._socket.once('connect', function() {
+ this.setTimeout(0, handleConnectTimeout);
+ });
+ }
}
-}
-exports.g = Auth
+ this._protocol.handshake(options, wrapCallbackInDomain(this, callback));
+};
+Connection.prototype.changeUser = function changeUser(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
-/***/ }),
+ this._implyConnect();
-/***/ 50976:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ var charsetNumber = (options.charset)
+ ? ConnectionConfig.getCharsetNumber(options.charset)
+ : this.config.charsetNumber;
-"use strict";
+ return this._protocol.changeUser({
+ user : options.user || this.config.user,
+ password : options.password || this.config.password,
+ database : options.database || this.config.database,
+ timeout : options.timeout,
+ charsetNumber : charsetNumber,
+ currentConfig : this.config
+ }, wrapCallbackInDomain(this, callback));
+};
+Connection.prototype.beginTransaction = function beginTransaction(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
-var tough = __nccwpck_require__(47279)
+ options = options || {};
+ options.sql = 'START TRANSACTION';
+ options.values = null;
-var Cookie = tough.Cookie
-var CookieJar = tough.CookieJar
+ return this.query(options, callback);
+};
-exports.parse = function (str) {
- if (str && str.uri) {
- str = str.uri
- }
- if (typeof str !== 'string') {
- throw new Error('The cookie function only accepts STRING as param')
+Connection.prototype.commit = function commit(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
}
- return Cookie.parse(str, {loose: true})
-}
-
-// Adapt the sometimes-Async api of tough.CookieJar to our requirements
-function RequestJar (store) {
- var self = this
- self._jar = new CookieJar(store, {looseMode: true})
-}
-RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
- var self = this
- return self._jar.setCookieSync(cookieOrStr, uri, options || {})
-}
-RequestJar.prototype.getCookieString = function (uri) {
- var self = this
- return self._jar.getCookieStringSync(uri)
-}
-RequestJar.prototype.getCookies = function (uri) {
- var self = this
- return self._jar.getCookiesSync(uri)
-}
-
-exports.jar = function (store) {
- return new RequestJar(store)
-}
+ options = options || {};
+ options.sql = 'COMMIT';
+ options.values = null;
-/***/ }),
+ return this.query(options, callback);
+};
-/***/ 75654:
-/***/ ((module) => {
+Connection.prototype.rollback = function rollback(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
-"use strict";
+ options = options || {};
+ options.sql = 'ROLLBACK';
+ options.values = null;
+ return this.query(options, callback);
+};
-function formatHostname (hostname) {
- // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
- return hostname.replace(/^\.*/, '.').toLowerCase()
-}
+Connection.prototype.query = function query(sql, values, cb) {
+ var query = Connection.createQuery(sql, values, cb);
+ query._connection = this;
-function parseNoProxyZone (zone) {
- zone = zone.trim().toLowerCase()
+ if (!(typeof sql === 'object' && 'typeCast' in sql)) {
+ query.typeCast = this.config.typeCast;
+ }
- var zoneParts = zone.split(':', 2)
- var zoneHost = formatHostname(zoneParts[0])
- var zonePort = zoneParts[1]
- var hasPort = zone.indexOf(':') > -1
+ if (query.sql) {
+ query.sql = this.format(query.sql, query.values);
+ }
- return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
-}
+ if (query._callback) {
+ query._callback = wrapCallbackInDomain(this, query._callback);
+ }
-function uriInNoProxy (uri, noProxy) {
- var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
- var hostname = formatHostname(uri.hostname)
- var noProxyList = noProxy.split(',')
+ this._implyConnect();
- // iterate through the noProxyList until it finds a match.
- return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
- var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
- var hostnameMatched = (
- isMatchedAt > -1 &&
- (isMatchedAt === hostname.length - noProxyZone.hostname.length)
- )
+ return this._protocol._enqueue(query);
+};
- if (noProxyZone.hasPort) {
- return (port === noProxyZone.port) && hostnameMatched
- }
+Connection.prototype.ping = function ping(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
- return hostnameMatched
- })
-}
+ this._implyConnect();
+ this._protocol.ping(options, wrapCallbackInDomain(this, callback));
+};
-function getProxyFromURI (uri) {
- // Decide the proper request proxy to use based on the request URI object and the
- // environmental variables (NO_PROXY, HTTP_PROXY, etc.)
- // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)
+Connection.prototype.statistics = function statistics(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
- var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
+ this._implyConnect();
+ this._protocol.stats(options, wrapCallbackInDomain(this, callback));
+};
- // if the noProxy is a wildcard then return null
+Connection.prototype.end = function end(options, callback) {
+ var cb = callback;
+ var opts = options;
- if (noProxy === '*') {
- return null
+ if (!callback && typeof options === 'function') {
+ cb = options;
+ opts = null;
}
- // if the noProxy is not empty and the uri is found return null
+ // create custom options reference
+ opts = Object.create(opts || null);
- if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
- return null
+ if (opts.timeout === undefined) {
+ // default timeout of 30 seconds
+ opts.timeout = 30000;
}
- // Check for HTTP or HTTPS Proxy in environment Else default to null
+ this._implyConnect();
+ this._protocol.quit(opts, wrapCallbackInDomain(this, cb));
+};
- if (uri.protocol === 'http:') {
- return process.env.HTTP_PROXY ||
- process.env.http_proxy || null
- }
+Connection.prototype.destroy = function() {
+ this.state = 'disconnected';
+ this._implyConnect();
+ this._socket.destroy();
+ this._protocol.destroy();
+};
- if (uri.protocol === 'https:') {
- return process.env.HTTPS_PROXY ||
- process.env.https_proxy ||
- process.env.HTTP_PROXY ||
- process.env.http_proxy || null
- }
+Connection.prototype.pause = function() {
+ this._socket.pause();
+ this._protocol.pause();
+};
- // if none of that works, return null
- // (What uri protocol are you using then?)
+Connection.prototype.resume = function() {
+ this._socket.resume();
+ this._protocol.resume();
+};
- return null
-}
+Connection.prototype.escape = function(value) {
+ return SqlString.escape(value, false, this.config.timezone);
+};
-module.exports = getProxyFromURI
+Connection.prototype.escapeId = function escapeId(value) {
+ return SqlString.escapeId(value, false);
+};
+Connection.prototype.format = function(sql, values) {
+ if (typeof this.config.queryFormat === 'function') {
+ return this.config.queryFormat.call(this, sql, values, this.config.timezone);
+ }
+ return SqlString.format(sql, values, this.config.stringifyObjects, this.config.timezone);
+};
-/***/ }),
+if (tls.TLSSocket) {
+ // 0.11+ environment
+ Connection.prototype._startTLS = function _startTLS(onSecure) {
+ var connection = this;
-/***/ 3248:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ createSecureContext(this.config, function (err, secureContext) {
+ if (err) {
+ onSecure(err);
+ return;
+ }
-"use strict";
+ // "unpipe"
+ connection._socket.removeAllListeners('data');
+ connection._protocol.removeAllListeners('data');
+ // socket <-> encrypted
+ var rejectUnauthorized = connection.config.ssl.rejectUnauthorized;
+ var secureEstablished = false;
+ var secureSocket = new tls.TLSSocket(connection._socket, {
+ rejectUnauthorized : rejectUnauthorized,
+ requestCert : true,
+ secureContext : secureContext,
+ isServer : false
+ });
-var fs = __nccwpck_require__(35747)
-var qs = __nccwpck_require__(71191)
-var validate = __nccwpck_require__(75697)
-var extend = __nccwpck_require__(38171)
+ // error handler for secure socket
+ secureSocket.on('_tlsError', function(err) {
+ if (secureEstablished) {
+ connection._handleNetworkError(err);
+ } else {
+ onSecure(err);
+ }
+ });
-function Har (request) {
- this.request = request
-}
+ // cleartext <-> protocol
+ secureSocket.pipe(connection._protocol);
+ connection._protocol.on('data', function(data) {
+ secureSocket.write(data);
+ });
-Har.prototype.reducer = function (obj, pair) {
- // new property ?
- if (obj[pair.name] === undefined) {
- obj[pair.name] = pair.value
- return obj
- }
+ secureSocket.on('secure', function() {
+ secureEstablished = true;
- // existing? convert to array
- var arr = [
- obj[pair.name],
- pair.value
- ]
+ onSecure(rejectUnauthorized ? this.ssl.verifyError() : null);
+ });
- obj[pair.name] = arr
+ // start TLS communications
+ secureSocket._start();
+ });
+ };
+} else {
+ // pre-0.11 environment
+ Connection.prototype._startTLS = function _startTLS(onSecure) {
+ // before TLS:
+ // _socket <-> _protocol
+ // after:
+ // _socket <-> securePair.encrypted <-> securePair.cleartext <-> _protocol
- return obj
-}
+ var connection = this;
+ var credentials = Crypto.createCredentials({
+ ca : this.config.ssl.ca,
+ cert : this.config.ssl.cert,
+ ciphers : this.config.ssl.ciphers,
+ key : this.config.ssl.key,
+ passphrase : this.config.ssl.passphrase
+ });
-Har.prototype.prep = function (data) {
- // construct utility properties
- data.queryObj = {}
- data.headersObj = {}
- data.postData.jsonObj = false
- data.postData.paramsObj = false
+ var rejectUnauthorized = this.config.ssl.rejectUnauthorized;
+ var secureEstablished = false;
+ var securePair = tls.createSecurePair(credentials, false, true, rejectUnauthorized);
- // construct query objects
- if (data.queryString && data.queryString.length) {
- data.queryObj = data.queryString.reduce(this.reducer, {})
- }
+ // error handler for secure pair
+ securePair.on('error', function(err) {
+ if (secureEstablished) {
+ connection._handleNetworkError(err);
+ } else {
+ onSecure(err);
+ }
+ });
- // construct headers objects
- if (data.headers && data.headers.length) {
- // loweCase header keys
- data.headersObj = data.headers.reduceRight(function (headers, header) {
- headers[header.name] = header.value
- return headers
- }, {})
- }
+ // "unpipe"
+ this._socket.removeAllListeners('data');
+ this._protocol.removeAllListeners('data');
- // construct Cookie header
- if (data.cookies && data.cookies.length) {
- var cookies = data.cookies.map(function (cookie) {
- return cookie.name + '=' + cookie.value
- })
+ // socket <-> encrypted
+ securePair.encrypted.pipe(this._socket);
+ this._socket.on('data', function(data) {
+ securePair.encrypted.write(data);
+ });
- if (cookies.length) {
- data.headersObj.cookie = cookies.join('; ')
- }
- }
+ // cleartext <-> protocol
+ securePair.cleartext.pipe(this._protocol);
+ this._protocol.on('data', function(data) {
+ securePair.cleartext.write(data);
+ });
- // prep body
- function some (arr) {
- return arr.some(function (type) {
- return data.postData.mimeType.indexOf(type) === 0
- })
- }
+ // secure established
+ securePair.on('secure', function() {
+ secureEstablished = true;
- if (some([
- 'multipart/mixed',
- 'multipart/related',
- 'multipart/form-data',
- 'multipart/alternative'])) {
- // reset values
- data.postData.mimeType = 'multipart/form-data'
- } else if (some([
- 'application/x-www-form-urlencoded'])) {
- if (!data.postData.params) {
- data.postData.text = ''
- } else {
- data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
+ if (!rejectUnauthorized) {
+ onSecure();
+ return;
+ }
- // always overwrite
- data.postData.text = qs.stringify(data.postData.paramsObj)
- }
- } else if (some([
- 'text/json',
- 'text/x-json',
- 'application/json',
- 'application/x-json'])) {
- data.postData.mimeType = 'application/json'
+ var verifyError = this.ssl.verifyError();
+ var err = verifyError;
- if (data.postData.text) {
- try {
- data.postData.jsonObj = JSON.parse(data.postData.text)
- } catch (e) {
- this.request.debug(e)
+ // node.js 0.6 support
+ if (typeof err === 'string') {
+ err = new Error(verifyError);
+ err.code = verifyError;
+ }
- // force back to text/plain
- data.postData.mimeType = 'text/plain'
+ onSecure(err);
+ });
+
+ // node.js 0.8 bug
+ securePair._cycle = securePair.cycle;
+ securePair.cycle = function cycle() {
+ if (this.ssl && this.ssl.error) {
+ this.error();
}
- }
- }
- return data
+ return this._cycle.apply(this, arguments);
+ };
+ };
}
-Har.prototype.options = function (options) {
- // skip if no har property defined
- if (!options.har) {
- return options
+Connection.prototype._handleConnectTimeout = function() {
+ if (this._socket) {
+ this._socket.setTimeout(0);
+ this._socket.destroy();
}
- var har = {}
- extend(har, options.har)
+ var err = new Error('connect ETIMEDOUT');
+ err.errorno = 'ETIMEDOUT';
+ err.code = 'ETIMEDOUT';
+ err.syscall = 'connect';
- // only process the first entry
- if (har.log && har.log.entries) {
- har = har.log.entries[0]
- }
+ this._handleNetworkError(err);
+};
- // add optional properties to make validation successful
- har.url = har.url || options.url || options.uri || options.baseUrl || '/'
- har.httpVersion = har.httpVersion || 'HTTP/1.1'
- har.queryString = har.queryString || []
- har.headers = har.headers || []
- har.cookies = har.cookies || []
- har.postData = har.postData || {}
- har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
+Connection.prototype._handleNetworkError = function(err) {
+ this._protocol.handleNetworkError(err);
+};
- har.bodySize = 0
- har.headersSize = 0
- har.postData.size = 0
+Connection.prototype._handleProtocolError = function(err) {
+ this.state = 'protocol_error';
+ this.emit('error', err);
+};
- if (!validate.request(har)) {
- return options
- }
+Connection.prototype._handleProtocolDrain = function() {
+ this.emit('drain');
+};
- // clean up and get some utility properties
- var req = this.prep(har)
+Connection.prototype._handleProtocolConnect = function() {
+ this.state = 'connected';
+ this.emit('connect');
+};
- // construct new options
- if (req.url) {
- options.url = req.url
- }
+Connection.prototype._handleProtocolHandshake = function _handleProtocolHandshake() {
+ this.state = 'authenticated';
+};
- if (req.method) {
- options.method = req.method
- }
+Connection.prototype._handleProtocolInitialize = function _handleProtocolInitialize(packet) {
+ this.threadId = packet.threadId;
+};
- if (Object.keys(req.queryObj).length) {
- options.qs = req.queryObj
- }
+Connection.prototype._handleProtocolEnd = function(err) {
+ this.state = 'disconnected';
+ this.emit('end', err);
+};
- if (Object.keys(req.headersObj).length) {
- options.headers = req.headersObj
+Connection.prototype._handleProtocolEnqueue = function _handleProtocolEnqueue(sequence) {
+ this.emit('enqueue', sequence);
+};
+
+Connection.prototype._implyConnect = function() {
+ if (!this._connectCalled) {
+ this.connect();
}
+};
- function test (type) {
- return req.postData.mimeType.indexOf(type) === 0
+function createSecureContext (config, cb) {
+ var context = null;
+ var error = null;
+
+ try {
+ context = tls.createSecureContext({
+ ca : config.ssl.ca,
+ cert : config.ssl.cert,
+ ciphers : config.ssl.ciphers,
+ key : config.ssl.key,
+ passphrase : config.ssl.passphrase
+ });
+ } catch (err) {
+ error = err;
}
- if (test('application/x-www-form-urlencoded')) {
- options.form = req.postData.paramsObj
- } else if (test('application/json')) {
- if (req.postData.jsonObj) {
- options.body = req.postData.jsonObj
- options.json = true
+
+ cb(error, context);
+}
+
+function unwrapFromDomain(fn) {
+ return function () {
+ var domains = [];
+ var ret;
+
+ while (process.domain) {
+ domains.shift(process.domain);
+ process.domain.exit();
+ }
+
+ try {
+ ret = fn.apply(this, arguments);
+ } finally {
+ for (var i = 0; i < domains.length; i++) {
+ domains[i].enter();
+ }
}
- } else if (test('multipart/form-data')) {
- options.formData = {}
- req.postData.params.forEach(function (param) {
- var attachment = {}
+ return ret;
+ };
+}
- if (!param.fileName && !param.contentType) {
- options.formData[param.name] = param.value
- return
- }
+function wrapCallbackInDomain(ee, fn) {
+ if (typeof fn !== 'function') {
+ return undefined;
+ }
- // attempt to read from disk!
- if (param.fileName && !param.value) {
- attachment.value = fs.createReadStream(param.fileName)
- } else if (param.value) {
- attachment.value = param.value
- }
+ if (fn.domain) {
+ return fn;
+ }
- if (param.fileName) {
- attachment.options = {
- filename: param.fileName,
- contentType: param.contentType ? param.contentType : null
- }
- }
+ var domain = process.domain;
- options.formData[param.name] = attachment
- })
+ if (domain) {
+ return domain.bind(fn);
+ } else if (ee) {
+ return unwrapFromDomain(wrapToDomain(ee, fn));
} else {
- if (req.postData.text) {
- options.body = req.postData.text
- }
+ return fn;
}
-
- return options
}
-exports.t = Har
+function wrapToDomain(ee, fn) {
+ return function () {
+ if (Events.usingDomains && ee.domain) {
+ ee.domain.enter();
+ fn.apply(this, arguments);
+ ee.domain.exit();
+ } else {
+ fn.apply(this, arguments);
+ }
+ };
+}
/***/ }),
-/***/ 34473:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 35551:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+var urlParse = __nccwpck_require__(78835).parse;
+var ClientConstants = __nccwpck_require__(5427);
+var Charsets = __nccwpck_require__(30124);
+var SSLProfiles = null;
+
+module.exports = ConnectionConfig;
+function ConnectionConfig(options) {
+ if (typeof options === 'string') {
+ options = ConnectionConfig.parseUrl(options);
+ }
+
+ this.host = options.host || 'localhost';
+ this.port = options.port || 3306;
+ this.localAddress = options.localAddress;
+ this.socketPath = options.socketPath;
+ this.user = options.user || undefined;
+ this.password = options.password || undefined;
+ this.database = options.database;
+ this.connectTimeout = (options.connectTimeout === undefined)
+ ? (10 * 1000)
+ : options.connectTimeout;
+ this.insecureAuth = options.insecureAuth || false;
+ this.supportBigNumbers = options.supportBigNumbers || false;
+ this.bigNumberStrings = options.bigNumberStrings || false;
+ this.dateStrings = options.dateStrings || false;
+ this.debug = options.debug;
+ this.trace = options.trace !== false;
+ this.stringifyObjects = options.stringifyObjects || false;
+ this.timezone = options.timezone || 'local';
+ this.flags = options.flags || '';
+ this.queryFormat = options.queryFormat;
+ this.pool = options.pool || undefined;
+ this.ssl = (typeof options.ssl === 'string')
+ ? ConnectionConfig.getSSLProfile(options.ssl)
+ : (options.ssl || false);
+ this.localInfile = (options.localInfile === undefined)
+ ? true
+ : options.localInfile;
+ this.multipleStatements = options.multipleStatements || false;
+ this.typeCast = (options.typeCast === undefined)
+ ? true
+ : options.typeCast;
+ if (this.timezone[0] === ' ') {
+ // "+" is a url encoded char for space so it
+ // gets translated to space when giving a
+ // connection string..
+ this.timezone = '+' + this.timezone.substr(1);
+ }
-var crypto = __nccwpck_require__(76417)
+ if (this.ssl) {
+ // Default rejectUnauthorized to true
+ this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false;
+ }
-function randomString (size) {
- var bits = (size + 1) * 6
- var buffer = crypto.randomBytes(Math.ceil(bits / 8))
- var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
- return string.slice(0, size)
-}
+ this.maxPacketSize = 0;
+ this.charsetNumber = (options.charset)
+ ? ConnectionConfig.getCharsetNumber(options.charset)
+ : options.charsetNumber || Charsets.UTF8_GENERAL_CI;
-function calculatePayloadHash (payload, algorithm, contentType) {
- var hash = crypto.createHash(algorithm)
- hash.update('hawk.1.payload\n')
- hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n')
- hash.update(payload || '')
- hash.update('\n')
- return hash.digest('base64')
+ // Set the client flags
+ var defaultFlags = ConnectionConfig.getDefaultFlags(options);
+ this.clientFlags = ConnectionConfig.mergeFlags(defaultFlags, options.flags);
}
-exports.calculateMac = function (credentials, opts) {
- var normalized = 'hawk.1.header\n' +
- opts.ts + '\n' +
- opts.nonce + '\n' +
- (opts.method || '').toUpperCase() + '\n' +
- opts.resource + '\n' +
- opts.host.toLowerCase() + '\n' +
- opts.port + '\n' +
- (opts.hash || '') + '\n'
+ConnectionConfig.mergeFlags = function mergeFlags(defaultFlags, userFlags) {
+ var allFlags = ConnectionConfig.parseFlagList(defaultFlags);
+ var newFlags = ConnectionConfig.parseFlagList(userFlags);
- if (opts.ext) {
- normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n')
+ // Merge the new flags
+ for (var flag in newFlags) {
+ if (allFlags[flag] !== false) {
+ allFlags[flag] = newFlags[flag];
+ }
}
- normalized = normalized + '\n'
-
- if (opts.app) {
- normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n'
+ // Build flags
+ var flags = 0x0;
+ for (var flag in allFlags) {
+ if (allFlags[flag]) {
+ // TODO: Throw here on some future release
+ flags |= ClientConstants['CLIENT_' + flag] || 0x0;
+ }
}
- var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)
- var digest = hmac.digest('base64')
- return digest
-}
+ return flags;
+};
-exports.header = function (uri, method, opts) {
- var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)
- var credentials = opts.credentials
- if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
- return ''
- }
+ConnectionConfig.getCharsetNumber = function getCharsetNumber(charset) {
+ var num = Charsets[charset.toUpperCase()];
- if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {
- return ''
+ if (num === undefined) {
+ throw new TypeError('Unknown charset \'' + charset + '\'');
}
- var artifacts = {
- ts: timestamp,
- nonce: opts.nonce || randomString(6),
- method: method,
- resource: uri.pathname + (uri.search || ''),
- host: uri.hostname,
- port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
- hash: opts.hash,
- ext: opts.ext,
- app: opts.app,
- dlg: opts.dlg
- }
+ return num;
+};
- if (!artifacts.hash && (opts.payload || opts.payload === '')) {
- artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)
+ConnectionConfig.getDefaultFlags = function getDefaultFlags(options) {
+ var defaultFlags = [
+ '-COMPRESS', // Compression protocol *NOT* supported
+ '-CONNECT_ATTRS', // Does *NOT* send connection attributes in Protocol::HandshakeResponse41
+ '+CONNECT_WITH_DB', // One can specify db on connect in Handshake Response Packet
+ '+FOUND_ROWS', // Send found rows instead of affected rows
+ '+IGNORE_SIGPIPE', // Don't issue SIGPIPE if network failures
+ '+IGNORE_SPACE', // Let the parser ignore spaces before '('
+ '+LOCAL_FILES', // Can use LOAD DATA LOCAL
+ '+LONG_FLAG', // Longer flags in Protocol::ColumnDefinition320
+ '+LONG_PASSWORD', // Use the improved version of Old Password Authentication
+ '+MULTI_RESULTS', // Can handle multiple resultsets for COM_QUERY
+ '+ODBC', // Special handling of ODBC behaviour
+ '-PLUGIN_AUTH', // Does *NOT* support auth plugins
+ '+PROTOCOL_41', // Uses the 4.1 protocol
+ '+PS_MULTI_RESULTS', // Can handle multiple resultsets for COM_STMT_EXECUTE
+ '+RESERVED', // Unused
+ '+SECURE_CONNECTION', // Supports Authentication::Native41
+ '+TRANSACTIONS' // Expects status flags
+ ];
+
+ if (options && options.localInfile !== undefined && !options.localInfile) {
+ // Disable LOCAL modifier for LOAD DATA INFILE
+ defaultFlags.push('-LOCAL_FILES');
}
- var mac = exports.calculateMac(credentials, artifacts)
+ if (options && options.multipleStatements) {
+ // May send multiple statements per COM_QUERY and COM_STMT_PREPARE
+ defaultFlags.push('+MULTI_STATEMENTS');
+ }
- var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''
- var header = 'Hawk id="' + credentials.id +
- '", ts="' + artifacts.ts +
- '", nonce="' + artifacts.nonce +
- (artifacts.hash ? '", hash="' + artifacts.hash : '') +
- (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
- '", mac="' + mac + '"'
+ return defaultFlags;
+};
- if (artifacts.app) {
- header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'
+ConnectionConfig.getSSLProfile = function getSSLProfile(name) {
+ if (!SSLProfiles) {
+ SSLProfiles = __nccwpck_require__(3061);
}
- return header
-}
+ var ssl = SSLProfiles[name];
+ if (ssl === undefined) {
+ throw new TypeError('Unknown SSL profile \'' + name + '\'');
+ }
-/***/ }),
+ return ssl;
+};
-/***/ 74845:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ConnectionConfig.parseFlagList = function parseFlagList(flagList) {
+ var allFlags = Object.create(null);
-"use strict";
+ if (!flagList) {
+ return allFlags;
+ }
+ var flags = !Array.isArray(flagList)
+ ? String(flagList || '').toUpperCase().split(/\s*,+\s*/)
+ : flagList;
-var jsonSafeStringify = __nccwpck_require__(57073)
-var crypto = __nccwpck_require__(76417)
-var Buffer = __nccwpck_require__(21867).Buffer
+ for (var i = 0; i < flags.length; i++) {
+ var flag = flags[i];
+ var offset = 1;
+ var state = flag[0];
-var defer = typeof setImmediate === 'undefined'
- ? process.nextTick
- : setImmediate
+ if (state === undefined) {
+ // TODO: throw here on some future release
+ continue;
+ }
-function paramsHaveRequestBody (params) {
- return (
- params.body ||
- params.requestBodyStream ||
- (params.json && typeof params.json !== 'boolean') ||
- params.multipart
- )
-}
+ if (state !== '-' && state !== '+') {
+ offset = 0;
+ state = '+';
+ }
-function safeStringify (obj, replacer) {
- var ret
- try {
- ret = JSON.stringify(obj, replacer)
- } catch (e) {
- ret = jsonSafeStringify(obj, replacer)
+ allFlags[flag.substr(offset)] = state === '+';
}
- return ret
-}
-function md5 (str) {
- return crypto.createHash('md5').update(str).digest('hex')
-}
+ return allFlags;
+};
-function isReadStream (rs) {
- return rs.readable && rs.path && rs.mode
-}
+ConnectionConfig.parseUrl = function(url) {
+ url = urlParse(url, true);
-function toBase64 (str) {
- return Buffer.from(str || '', 'utf8').toString('base64')
-}
+ var options = {
+ host : url.hostname,
+ port : url.port,
+ database : url.pathname.substr(1)
+ };
-function copy (obj) {
- var o = {}
- Object.keys(obj).forEach(function (i) {
- o[i] = obj[i]
- })
- return o
-}
+ if (url.auth) {
+ var auth = url.auth.split(':');
+ options.user = auth.shift();
+ options.password = auth.join(':');
+ }
-function version () {
- var numbers = process.version.replace('v', '').split('.')
- return {
- major: parseInt(numbers[0], 10),
- minor: parseInt(numbers[1], 10),
- patch: parseInt(numbers[2], 10)
+ if (url.query) {
+ for (var key in url.query) {
+ var value = url.query[key];
+
+ try {
+ // Try to parse this as a JSON expression first
+ options[key] = JSON.parse(value);
+ } catch (err) {
+ // Otherwise assume it is a plain string
+ options[key] = value;
+ }
+ }
}
-}
-exports.paramsHaveRequestBody = paramsHaveRequestBody
-exports.safeStringify = safeStringify
-exports.md5 = md5
-exports.isReadStream = isReadStream
-exports.toBase64 = toBase64
-exports.copy = copy
-exports.version = version
-exports.defer = defer
+ return options;
+};
/***/ }),
-/***/ 87810:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 65942:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
+var mysql = __nccwpck_require__(73667);
+var Connection = __nccwpck_require__(76742);
+var EventEmitter = __nccwpck_require__(28614).EventEmitter;
+var Util = __nccwpck_require__(31669);
+var PoolConnection = __nccwpck_require__(10378);
+module.exports = Pool;
-var uuid = __nccwpck_require__(71435)
-var CombinedStream = __nccwpck_require__(85443)
-var isstream = __nccwpck_require__(83362)
-var Buffer = __nccwpck_require__(21867).Buffer
+Util.inherits(Pool, EventEmitter);
+function Pool(options) {
+ EventEmitter.call(this);
+ this.config = options.config;
+ this.config.connectionConfig.pool = this;
-function Multipart (request) {
- this.request = request
- this.boundary = uuid()
- this.chunked = false
- this.body = null
+ this._acquiringConnections = [];
+ this._allConnections = [];
+ this._freeConnections = [];
+ this._connectionQueue = [];
+ this._closed = false;
}
-Multipart.prototype.isChunked = function (options) {
- var self = this
- var chunked = false
- var parts = options.data || options
+Pool.prototype.getConnection = function (cb) {
- if (!parts.forEach) {
- self.request.emit('error', new Error('Argument error, options.multipart.'))
+ if (this._closed) {
+ var err = new Error('Pool is closed.');
+ err.code = 'POOL_CLOSED';
+ process.nextTick(function () {
+ cb(err);
+ });
+ return;
}
- if (options.chunked !== undefined) {
- chunked = options.chunked
- }
+ var connection;
+ var pool = this;
- if (self.request.getHeader('transfer-encoding') === 'chunked') {
- chunked = true
+ if (this._freeConnections.length > 0) {
+ connection = this._freeConnections.shift();
+ this.acquireConnection(connection, cb);
+ return;
}
- if (!chunked) {
- parts.forEach(function (part) {
- if (typeof part.body === 'undefined') {
- self.request.emit('error', new Error('Body attribute missing in multipart.'))
+ if (this.config.connectionLimit === 0 || this._allConnections.length < this.config.connectionLimit) {
+ connection = new PoolConnection(this, { config: this.config.newConnectionConfig() });
+
+ this._acquiringConnections.push(connection);
+ this._allConnections.push(connection);
+
+ connection.connect({timeout: this.config.acquireTimeout}, function onConnect(err) {
+ spliceConnection(pool._acquiringConnections, connection);
+
+ if (pool._closed) {
+ err = new Error('Pool is closed.');
+ err.code = 'POOL_CLOSED';
}
- if (isstream(part.body)) {
- chunked = true
+
+ if (err) {
+ pool._purgeConnection(connection);
+ cb(err);
+ return;
}
- })
+
+ pool.emit('connection', connection);
+ pool.emit('acquire', connection);
+ cb(null, connection);
+ });
+ return;
}
- return chunked
-}
+ if (!this.config.waitForConnections) {
+ process.nextTick(function(){
+ var err = new Error('No connections available.');
+ err.code = 'POOL_CONNLIMIT';
+ cb(err);
+ });
+ return;
+ }
-Multipart.prototype.setHeaders = function (chunked) {
- var self = this
+ this._enqueueCallback(cb);
+};
- if (chunked && !self.request.hasHeader('transfer-encoding')) {
- self.request.setHeader('transfer-encoding', 'chunked')
+Pool.prototype.acquireConnection = function acquireConnection(connection, cb) {
+ if (connection._pool !== this) {
+ throw new Error('Connection acquired from wrong pool.');
}
- var header = self.request.getHeader('content-type')
+ var changeUser = this._needsChangeUser(connection);
+ var pool = this;
- if (!header || header.indexOf('multipart') === -1) {
- self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
- } else {
- if (header.indexOf('boundary') !== -1) {
- self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
- } else {
- self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
+ this._acquiringConnections.push(connection);
+
+ function onOperationComplete(err) {
+ spliceConnection(pool._acquiringConnections, connection);
+
+ if (pool._closed) {
+ err = new Error('Pool is closed.');
+ err.code = 'POOL_CLOSED';
}
- }
-}
-Multipart.prototype.build = function (parts, chunked) {
- var self = this
- var body = chunked ? new CombinedStream() : []
+ if (err) {
+ pool._connectionQueue.unshift(cb);
+ pool._purgeConnection(connection);
+ return;
+ }
- function add (part) {
- if (typeof part === 'number') {
- part = part.toString()
+ if (changeUser) {
+ pool.emit('connection', connection);
}
- return chunked ? body.append(part) : body.push(Buffer.from(part))
- }
- if (self.request.preambleCRLF) {
- add('\r\n')
+ pool.emit('acquire', connection);
+ cb(null, connection);
}
- parts.forEach(function (part) {
- var preamble = '--' + self.boundary + '\r\n'
- Object.keys(part).forEach(function (key) {
- if (key === 'body') { return }
- preamble += key + ': ' + part[key] + '\r\n'
- })
- preamble += '\r\n'
- add(preamble)
- add(part.body)
- add('\r\n')
- })
- add('--' + self.boundary + '--')
-
- if (self.request.postambleCRLF) {
- add('\r\n')
+ if (changeUser) {
+ // restore user back to pool configuration
+ connection.config = this.config.newConnectionConfig();
+ connection.changeUser({timeout: this.config.acquireTimeout}, onOperationComplete);
+ } else {
+ // ping connection
+ connection.ping({timeout: this.config.acquireTimeout}, onOperationComplete);
}
+};
- return body
-}
+Pool.prototype.releaseConnection = function releaseConnection(connection) {
-Multipart.prototype.onRequest = function (options) {
- var self = this
+ if (this._acquiringConnections.indexOf(connection) !== -1) {
+ // connection is being acquired
+ return;
+ }
- var chunked = self.isChunked(options)
- var parts = options.data || options
+ if (connection._pool) {
+ if (connection._pool !== this) {
+ throw new Error('Connection released to wrong pool');
+ }
- self.setHeaders(chunked)
- self.chunked = chunked
- self.body = self.build(parts, chunked)
-}
+ if (this._freeConnections.indexOf(connection) !== -1) {
+ // connection already in free connection pool
+ // this won't catch all double-release cases
+ throw new Error('Connection already released');
+ } else {
+ // add connection to end of free queue
+ this._freeConnections.push(connection);
+ this.emit('release', connection);
+ }
+ }
-exports.$ = Multipart
+ if (this._closed) {
+ // empty the connection queue
+ this._connectionQueue.splice(0).forEach(function (cb) {
+ var err = new Error('Pool is closed.');
+ err.code = 'POOL_CLOSED';
+ process.nextTick(function () {
+ cb(err);
+ });
+ });
+ } else if (this._connectionQueue.length) {
+ // get connection with next waiting callback
+ this.getConnection(this._connectionQueue.shift());
+ }
+};
+Pool.prototype.end = function (cb) {
+ this._closed = true;
-/***/ }),
+ if (typeof cb !== 'function') {
+ cb = function (err) {
+ if (err) throw err;
+ };
+ }
-/***/ 41174:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ var calledBack = false;
+ var waitingClose = 0;
-"use strict";
+ function onEnd(err) {
+ if (!calledBack && (err || --waitingClose <= 0)) {
+ calledBack = true;
+ cb(err);
+ }
+ }
+ while (this._allConnections.length !== 0) {
+ waitingClose++;
+ this._purgeConnection(this._allConnections[0], onEnd);
+ }
-var url = __nccwpck_require__(78835)
-var qs = __nccwpck_require__(22760)
-var caseless = __nccwpck_require__(35684)
-var uuid = __nccwpck_require__(71435)
-var oauth = __nccwpck_require__(43248)
-var crypto = __nccwpck_require__(76417)
-var Buffer = __nccwpck_require__(21867).Buffer
+ if (waitingClose === 0) {
+ process.nextTick(onEnd);
+ }
+};
-function OAuth (request) {
- this.request = request
- this.params = null
-}
+Pool.prototype.query = function (sql, values, cb) {
+ var query = Connection.createQuery(sql, values, cb);
-OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
- var oa = {}
- for (var i in _oauth) {
- oa['oauth_' + i] = _oauth[i]
- }
- if (!oa.oauth_version) {
- oa.oauth_version = '1.0'
- }
- if (!oa.oauth_timestamp) {
- oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
- }
- if (!oa.oauth_nonce) {
- oa.oauth_nonce = uuid().replace(/-/g, '')
+ if (!(typeof sql === 'object' && 'typeCast' in sql)) {
+ query.typeCast = this.config.connectionConfig.typeCast;
}
- if (!oa.oauth_signature_method) {
- oa.oauth_signature_method = 'HMAC-SHA1'
+
+ if (this.config.connectionConfig.trace) {
+ // Long stack trace support
+ query._callSite = new Error();
}
- var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
- delete oa.oauth_consumer_secret
- delete oa.oauth_private_key
+ this.getConnection(function (err, conn) {
+ if (err) {
+ query.on('error', function () {});
+ query.end(err);
+ return;
+ }
- var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
- delete oa.oauth_token_secret
+ // Release connection based off event
+ query.once('end', function() {
+ conn.release();
+ });
- var realm = oa.oauth_realm
- delete oa.oauth_realm
- delete oa.oauth_transport_method
+ conn.query(query);
+ });
- var baseurl = uri.protocol + '//' + uri.host + uri.pathname
- var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
+ return query;
+};
- oa.oauth_signature = oauth.sign(
- oa.oauth_signature_method,
- method,
- baseurl,
- params,
- consumer_secret_or_private_key, // eslint-disable-line camelcase
- token_secret // eslint-disable-line camelcase
- )
+Pool.prototype._enqueueCallback = function _enqueueCallback(callback) {
- if (realm) {
- oa.realm = realm
+ if (this.config.queueLimit && this._connectionQueue.length >= this.config.queueLimit) {
+ process.nextTick(function () {
+ var err = new Error('Queue limit reached.');
+ err.code = 'POOL_ENQUEUELIMIT';
+ callback(err);
+ });
+ return;
}
- return oa
-}
-
-OAuth.prototype.buildBodyHash = function (_oauth, body) {
- if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
- this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
- ' signature_method not supported with body_hash signing.'))
- }
+ // Bind to domain, as dequeue will likely occur in a different domain
+ var cb = process.domain
+ ? process.domain.bind(callback)
+ : callback;
- var shasum = crypto.createHash('sha1')
- shasum.update(body || '')
- var sha1 = shasum.digest('hex')
+ this._connectionQueue.push(cb);
+ this.emit('enqueue');
+};
- return Buffer.from(sha1, 'hex').toString('base64')
-}
+Pool.prototype._needsChangeUser = function _needsChangeUser(connection) {
+ var connConfig = connection.config;
+ var poolConfig = this.config.connectionConfig;
-OAuth.prototype.concatParams = function (oa, sep, wrap) {
- wrap = wrap || ''
+ // check if changeUser values are different
+ return connConfig.user !== poolConfig.user
+ || connConfig.database !== poolConfig.database
+ || connConfig.password !== poolConfig.password
+ || connConfig.charsetNumber !== poolConfig.charsetNumber;
+};
- var params = Object.keys(oa).filter(function (i) {
- return i !== 'realm' && i !== 'oauth_signature'
- }).sort()
+Pool.prototype._purgeConnection = function _purgeConnection(connection, callback) {
+ var cb = callback || function () {};
- if (oa.realm) {
- params.splice(0, 0, 'realm')
+ if (connection.state === 'disconnected') {
+ connection.destroy();
}
- params.push('oauth_signature')
-
- return params.map(function (i) {
- return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
- }).join(sep)
-}
-OAuth.prototype.onRequest = function (_oauth) {
- var self = this
- self.params = _oauth
+ this._removeConnection(connection);
- var uri = self.request.uri || {}
- var method = self.request.method || ''
- var headers = caseless(self.request.headers)
- var body = self.request.body || ''
- var qsLib = self.request.qsLib || qs
+ if (connection.state !== 'disconnected' && !connection._protocol._quitSequence) {
+ connection._realEnd(cb);
+ return;
+ }
- var form
- var query
- var contentType = headers.get('content-type') || ''
- var formContentType = 'application/x-www-form-urlencoded'
- var transport = _oauth.transport_method || 'header'
+ process.nextTick(cb);
+};
- if (contentType.slice(0, formContentType.length) === formContentType) {
- contentType = formContentType
- form = body
- }
- if (uri.query) {
- query = uri.query
- }
- if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
- self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
- 'and content-type ' + formContentType))
- }
+Pool.prototype._removeConnection = function(connection) {
+ connection._pool = null;
- if (!form && typeof _oauth.body_hash === 'boolean') {
- _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())
- }
+ // Remove connection from all connections
+ spliceConnection(this._allConnections, connection);
- var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)
+ // Remove connection from free connections
+ spliceConnection(this._freeConnections, connection);
- switch (transport) {
- case 'header':
- self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
- break
+ this.releaseConnection(connection);
+};
- case 'query':
- var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
- self.request.uri = url.parse(href)
- self.request.path = self.request.uri.path
- break
+Pool.prototype.escape = function(value) {
+ return mysql.escape(value, this.config.connectionConfig.stringifyObjects, this.config.connectionConfig.timezone);
+};
- case 'body':
- self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')
- break
+Pool.prototype.escapeId = function escapeId(value) {
+ return mysql.escapeId(value, false);
+};
- default:
- self.request.emit('error', new Error('oauth: transport_method invalid'))
+function spliceConnection(array, connection) {
+ var index;
+ if ((index = array.indexOf(connection)) !== -1) {
+ // Remove connection from all connections
+ array.splice(index, 1);
}
}
-exports.f = OAuth
-
/***/ }),
-/***/ 66476:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-
-
-var qs = __nccwpck_require__(22760)
-var querystring = __nccwpck_require__(71191)
+/***/ 90678:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-function Querystring (request) {
- this.request = request
- this.lib = null
- this.useQuerystring = null
- this.parseOptions = null
- this.stringifyOptions = null
-}
+var Pool = __nccwpck_require__(65942);
+var PoolConfig = __nccwpck_require__(30002);
+var PoolNamespace = __nccwpck_require__(64313);
+var PoolSelector = __nccwpck_require__(64849);
+var Util = __nccwpck_require__(31669);
+var EventEmitter = __nccwpck_require__(28614).EventEmitter;
-Querystring.prototype.init = function (options) {
- if (this.lib) { return }
+module.exports = PoolCluster;
- this.useQuerystring = options.useQuerystring
- this.lib = (this.useQuerystring ? querystring : qs)
+/**
+ * PoolCluster
+ * @constructor
+ * @param {object} [config] The pool cluster configuration
+ * @public
+ */
+function PoolCluster(config) {
+ EventEmitter.call(this);
- this.parseOptions = options.qsParseOptions || {}
- this.stringifyOptions = options.qsStringifyOptions || {}
-}
+ config = config || {};
+ this._canRetry = typeof config.canRetry === 'undefined' ? true : config.canRetry;
+ this._defaultSelector = config.defaultSelector || 'RR';
+ this._removeNodeErrorCount = config.removeNodeErrorCount || 5;
+ this._restoreNodeTimeout = config.restoreNodeTimeout || 0;
-Querystring.prototype.stringify = function (obj) {
- return (this.useQuerystring)
- ? this.rfc3986(this.lib.stringify(obj,
- this.stringifyOptions.sep || null,
- this.stringifyOptions.eq || null,
- this.stringifyOptions))
- : this.lib.stringify(obj, this.stringifyOptions)
+ this._closed = false;
+ this._findCaches = Object.create(null);
+ this._lastId = 0;
+ this._namespaces = Object.create(null);
+ this._nodes = Object.create(null);
}
-Querystring.prototype.parse = function (str) {
- return (this.useQuerystring)
- ? this.lib.parse(str,
- this.parseOptions.sep || null,
- this.parseOptions.eq || null,
- this.parseOptions)
- : this.lib.parse(str, this.parseOptions)
-}
+Util.inherits(PoolCluster, EventEmitter);
-Querystring.prototype.rfc3986 = function (str) {
- return str.replace(/[!'()*]/g, function (c) {
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
- })
-}
+PoolCluster.prototype.add = function add(id, config) {
+ if (this._closed) {
+ throw new Error('PoolCluster is closed.');
+ }
-Querystring.prototype.unescape = querystring.unescape
+ var nodeId = typeof id === 'object'
+ ? 'CLUSTER::' + (++this._lastId)
+ : String(id);
-exports.h = Querystring
+ if (this._nodes[nodeId] !== undefined) {
+ throw new Error('Node ID "' + nodeId + '" is already defined in PoolCluster.');
+ }
+ var poolConfig = typeof id !== 'object'
+ ? new PoolConfig(config)
+ : new PoolConfig(id);
-/***/ }),
+ this._nodes[nodeId] = {
+ id : nodeId,
+ errorCount : 0,
+ pool : new Pool({config: poolConfig}),
+ _offlineUntil : 0
+ };
-/***/ 3048:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+ this._clearFindCaches();
+};
-"use strict";
+PoolCluster.prototype.end = function end(callback) {
+ var cb = callback !== undefined
+ ? callback
+ : _cb;
+ if (typeof cb !== 'function') {
+ throw TypeError('callback argument must be a function');
+ }
-var url = __nccwpck_require__(78835)
-var isUrl = /^https?:/
+ if (this._closed) {
+ process.nextTick(cb);
+ return;
+ }
-function Redirect (request) {
- this.request = request
- this.followRedirect = true
- this.followRedirects = true
- this.followAllRedirects = false
- this.followOriginalHttpMethod = false
- this.allowRedirect = function () { return true }
- this.maxRedirects = 10
- this.redirects = []
- this.redirectsFollowed = 0
- this.removeRefererHeader = false
-}
+ this._closed = true;
-Redirect.prototype.onRequest = function (options) {
- var self = this
+ var calledBack = false;
+ var nodeIds = Object.keys(this._nodes);
+ var waitingClose = 0;
- if (options.maxRedirects !== undefined) {
- self.maxRedirects = options.maxRedirects
- }
- if (typeof options.followRedirect === 'function') {
- self.allowRedirect = options.followRedirect
- }
- if (options.followRedirect !== undefined) {
- self.followRedirects = !!options.followRedirect
+ function onEnd(err) {
+ if (!calledBack && (err || --waitingClose <= 0)) {
+ calledBack = true;
+ cb(err);
+ }
}
- if (options.followAllRedirects !== undefined) {
- self.followAllRedirects = options.followAllRedirects
+
+ for (var i = 0; i < nodeIds.length; i++) {
+ var nodeId = nodeIds[i];
+ var node = this._nodes[nodeId];
+
+ waitingClose++;
+ node.pool.end(onEnd);
}
- if (self.followRedirects || self.followAllRedirects) {
- self.redirects = self.redirects || []
+
+ if (waitingClose === 0) {
+ process.nextTick(onEnd);
}
- if (options.removeRefererHeader !== undefined) {
- self.removeRefererHeader = options.removeRefererHeader
+};
+
+PoolCluster.prototype.of = function(pattern, selector) {
+ pattern = pattern || '*';
+
+ selector = selector || this._defaultSelector;
+ selector = selector.toUpperCase();
+ if (typeof PoolSelector[selector] === 'undefined') {
+ selector = this._defaultSelector;
}
- if (options.followOriginalHttpMethod !== undefined) {
- self.followOriginalHttpMethod = options.followOriginalHttpMethod
+
+ var key = pattern + selector;
+
+ if (typeof this._namespaces[key] === 'undefined') {
+ this._namespaces[key] = new PoolNamespace(this, pattern, selector);
}
-}
-Redirect.prototype.redirectTo = function (response) {
- var self = this
- var request = self.request
+ return this._namespaces[key];
+};
- var redirectTo = null
- if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
- var location = response.caseless.get('location')
- request.debug('redirect', location)
+PoolCluster.prototype.remove = function remove(pattern) {
+ var foundNodeIds = this._findNodeIds(pattern, true);
- if (self.followAllRedirects) {
- redirectTo = location
- } else if (self.followRedirects) {
- switch (request.method) {
- case 'PATCH':
- case 'PUT':
- case 'POST':
- case 'DELETE':
- // Do not follow redirects
- break
- default:
- redirectTo = location
- break
- }
- }
- } else if (response.statusCode === 401) {
- var authHeader = request._auth.onResponse(response)
- if (authHeader) {
- request.setHeader('authorization', authHeader)
- redirectTo = request.uri
+ for (var i = 0; i < foundNodeIds.length; i++) {
+ var node = this._getNode(foundNodeIds[i]);
+
+ if (node) {
+ this._removeNode(node);
}
}
- return redirectTo
-}
+};
-Redirect.prototype.onResponse = function (response) {
- var self = this
- var request = self.request
+PoolCluster.prototype.getConnection = function(pattern, selector, cb) {
+ var namespace;
+ if (typeof pattern === 'function') {
+ cb = pattern;
+ namespace = this.of();
+ } else {
+ if (typeof selector === 'function') {
+ cb = selector;
+ selector = this._defaultSelector;
+ }
- var redirectTo = self.redirectTo(response)
- if (!redirectTo || !self.allowRedirect.call(request, response)) {
- return false
+ namespace = this.of(pattern, selector);
}
- request.debug('redirect to', redirectTo)
+ namespace.getConnection(cb);
+};
- // ignore any potential response body. it cannot possibly be useful
- // to us at this point.
- // response.resume should be defined, but check anyway before calling. Workaround for browserify.
- if (response.resume) {
- response.resume()
- }
+PoolCluster.prototype._clearFindCaches = function _clearFindCaches() {
+ this._findCaches = Object.create(null);
+};
+
+PoolCluster.prototype._decreaseErrorCount = function _decreaseErrorCount(node) {
+ var errorCount = node.errorCount;
- if (self.redirectsFollowed >= self.maxRedirects) {
- request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
- return false
+ if (errorCount > this._removeNodeErrorCount) {
+ errorCount = this._removeNodeErrorCount;
}
- self.redirectsFollowed += 1
- if (!isUrl.test(redirectTo)) {
- redirectTo = url.resolve(request.uri.href, redirectTo)
+ if (errorCount < 1) {
+ errorCount = 1;
}
- var uriPrev = request.uri
- request.uri = url.parse(redirectTo)
+ node.errorCount = errorCount - 1;
- // handle the case where we change protocol from https to http or vice versa
- if (request.uri.protocol !== uriPrev.protocol) {
- delete request.agent
+ if (node._offlineUntil) {
+ node._offlineUntil = 0;
+ this.emit('online', node.id);
}
+};
- self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
+PoolCluster.prototype._findNodeIds = function _findNodeIds(pattern, includeOffline) {
+ var currentTime = 0;
+ var foundNodeIds = this._findCaches[pattern];
- if (self.followAllRedirects && request.method !== 'HEAD' &&
- response.statusCode !== 401 && response.statusCode !== 307) {
- request.method = self.followOriginalHttpMethod ? request.method : 'GET'
- }
- // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
- delete request.src
- delete request.req
- delete request._started
- if (response.statusCode !== 401 && response.statusCode !== 307) {
- // Remove parameters from the previous response, unless this is the second request
- // for a server that requires digest authentication.
- delete request.body
- delete request._form
- if (request.headers) {
- request.removeHeader('host')
- request.removeHeader('content-type')
- request.removeHeader('content-length')
- if (request.uri.hostname !== request.originalHost.split(':')[0]) {
- // Remove authorization if changing hostnames (but not if just
- // changing ports or protocols). This matches the behavior of curl:
- // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
- request.removeHeader('authorization')
- }
- }
- }
+ if (foundNodeIds === undefined) {
+ var expression = patternRegExp(pattern);
+ var nodeIds = Object.keys(this._nodes);
- if (!self.removeRefererHeader) {
- request.setHeader('referer', uriPrev.href)
+ foundNodeIds = nodeIds.filter(function (id) {
+ return id.match(expression);
+ });
+
+ this._findCaches[pattern] = foundNodeIds;
}
- request.emit('redirect')
+ if (includeOffline) {
+ return foundNodeIds;
+ }
- request.init()
+ return foundNodeIds.filter(function (nodeId) {
+ var node = this._getNode(nodeId);
- return true
-}
+ if (!node._offlineUntil) {
+ return true;
+ }
-exports.l = Redirect
+ if (!currentTime) {
+ currentTime = getMonotonicMilliseconds();
+ }
+ return node._offlineUntil <= currentTime;
+ }, this);
+};
-/***/ }),
+PoolCluster.prototype._getNode = function _getNode(id) {
+ return this._nodes[id] || null;
+};
-/***/ 17619:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+PoolCluster.prototype._increaseErrorCount = function _increaseErrorCount(node) {
+ var errorCount = ++node.errorCount;
-"use strict";
+ if (this._removeNodeErrorCount > errorCount) {
+ return;
+ }
+ if (this._restoreNodeTimeout > 0) {
+ node._offlineUntil = getMonotonicMilliseconds() + this._restoreNodeTimeout;
+ this.emit('offline', node.id);
+ return;
+ }
-var url = __nccwpck_require__(78835)
-var tunnel = __nccwpck_require__(11137)
+ this._removeNode(node);
+ this.emit('remove', node.id);
+};
-var defaultProxyHeaderWhiteList = [
- 'accept',
- 'accept-charset',
- 'accept-encoding',
- 'accept-language',
- 'accept-ranges',
- 'cache-control',
- 'content-encoding',
- 'content-language',
- 'content-location',
- 'content-md5',
- 'content-range',
- 'content-type',
- 'connection',
- 'date',
- 'expect',
- 'max-forwards',
- 'pragma',
- 'referer',
- 'te',
- 'user-agent',
- 'via'
-]
+PoolCluster.prototype._getConnection = function(node, cb) {
+ var self = this;
-var defaultProxyHeaderExclusiveList = [
- 'proxy-authorization'
-]
+ node.pool.getConnection(function (err, connection) {
+ if (err) {
+ self._increaseErrorCount(node);
+ cb(err);
+ return;
+ } else {
+ self._decreaseErrorCount(node);
+ }
-function constructProxyHost (uriObject) {
- var port = uriObject.port
- var protocol = uriObject.protocol
- var proxyHost = uriObject.hostname + ':'
+ connection._clusterId = node.id;
- if (port) {
- proxyHost += port
- } else if (protocol === 'https:') {
- proxyHost += '443'
- } else {
- proxyHost += '80'
- }
+ cb(null, connection);
+ });
+};
- return proxyHost
-}
+PoolCluster.prototype._removeNode = function _removeNode(node) {
+ delete this._nodes[node.id];
-function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
- var whiteList = proxyHeaderWhiteList
- .reduce(function (set, header) {
- set[header.toLowerCase()] = true
- return set
- }, {})
+ this._clearFindCaches();
- return Object.keys(headers)
- .filter(function (header) {
- return whiteList[header.toLowerCase()]
- })
- .reduce(function (set, header) {
- set[header] = headers[header]
- return set
- }, {})
-}
+ node.pool.end(_noop);
+};
-function constructTunnelOptions (request, proxyHeaders) {
- var proxy = request.proxy
+function getMonotonicMilliseconds() {
+ var ms;
- var tunnelOptions = {
- proxy: {
- host: proxy.hostname,
- port: +proxy.port,
- proxyAuth: proxy.auth,
- headers: proxyHeaders
- },
- headers: request.headers,
- ca: request.ca,
- cert: request.cert,
- key: request.key,
- passphrase: request.passphrase,
- pfx: request.pfx,
- ciphers: request.ciphers,
- rejectUnauthorized: request.rejectUnauthorized,
- secureOptions: request.secureOptions,
- secureProtocol: request.secureProtocol
+ if (typeof process.hrtime === 'function') {
+ ms = process.hrtime();
+ ms = ms[0] * 1e3 + ms[1] * 1e-6;
+ } else {
+ ms = process.uptime() * 1000;
}
- return tunnelOptions
-}
-
-function constructTunnelFnName (uri, proxy) {
- var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
- var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
- return [uriProtocol, proxyProtocol].join('Over')
+ return Math.floor(ms);
}
-function getTunnelFn (request) {
- var uri = request.uri
- var proxy = request.proxy
- var tunnelFnName = constructTunnelFnName(uri, proxy)
- return tunnel[tunnelFnName]
+function isRegExp(val) {
+ return typeof val === 'object'
+ && Object.prototype.toString.call(val) === '[object RegExp]';
}
-function Tunnel (request) {
- this.request = request
- this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
- this.proxyHeaderExclusiveList = []
- if (typeof request.tunnel !== 'undefined') {
- this.tunnelOverride = request.tunnel
+function patternRegExp(pattern) {
+ if (isRegExp(pattern)) {
+ return pattern;
}
-}
-Tunnel.prototype.isEnabled = function () {
- var self = this
- var request = self.request
- // Tunnel HTTPS by default. Allow the user to override this setting.
+ var source = pattern
+ .replace(/([.+?^=!:${}()|\[\]\/\\])/g, '\\$1')
+ .replace(/\*/g, '.*');
- // If self.tunnelOverride is set (the user specified a value), use it.
- if (typeof self.tunnelOverride !== 'undefined') {
- return self.tunnelOverride
- }
+ return new RegExp('^' + source + '$');
+}
- // If the destination is HTTPS, tunnel.
- if (request.uri.protocol === 'https:') {
- return true
+function _cb(err) {
+ if (err) {
+ throw err;
}
-
- // Otherwise, do not use tunnel.
- return false
}
-Tunnel.prototype.setup = function (options) {
- var self = this
- var request = self.request
+function _noop() {}
- options = options || {}
- if (typeof request.proxy === 'string') {
- request.proxy = url.parse(request.proxy)
- }
+/***/ }),
- if (!request.proxy || !request.tunnel) {
- return false
- }
+/***/ 30002:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // Setup Proxy Header Exclusive List and White List
- if (options.proxyHeaderWhiteList) {
- self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
- }
- if (options.proxyHeaderExclusiveList) {
- self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
- }
- var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
- var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
+var ConnectionConfig = __nccwpck_require__(35551);
- // Setup Proxy Headers and Proxy Headers Host
- // Only send the Proxy White Listed Header names
- var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
- proxyHeaders.host = constructProxyHost(request.uri)
+module.exports = PoolConfig;
+function PoolConfig(options) {
+ if (typeof options === 'string') {
+ options = ConnectionConfig.parseUrl(options);
+ }
- proxyHeaderExclusiveList.forEach(request.removeHeader, request)
+ this.acquireTimeout = (options.acquireTimeout === undefined)
+ ? 10 * 1000
+ : Number(options.acquireTimeout);
+ this.connectionConfig = new ConnectionConfig(options);
+ this.waitForConnections = (options.waitForConnections === undefined)
+ ? true
+ : Boolean(options.waitForConnections);
+ this.connectionLimit = (options.connectionLimit === undefined)
+ ? 10
+ : Number(options.connectionLimit);
+ this.queueLimit = (options.queueLimit === undefined)
+ ? 0
+ : Number(options.queueLimit);
+}
- // Set Agent from Tunnel Data
- var tunnelFn = getTunnelFn(request)
- var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
- request.agent = tunnelFn(tunnelOptions)
+PoolConfig.prototype.newConnectionConfig = function newConnectionConfig() {
+ var connectionConfig = new ConnectionConfig(this.connectionConfig);
- return true
-}
+ connectionConfig.clientFlags = this.connectionConfig.clientFlags;
+ connectionConfig.maxPacketSize = this.connectionConfig.maxPacketSize;
-Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
-Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
-exports.n = Tunnel
+ return connectionConfig;
+};
/***/ }),
-/***/ 47279:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 10378:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+var inherits = __nccwpck_require__(31669).inherits;
+var Connection = __nccwpck_require__(76742);
+var Events = __nccwpck_require__(28614);
-var net = __nccwpck_require__(11631);
-var urlParse = __nccwpck_require__(78835).parse;
-var util = __nccwpck_require__(31669);
-var pubsuffix = __nccwpck_require__(34964);
-var Store = __nccwpck_require__(11013)/* .Store */ .y;
-var MemoryCookieStore = __nccwpck_require__(73533)/* .MemoryCookieStore */ .m;
-var pathMatch = __nccwpck_require__(30495)/* .pathMatch */ .U;
-var VERSION = __nccwpck_require__(30380);
+module.exports = PoolConnection;
+inherits(PoolConnection, Connection);
-var punycode;
-try {
- punycode = __nccwpck_require__(94213);
-} catch(e) {
- console.warn("tough-cookie: can't load punycode; won't use punycode for domain normalization");
-}
+function PoolConnection(pool, options) {
+ Connection.call(this, options);
+ this._pool = pool;
-// From RFC6265 S4.1.1
-// note that it excludes \x3B ";"
-var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
+ // Bind connection to pool domain
+ if (Events.usingDomains) {
+ this.domain = pool.domain;
+ }
-var CONTROL_CHARS = /[\x00-\x1F]/;
+ // When a fatal error occurs the connection's protocol ends, which will cause
+ // the connection to end as well, thus we only need to watch for the end event
+ // and we will be notified of disconnects.
+ this.on('end', this._removeFromPool);
+ this.on('error', function (err) {
+ if (err.fatal) {
+ this._removeFromPool();
+ }
+ });
+}
-// From Chromium // '\r', '\n' and '\0' should be treated as a terminator in
-// the "relaxed" mode, see:
-// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60
-var TERMINATORS = ['\n', '\r', '\0'];
+PoolConnection.prototype.release = function release() {
+ var pool = this._pool;
-// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
-// Note ';' is \x3B
-var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
+ if (!pool || pool._closed) {
+ return undefined;
+ }
-// date-time parsing constants (RFC6265 S5.1.1)
+ return pool.releaseConnection(this);
+};
-var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
+// TODO: Remove this when we are removing PoolConnection#end
+PoolConnection.prototype._realEnd = Connection.prototype.end;
-var MONTH_TO_NUM = {
- jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
- jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
+PoolConnection.prototype.end = function () {
+ console.warn(
+ 'Calling conn.end() to release a pooled connection is ' +
+ 'deprecated. In next version calling conn.end() will be ' +
+ 'restored to default conn.end() behavior. Use ' +
+ 'conn.release() instead.'
+ );
+ this.release();
};
-var NUM_TO_MONTH = [
- 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
-];
-var NUM_TO_DAY = [
- 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
-];
-var MAX_TIME = 2147483647000; // 31-bit max
-var MIN_TIME = 0; // 31-bit min
+PoolConnection.prototype.destroy = function () {
+ Connection.prototype.destroy.apply(this, arguments);
+ this._removeFromPool(this);
+};
-/*
- * Parses a Natural number (i.e., non-negative integer) with either the
- * *DIGIT ( non-digit *OCTET )
- * or
- * *DIGIT
- * grammar (RFC6265 S5.1.1).
- *
- * The "trailingOK" boolean controls if the grammar accepts a
- * "( non-digit *OCTET )" trailer.
- */
-function parseDigits(token, minDigits, maxDigits, trailingOK) {
- var count = 0;
- while (count < token.length) {
- var c = token.charCodeAt(count);
- // "non-digit = %x00-2F / %x3A-FF"
- if (c <= 0x2F || c >= 0x3A) {
- break;
- }
- count++;
+PoolConnection.prototype._removeFromPool = function _removeFromPool() {
+ if (!this._pool || this._pool._closed) {
+ return;
}
- // constrain to a minimum and maximum number of digits.
- if (count < minDigits || count > maxDigits) {
- return null;
- }
+ var pool = this._pool;
+ this._pool = null;
- if (!trailingOK && count != token.length) {
- return null;
- }
+ pool._purgeConnection(this);
+};
- return parseInt(token.substr(0,count), 10);
-}
-function parseTime(token) {
- var parts = token.split(':');
- var result = [0,0,0];
+/***/ }),
- /* RF6256 S5.1.1:
- * time = hms-time ( non-digit *OCTET )
- * hms-time = time-field ":" time-field ":" time-field
- * time-field = 1*2DIGIT
- */
+/***/ 64313:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- if (parts.length !== 3) {
- return null;
- }
+var Connection = __nccwpck_require__(76742);
+var PoolSelector = __nccwpck_require__(64849);
- for (var i = 0; i < 3; i++) {
- // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be
- // followed by "( non-digit *OCTET )" so therefore the last time-field can
- // have a trailer
- var trailingOK = (i == 2);
- var num = parseDigits(parts[i], 1, 2, trailingOK);
- if (num === null) {
- return null;
- }
- result[i] = num;
- }
+module.exports = PoolNamespace;
- return result;
+/**
+ * PoolNamespace
+ * @constructor
+ * @param {PoolCluster} cluster The parent cluster for the namespace
+ * @param {string} pattern The selection pattern to use
+ * @param {string} selector The selector name to use
+ * @public
+ */
+function PoolNamespace(cluster, pattern, selector) {
+ this._cluster = cluster;
+ this._pattern = pattern;
+ this._selector = new PoolSelector[selector]();
}
-function parseMonth(token) {
- token = String(token).substr(0,3).toLowerCase();
- var num = MONTH_TO_NUM[token];
- return num >= 0 ? num : null;
-}
+PoolNamespace.prototype.getConnection = function(cb) {
+ var clusterNode = this._getClusterNode();
+ var cluster = this._cluster;
+ var namespace = this;
-/*
- * RFC6265 S5.1.1 date parser (see RFC for full grammar)
- */
-function parseDate(str) {
- if (!str) {
- return;
- }
+ if (clusterNode === null) {
+ var err = null;
- /* RFC6265 S5.1.1:
- * 2. Process each date-token sequentially in the order the date-tokens
- * appear in the cookie-date
- */
- var tokens = str.split(DATE_DELIM);
- if (!tokens) {
+ if (this._cluster._findNodeIds(this._pattern, true).length !== 0) {
+ err = new Error('Pool does not have online node.');
+ err.code = 'POOL_NONEONLINE';
+ } else {
+ err = new Error('Pool does not exist.');
+ err.code = 'POOL_NOEXIST';
+ }
+
+ cb(err);
return;
}
- var hour = null;
- var minute = null;
- var second = null;
- var dayOfMonth = null;
- var month = null;
- var year = null;
+ cluster._getConnection(clusterNode, function(err, connection) {
+ var retry = err && cluster._canRetry
+ && cluster._findNodeIds(namespace._pattern).length !== 0;
- for (var i=0; i= 70 && year <= 99) {
- year += 1900;
- } else if (year >= 0 && year <= 69) {
- year += 2000;
- }
- }
+ if (clusterNode === null) {
+ var err = null;
+
+ if (this._cluster._findNodeIds(this._pattern, true).length !== 0) {
+ err = new Error('Pool does not have online node.');
+ err.code = 'POOL_NONEONLINE';
+ } else {
+ err = new Error('Pool does not exist.');
+ err.code = 'POOL_NOEXIST';
}
- }
- /* RFC 6265 S5.1.1
- * "5. Abort these steps and fail to parse the cookie-date if:
- * * at least one of the found-day-of-month, found-month, found-
- * year, or found-time flags is not set,
- * * the day-of-month-value is less than 1 or greater than 31,
- * * the year-value is less than 1601,
- * * the hour-value is greater than 23,
- * * the minute-value is greater than 59, or
- * * the second-value is greater than 59.
- * (Note that leap seconds cannot be represented in this syntax.)"
- *
- * So, in order as above:
- */
- if (
- dayOfMonth === null || month === null || year === null || second === null ||
- dayOfMonth < 1 || dayOfMonth > 31 ||
- year < 1601 ||
- hour > 23 ||
- minute > 59 ||
- second > 59
- ) {
- return;
+ process.nextTick(function () {
+ query.on('error', function () {});
+ query.end(err);
+ });
+ return query;
}
- return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
-}
-
-function formatDate(date) {
- var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
- var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
- var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
- var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
- return NUM_TO_DAY[date.getUTCDay()] + ', ' +
- d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
- h+':'+m+':'+s+' GMT';
-}
-
-// S5.1.2 Canonicalized Host Names
-function canonicalDomain(str) {
- if (str == null) {
- return null;
+ if (!(typeof sql === 'object' && 'typeCast' in sql)) {
+ query.typeCast = clusterNode.pool.config.connectionConfig.typeCast;
}
- str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
- // convert to IDN if any non-ASCII characters
- if (punycode && /[^\u0001-\u007f]/.test(str)) {
- str = punycode.toASCII(str);
+ if (clusterNode.pool.config.connectionConfig.trace) {
+ // Long stack trace support
+ query._callSite = new Error();
}
- return str.toLowerCase();
-}
+ cluster._getConnection(clusterNode, function (err, conn) {
+ var retry = err && cluster._canRetry
+ && cluster._findNodeIds(namespace._pattern).length !== 0;
-// S5.1.3 Domain Matching
-function domainMatch(str, domStr, canonicalize) {
- if (str == null || domStr == null) {
- return null;
- }
- if (canonicalize !== false) {
- str = canonicalDomain(str);
- domStr = canonicalDomain(domStr);
- }
+ if (retry) {
+ namespace.query(query);
+ return;
+ }
- /*
- * "The domain string and the string are identical. (Note that both the
- * domain string and the string will have been canonicalized to lower case at
- * this point)"
- */
- if (str == domStr) {
- return true;
- }
+ if (err) {
+ query.on('error', function () {});
+ query.end(err);
+ return;
+ }
- /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
+ // Release connection based off event
+ query.once('end', function() {
+ conn.release();
+ });
- /* "* The string is a host name (i.e., not an IP address)." */
- if (net.isIP(str)) {
- return false;
- }
+ conn.query(query);
+ });
- /* "* The domain string is a suffix of the string" */
- var idx = str.indexOf(domStr);
- if (idx <= 0) {
- return false; // it's a non-match (-1) or prefix (0)
- }
+ return query;
+};
- // e.g "a.b.c".indexOf("b.c") === 2
- // 5 === 3+2
- if (str.length !== domStr.length + idx) { // it's not a suffix
- return false;
- }
+PoolNamespace.prototype._getClusterNode = function _getClusterNode() {
+ var foundNodeIds = this._cluster._findNodeIds(this._pattern);
+ var nodeId;
- /* "* The last character of the string that is not included in the domain
- * string is a %x2E (".") character." */
- if (str.substr(idx-1,1) !== '.') {
- return false;
+ switch (foundNodeIds.length) {
+ case 0:
+ nodeId = null;
+ break;
+ case 1:
+ nodeId = foundNodeIds[0];
+ break;
+ default:
+ nodeId = this._selector(foundNodeIds);
+ break;
}
- return true;
-}
+ return nodeId !== null
+ ? this._cluster._getNode(nodeId)
+ : null;
+};
-// RFC6265 S5.1.4 Paths and Path-Match
+/***/ }),
-/*
- * "The user agent MUST use an algorithm equivalent to the following algorithm
- * to compute the default-path of a cookie:"
- *
- * Assumption: the path (and not query part or absolute uri) is passed in.
- */
-function defaultPath(path) {
- // "2. If the uri-path is empty or if the first character of the uri-path is not
- // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
- if (!path || path.substr(0,1) !== "/") {
- return "/";
- }
+/***/ 64849:
+/***/ ((module) => {
- // "3. If the uri-path contains no more than one %x2F ("/") character, output
- // %x2F ("/") and skip the remaining step."
- if (path === "/") {
- return path;
- }
- var rightSlash = path.lastIndexOf("/");
- if (rightSlash === 0) {
- return "/";
- }
+/**
+ * PoolSelector
+ */
+var PoolSelector = module.exports = {};
- // "4. Output the characters of the uri-path from the first character up to,
- // but not including, the right-most %x2F ("/")."
- return path.slice(0, rightSlash);
-}
+PoolSelector.RR = function PoolSelectorRoundRobin() {
+ var index = 0;
-function trimTerminator(str) {
- for (var t = 0; t < TERMINATORS.length; t++) {
- var terminatorIdx = str.indexOf(TERMINATORS[t]);
- if (terminatorIdx !== -1) {
- str = str.substr(0,terminatorIdx);
+ return function(clusterIds) {
+ if (index >= clusterIds.length) {
+ index = 0;
}
- }
- return str;
-}
+ var clusterId = clusterIds[index++];
-function parseCookiePair(cookiePair, looseMode) {
- cookiePair = trimTerminator(cookiePair);
+ return clusterId;
+ };
+};
- var firstEq = cookiePair.indexOf('=');
- if (looseMode) {
- if (firstEq === 0) { // '=' is immediately at start
- cookiePair = cookiePair.substr(1);
- firstEq = cookiePair.indexOf('='); // might still need to split on '='
- }
- } else { // non-loose mode
- if (firstEq <= 0) { // no '=' or is at start
- return; // needs to have non-empty "cookie-name"
- }
- }
+PoolSelector.RANDOM = function PoolSelectorRandom() {
+ return function(clusterIds) {
+ return clusterIds[Math.floor(Math.random() * clusterIds.length)];
+ };
+};
- var cookieName, cookieValue;
- if (firstEq <= 0) {
- cookieName = "";
- cookieValue = cookiePair.trim();
- } else {
- cookieName = cookiePair.substr(0, firstEq).trim();
- cookieValue = cookiePair.substr(firstEq+1).trim();
- }
+PoolSelector.ORDER = function PoolSelectorOrder() {
+ return function(clusterIds) {
+ return clusterIds[0];
+ };
+};
- if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {
- return;
+
+/***/ }),
+
+/***/ 37806:
+/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+
+var Buffer = __nccwpck_require__(21867).Buffer;
+var Crypto = __nccwpck_require__(76417);
+var Auth = exports;
+
+function auth(name, data, options) {
+ options = options || {};
+
+ switch (name) {
+ case 'mysql_native_password':
+ return Auth.token(options.password, data.slice(0, 20));
+ default:
+ return undefined;
}
+}
+Auth.auth = auth;
- var c = new Cookie();
- c.key = cookieName;
- c.value = cookieValue;
- return c;
+function sha1(msg) {
+ var hash = Crypto.createHash('sha1');
+ hash.update(msg, 'binary');
+ return hash.digest('binary');
}
+Auth.sha1 = sha1;
-function parse(str, options) {
- if (!options || typeof options !== 'object') {
- options = {};
+function xor(a, b) {
+ a = Buffer.from(a, 'binary');
+ b = Buffer.from(b, 'binary');
+ var result = Buffer.allocUnsafe(a.length);
+ for (var i = 0; i < a.length; i++) {
+ result[i] = (a[i] ^ b[i]);
}
- str = str.trim();
+ return result;
+}
+Auth.xor = xor;
- // We use a regex to parse the "name-value-pair" part of S5.2
- var firstSemi = str.indexOf(';'); // S5.2 step 1
- var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);
- var c = parseCookiePair(cookiePair, !!options.loose);
- if (!c) {
- return;
+Auth.token = function(password, scramble) {
+ if (!password) {
+ return Buffer.alloc(0);
}
- if (firstSemi === -1) {
- return c;
- }
+ // password must be in binary format, not utf8
+ var stage1 = sha1((Buffer.from(password, 'utf8')).toString('binary'));
+ var stage2 = sha1(stage1);
+ var stage3 = sha1(scramble.toString('binary') + stage2);
+ return xor(stage3, stage1);
+};
- // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
- // (including the %x3B (";") in question)." plus later on in the same section
- // "discard the first ";" and trim".
- var unparsed = str.slice(firstSemi + 1).trim();
+// This is a port of sql/password.c:hash_password which needs to be used for
+// pre-4.1 passwords.
+Auth.hashPassword = function(password) {
+ var nr = [0x5030, 0x5735];
+ var add = 7;
+ var nr2 = [0x1234, 0x5671];
+ var result = Buffer.alloc(8);
- // "If the unparsed-attributes string is empty, skip the rest of these
- // steps."
- if (unparsed.length === 0) {
- return c;
+ if (typeof password === 'string'){
+ password = Buffer.from(password);
}
- /*
- * S5.2 says that when looping over the items "[p]rocess the attribute-name
- * and attribute-value according to the requirements in the following
- * subsections" for every item. Plus, for many of the individual attributes
- * in S5.3 it says to use the "attribute-value of the last attribute in the
- * cookie-attribute-list". Therefore, in this implementation, we overwrite
- * the previous value.
- */
- var cookie_avs = unparsed.split(';');
- while (cookie_avs.length) {
- var av = cookie_avs.shift().trim();
- if (av.length === 0) { // happens if ";;" appears
+ for (var i = 0; i < password.length; i++) {
+ var c = password[i];
+ if (c === 32 || c === 9) {
+ // skip space in password
continue;
}
- var av_sep = av.indexOf('=');
- var av_key, av_value;
-
- if (av_sep === -1) {
- av_key = av;
- av_value = null;
- } else {
- av_key = av.substr(0,av_sep);
- av_value = av.substr(av_sep+1);
- }
- av_key = av_key.trim().toLowerCase();
+ // nr^= (((nr & 63)+add)*c)+ (nr << 8);
+ // nr = xor(nr, add(mul(add(and(nr, 63), add), c), shl(nr, 8)))
+ nr = this.xor32(nr, this.add32(this.mul32(this.add32(this.and32(nr, [0, 63]), [0, add]), [0, c]), this.shl32(nr, 8)));
- if (av_value) {
- av_value = av_value.trim();
- }
+ // nr2+=(nr2 << 8) ^ nr;
+ // nr2 = add(nr2, xor(shl(nr2, 8), nr))
+ nr2 = this.add32(nr2, this.xor32(this.shl32(nr2, 8), nr));
- switch(av_key) {
- case 'expires': // S5.2.1
- if (av_value) {
- var exp = parseDate(av_value);
- // "If the attribute-value failed to parse as a cookie date, ignore the
- // cookie-av."
- if (exp) {
- // over and underflow not realistically a concern: V8's getTime() seems to
- // store something larger than a 32-bit time_t (even with 32-bit node)
- c.expires = exp;
- }
- }
- break;
+ // add+=tmp;
+ add += c;
+ }
- case 'max-age': // S5.2.2
- if (av_value) {
- // "If the first character of the attribute-value is not a DIGIT or a "-"
- // character ...[or]... If the remainder of attribute-value contains a
- // non-DIGIT character, ignore the cookie-av."
- if (/^-?[0-9]+$/.test(av_value)) {
- var delta = parseInt(av_value, 10);
- // "If delta-seconds is less than or equal to zero (0), let expiry-time
- // be the earliest representable date and time."
- c.setMaxAge(delta);
- }
- }
- break;
+ this.int31Write(result, nr, 0);
+ this.int31Write(result, nr2, 4);
- case 'domain': // S5.2.3
- // "If the attribute-value is empty, the behavior is undefined. However,
- // the user agent SHOULD ignore the cookie-av entirely."
- if (av_value) {
- // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
- // (".") character."
- var domain = av_value.trim().replace(/^\./, '');
- if (domain) {
- // "Convert the cookie-domain to lower case."
- c.domain = domain.toLowerCase();
- }
- }
- break;
+ return result;
+};
- case 'path': // S5.2.4
- /*
- * "If the attribute-value is empty or if the first character of the
- * attribute-value is not %x2F ("/"):
- * Let cookie-path be the default-path.
- * Otherwise:
- * Let cookie-path be the attribute-value."
- *
- * We'll represent the default-path as null since it depends on the
- * context of the parsing.
- */
- c.path = av_value && av_value[0] === "/" ? av_value : null;
- break;
+Auth.randomInit = function(seed1, seed2) {
+ return {
+ max_value : 0x3FFFFFFF,
+ max_value_dbl : 0x3FFFFFFF,
+ seed1 : seed1 % 0x3FFFFFFF,
+ seed2 : seed2 % 0x3FFFFFFF
+ };
+};
- case 'secure': // S5.2.5
- /*
- * "If the attribute-name case-insensitively matches the string "Secure",
- * the user agent MUST append an attribute to the cookie-attribute-list
- * with an attribute-name of Secure and an empty attribute-value."
- */
- c.secure = true;
- break;
+Auth.myRnd = function(r){
+ r.seed1 = (r.seed1 * 3 + r.seed2) % r.max_value;
+ r.seed2 = (r.seed1 + r.seed2 + 33) % r.max_value;
- case 'httponly': // S5.2.6 -- effectively the same as 'secure'
- c.httpOnly = true;
- break;
+ return r.seed1 / r.max_value_dbl;
+};
- default:
- c.extensions = c.extensions || [];
- c.extensions.push(av);
- break;
- }
+Auth.scramble323 = function(message, password) {
+ if (!password) {
+ return Buffer.alloc(0);
}
- return c;
-}
+ var to = Buffer.allocUnsafe(8);
+ var hashPass = this.hashPassword(password);
+ var hashMessage = this.hashPassword(message.slice(0, 8));
+ var seed1 = this.int32Read(hashPass, 0) ^ this.int32Read(hashMessage, 0);
+ var seed2 = this.int32Read(hashPass, 4) ^ this.int32Read(hashMessage, 4);
+ var r = this.randomInit(seed1, seed2);
-// avoid the V8 deoptimization monster!
-function jsonParse(str) {
- var obj;
- try {
- obj = JSON.parse(str);
- } catch (e) {
- return e;
+ for (var i = 0; i < 8; i++){
+ to[i] = Math.floor(this.myRnd(r) * 31) + 64;
}
- return obj;
-}
+ var extra = (Math.floor(this.myRnd(r) * 31));
-function fromJSON(str) {
- if (!str) {
- return null;
+ for (var i = 0; i < 8; i++){
+ to[i] ^= extra;
}
- var obj;
- if (typeof str === 'string') {
- obj = jsonParse(str);
- if (obj instanceof Error) {
- return null;
- }
- } else {
- // assume it's an Object
- obj = str;
- }
+ return to;
+};
- var c = new Cookie();
- for (var i=0; i> 16);
- return c;
-}
+ return [w2 & 0xFFFF, w1 & 0xFFFF];
+};
-/* Section 5.4 part 2:
- * "* Cookies with longer paths are listed before cookies with
- * shorter paths.
- *
- * * Among cookies that have equal-length path fields, cookies with
- * earlier creation-times are listed before cookies with later
- * creation-times."
- */
+Auth.mul32 = function(a, b){
+ // based on this example of multiplying 32b ints using 16b
+ // http://www.dsprelated.com/showmessage/89790/1.php
+ var w1 = a[1] * b[1];
+ var w2 = (((a[1] * b[1]) >> 16) & 0xFFFF) + ((a[0] * b[1]) & 0xFFFF) + (a[1] * b[0] & 0xFFFF);
-function cookieCompare(a,b) {
- var cmp = 0;
+ return [w2 & 0xFFFF, w1 & 0xFFFF];
+};
- // descending for length: b CMP a
- var aPathLen = a.path ? a.path.length : 0;
- var bPathLen = b.path ? b.path.length : 0;
- cmp = bPathLen - aPathLen;
- if (cmp !== 0) {
- return cmp;
- }
+Auth.and32 = function(a, b){
+ return [a[0] & b[0], a[1] & b[1]];
+};
- // ascending for time: a CMP b
- var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
- var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
- cmp = aTime - bTime;
- if (cmp !== 0) {
- return cmp;
- }
+Auth.shl32 = function(a, b){
+ // assume b is 16 or less
+ var w1 = a[1] << b;
+ var w2 = (a[0] << b) | ((w1 & 0xFFFF0000) >> 16);
- // break ties for the same millisecond (precision of JavaScript's clock)
- cmp = a.creationIndex - b.creationIndex;
+ return [w2 & 0xFFFF, w1 & 0xFFFF];
+};
- return cmp;
-}
+Auth.int31Write = function(buffer, number, offset) {
+ buffer[offset] = (number[0] >> 8) & 0x7F;
+ buffer[offset + 1] = (number[0]) & 0xFF;
+ buffer[offset + 2] = (number[1] >> 8) & 0xFF;
+ buffer[offset + 3] = (number[1]) & 0xFF;
+};
-// Gives the permutation of all possible pathMatch()es of a given path. The
-// array is in longest-to-shortest order. Handy for indexing.
-function permutePath(path) {
- if (path === '/') {
- return ['/'];
- }
- if (path.lastIndexOf('/') === path.length-1) {
- path = path.substr(0,path.length-1);
- }
- var permutations = [path];
- while (path.length > 1) {
- var lindex = path.lastIndexOf('/');
- if (lindex === 0) {
- break;
- }
- path = path.substr(0,lindex);
- permutations.push(path);
- }
- permutations.push('/');
- return permutations;
+Auth.int32Read = function(buffer, offset){
+ return (buffer[offset] << 24)
+ + (buffer[offset + 1] << 16)
+ + (buffer[offset + 2] << 8)
+ + (buffer[offset + 3]);
+};
+
+
+/***/ }),
+
+/***/ 87768:
+/***/ ((module) => {
+
+
+module.exports = BufferList;
+function BufferList() {
+ this.bufs = [];
+ this.size = 0;
}
-function getCookieContext(url) {
- if (url instanceof Object) {
- return url;
- }
- // NOTE: decodeURI will throw on malformed URIs (see GH-32).
- // Therefore, we will just skip decoding for such URIs.
- try {
- url = decodeURI(url);
+BufferList.prototype.shift = function shift() {
+ var buf = this.bufs.shift();
+
+ if (buf) {
+ this.size -= buf.length;
}
- catch(err) {
- // Silently swallow error
+
+ return buf;
+};
+
+BufferList.prototype.push = function push(buf) {
+ if (!buf || !buf.length) {
+ return;
}
- return urlParse(url);
-}
+ this.bufs.push(buf);
+ this.size += buf.length;
+};
-function Cookie(options) {
- options = options || {};
- Object.keys(options).forEach(function(prop) {
- if (Cookie.prototype.hasOwnProperty(prop) &&
- Cookie.prototype[prop] !== options[prop] &&
- prop.substr(0,1) !== '_')
- {
- this[prop] = options[prop];
- }
- }, this);
+/***/ }),
- this.creation = this.creation || new Date();
+/***/ 32114:
+/***/ ((module) => {
- // used to break creation ties in cookieCompare():
- Object.defineProperty(this, 'creationIndex', {
- configurable: false,
- enumerable: false, // important for assert.deepEqual checks
- writable: true,
- value: ++Cookie.cookiesCreated
- });
+module.exports = PacketHeader;
+function PacketHeader(length, number) {
+ this.length = length;
+ this.number = number;
}
-Cookie.cookiesCreated = 0; // incremented each time a cookie is created
-Cookie.parse = parse;
-Cookie.fromJSON = fromJSON;
+/***/ }),
-Cookie.prototype.key = "";
-Cookie.prototype.value = "";
+/***/ 36639:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-// the order in which the RFC has them:
-Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
-Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
-Cookie.prototype.domain = null;
-Cookie.prototype.path = null;
-Cookie.prototype.secure = false;
-Cookie.prototype.httpOnly = false;
-Cookie.prototype.extensions = null;
+var BIT_16 = Math.pow(2, 16);
+var BIT_24 = Math.pow(2, 24);
+var BUFFER_ALLOC_SIZE = Math.pow(2, 8);
+// The maximum precision JS Numbers can hold precisely
+// Don't panic: Good enough to represent byte values up to 8192 TB
+var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53);
+var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1;
+var Buffer = __nccwpck_require__(21867).Buffer;
-// set by the CookieJar:
-Cookie.prototype.hostOnly = null; // boolean when set
-Cookie.prototype.pathIsDefault = null; // boolean when set
-Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
-Cookie.prototype.lastAccessed = null; // Date when set
-Object.defineProperty(Cookie.prototype, 'creationIndex', {
- configurable: true,
- enumerable: false,
- writable: true,
- value: 0
-});
+module.exports = PacketWriter;
+function PacketWriter() {
+ this._buffer = null;
+ this._offset = 0;
+}
-Cookie.serializableProperties = Object.keys(Cookie.prototype)
- .filter(function(prop) {
- return !(
- Cookie.prototype[prop] instanceof Function ||
- prop === 'creationIndex' ||
- prop.substr(0,1) === '_'
- );
- });
+PacketWriter.prototype.toBuffer = function toBuffer(parser) {
+ if (!this._buffer) {
+ this._buffer = Buffer.alloc(0);
+ this._offset = 0;
+ }
-Cookie.prototype.inspect = function inspect() {
- var now = Date.now();
- return 'Cookie="'+this.toString() +
- '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
- '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
- '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
- '"';
-};
+ var buffer = this._buffer;
+ var length = this._offset;
+ var packets = Math.floor(length / MAX_PACKET_LENGTH) + 1;
-// Use the new custom inspection symbol to add the custom inspect function if
-// available.
-if (util.inspect.custom) {
- Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;
-}
+ this._buffer = Buffer.allocUnsafe(length + packets * 4);
+ this._offset = 0;
-Cookie.prototype.toJSON = function() {
- var obj = {};
+ for (var packet = 0; packet < packets; packet++) {
+ var isLast = (packet + 1 === packets);
+ var packetLength = (isLast)
+ ? length % MAX_PACKET_LENGTH
+ : MAX_PACKET_LENGTH;
- var props = Cookie.serializableProperties;
- for (var i=0; i> (i * 8)) & 0xff;
}
- return true;
};
-Cookie.prototype.setExpires = function setExpires(exp) {
- if (exp instanceof Date) {
- this.expires = exp;
- } else {
- this.expires = parseDate(exp) || "Infinity";
+PacketWriter.prototype.writeFiller = function(bytes) {
+ this._allocate(bytes);
+
+ for (var i = 0; i < bytes; i++) {
+ this._buffer[this._offset++] = 0x00;
}
};
-Cookie.prototype.setMaxAge = function setMaxAge(age) {
- if (age === Infinity || age === -Infinity) {
- this.maxAge = age.toString(); // so JSON.stringify() works
- } else {
- this.maxAge = age;
- }
+PacketWriter.prototype.writeNullTerminatedString = function(value, encoding) {
+ // Typecast undefined into '' and numbers into strings
+ value = value || '';
+ value = value + '';
+
+ var bytes = Buffer.byteLength(value, encoding || 'utf-8') + 1;
+ this._allocate(bytes);
+
+ this._buffer.write(value, this._offset, encoding);
+ this._buffer[this._offset + bytes - 1] = 0x00;
+
+ this._offset += bytes;
};
-// gives Cookie header format
-Cookie.prototype.cookieString = function cookieString() {
- var val = this.value;
- if (val == null) {
- val = '';
- }
- if (this.key === '') {
- return val;
- }
- return this.key+'='+val;
+PacketWriter.prototype.writeString = function(value) {
+ // Typecast undefined into '' and numbers into strings
+ value = value || '';
+ value = value + '';
+
+ var bytes = Buffer.byteLength(value, 'utf-8');
+ this._allocate(bytes);
+
+ this._buffer.write(value, this._offset, 'utf-8');
+
+ this._offset += bytes;
};
-// gives Set-Cookie header format
-Cookie.prototype.toString = function toString() {
- var str = this.cookieString();
+PacketWriter.prototype.writeBuffer = function(value) {
+ var bytes = value.length;
- if (this.expires != Infinity) {
- if (this.expires instanceof Date) {
- str += '; Expires='+formatDate(this.expires);
- } else {
- str += '; Expires='+this.expires;
- }
- }
+ this._allocate(bytes);
+ value.copy(this._buffer, this._offset);
+ this._offset += bytes;
+};
- if (this.maxAge != null && this.maxAge != Infinity) {
- str += '; Max-Age='+this.maxAge;
+PacketWriter.prototype.writeLengthCodedNumber = function(value) {
+ if (value === null) {
+ this._allocate(1);
+ this._buffer[this._offset++] = 251;
+ return;
}
- if (this.domain && !this.hostOnly) {
- str += '; Domain='+this.domain;
- }
- if (this.path) {
- str += '; Path='+this.path;
+ if (value <= 250) {
+ this._allocate(1);
+ this._buffer[this._offset++] = value;
+ return;
}
- if (this.secure) {
- str += '; Secure';
+ if (value > IEEE_754_BINARY_64_PRECISION) {
+ throw new Error(
+ 'writeLengthCodedNumber: JS precision range exceeded, your ' +
+ 'number is > 53 bit: "' + value + '"'
+ );
}
- if (this.httpOnly) {
- str += '; HttpOnly';
+
+ if (value < BIT_16) {
+ this._allocate(3);
+ this._buffer[this._offset++] = 252;
+ } else if (value < BIT_24) {
+ this._allocate(4);
+ this._buffer[this._offset++] = 253;
+ } else {
+ this._allocate(9);
+ this._buffer[this._offset++] = 254;
}
- if (this.extensions) {
- this.extensions.forEach(function(ext) {
- str += '; '+ext;
- });
+
+ // 16 Bit
+ this._buffer[this._offset++] = value & 0xff;
+ this._buffer[this._offset++] = (value >> 8) & 0xff;
+
+ if (value < BIT_16) {
+ return;
}
- return str;
-};
+ // 24 Bit
+ this._buffer[this._offset++] = (value >> 16) & 0xff;
-// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere)
-// S5.3 says to give the "latest representable date" for which we use Infinity
-// For "expired" we use 0
-Cookie.prototype.TTL = function TTL(now) {
- /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
- * attribute, the Max-Age attribute has precedence and controls the
- * expiration date of the cookie.
- * (Concurs with S5.3 step 3)
- */
- if (this.maxAge != null) {
- return this.maxAge<=0 ? 0 : this.maxAge*1000;
+ if (value < BIT_24) {
+ return;
}
- var expires = this.expires;
- if (expires != Infinity) {
- if (!(expires instanceof Date)) {
- expires = parseDate(expires) || Infinity;
- }
+ this._buffer[this._offset++] = (value >> 24) & 0xff;
- if (expires == Infinity) {
- return Infinity;
- }
+ // Hack: Get the most significant 32 bit (JS bitwise operators are 32 bit)
+ value = value.toString(2);
+ value = value.substr(0, value.length - 32);
+ value = parseInt(value, 2);
- return expires.getTime() - (now || Date.now());
- }
+ this._buffer[this._offset++] = value & 0xff;
+ this._buffer[this._offset++] = (value >> 8) & 0xff;
+ this._buffer[this._offset++] = (value >> 16) & 0xff;
- return Infinity;
+ // Set last byte to 0, as we can only support 53 bits in JS (see above)
+ this._buffer[this._offset++] = 0;
};
-// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere)
-Cookie.prototype.expiryTime = function expiryTime(now) {
- if (this.maxAge != null) {
- var relativeTo = now || this.creation || new Date();
- var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
- return relativeTo.getTime() + age;
- }
+PacketWriter.prototype.writeLengthCodedBuffer = function(value) {
+ var bytes = value.length;
+ this.writeLengthCodedNumber(bytes);
+ this.writeBuffer(value);
+};
- if (this.expires == Infinity) {
- return Infinity;
- }
- return this.expires.getTime();
+PacketWriter.prototype.writeNullTerminatedBuffer = function(value) {
+ this.writeBuffer(value);
+ this.writeFiller(1); // 0x00 terminator
};
-// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
-// elsewhere), except it returns a Date
-Cookie.prototype.expiryDate = function expiryDate(now) {
- var millisec = this.expiryTime(now);
- if (millisec == Infinity) {
- return new Date(MAX_TIME);
- } else if (millisec == -Infinity) {
- return new Date(MIN_TIME);
- } else {
- return new Date(millisec);
+PacketWriter.prototype.writeLengthCodedString = function(value) {
+ if (value === null) {
+ this.writeLengthCodedNumber(null);
+ return;
}
-};
-// This replaces the "persistent-flag" parts of S5.3 step 3
-Cookie.prototype.isPersistent = function isPersistent() {
- return (this.maxAge != null || this.expires != Infinity);
-};
+ value = (value === undefined)
+ ? ''
+ : String(value);
-// Mostly S5.1.2 and S5.2.3:
-Cookie.prototype.cdomain =
-Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
- if (this.domain == null) {
- return null;
+ var bytes = Buffer.byteLength(value, 'utf-8');
+ this.writeLengthCodedNumber(bytes);
+
+ if (!bytes) {
+ return;
}
- return canonicalDomain(this.domain);
+
+ this._allocate(bytes);
+ this._buffer.write(value, this._offset, 'utf-8');
+ this._offset += bytes;
};
-function CookieJar(store, options) {
- if (typeof options === "boolean") {
- options = {rejectPublicSuffixes: options};
- } else if (options == null) {
- options = {};
- }
- if (options.rejectPublicSuffixes != null) {
- this.rejectPublicSuffixes = options.rejectPublicSuffixes;
- }
- if (options.looseMode != null) {
- this.enableLooseMode = options.looseMode;
+PacketWriter.prototype._allocate = function _allocate(bytes) {
+ if (!this._buffer) {
+ this._buffer = Buffer.alloc(Math.max(BUFFER_ALLOC_SIZE, bytes));
+ this._offset = 0;
+ return;
}
- if (!store) {
- store = new MemoryCookieStore();
+ var bytesRemaining = this._buffer.length - this._offset;
+ if (bytesRemaining >= bytes) {
+ return;
}
- this.store = store;
-}
-CookieJar.prototype.store = null;
-CookieJar.prototype.rejectPublicSuffixes = true;
-CookieJar.prototype.enableLooseMode = false;
-var CAN_BE_SYNC = [];
-CAN_BE_SYNC.push('setCookie');
-CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
- var err;
- var context = getCookieContext(url);
- if (options instanceof Function) {
- cb = options;
- options = {};
- }
+ var newSize = this._buffer.length + Math.max(BUFFER_ALLOC_SIZE, bytes);
+ var oldBuffer = this._buffer;
- var host = canonicalDomain(context.hostname);
- var loose = this.enableLooseMode;
- if (options.loose != null) {
- loose = options.loose;
- }
+ this._buffer = Buffer.alloc(newSize);
+ oldBuffer.copy(this._buffer);
+};
- // S5.3 step 1
- if (!(cookie instanceof Cookie)) {
- cookie = Cookie.parse(cookie, { loose: loose });
- }
- if (!cookie) {
- err = new Error("Cookie failed to parse");
- return cb(options.ignoreError ? null : err);
- }
- // S5.3 step 2
- var now = options.now || new Date(); // will assign later to save effort in the face of errors
+/***/ }),
- // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
+/***/ 82017:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // S5.3 step 4: NOOP; domain is null by default
+var PacketHeader = __nccwpck_require__(32114);
+var BigNumber = __nccwpck_require__(87558);
+var Buffer = __nccwpck_require__(21867).Buffer;
+var BufferList = __nccwpck_require__(87768);
- // S5.3 step 5: public suffixes
- if (this.rejectPublicSuffixes && cookie.domain) {
- var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
- if (suffix == null) { // e.g. "com"
- err = new Error("Cookie has domain set to a public suffix");
- return cb(options.ignoreError ? null : err);
- }
- }
+var MAX_PACKET_LENGTH = Math.pow(2, 24) - 1;
+var MUL_32BIT = Math.pow(2, 32);
+var PACKET_HEADER_LENGTH = 4;
- // S5.3 step 6:
- if (cookie.domain) {
- if (!domainMatch(host, cookie.cdomain(), false)) {
- err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
- return cb(options.ignoreError ? null : err);
+module.exports = Parser;
+function Parser(options) {
+ options = options || {};
+
+ this._supportBigNumbers = options.config && options.config.supportBigNumbers;
+ this._buffer = Buffer.alloc(0);
+ this._nextBuffers = new BufferList();
+ this._longPacketBuffers = new BufferList();
+ this._offset = 0;
+ this._packetEnd = null;
+ this._packetHeader = null;
+ this._packetOffset = null;
+ this._onError = options.onError || function(err) { throw err; };
+ this._onPacket = options.onPacket || function() {};
+ this._nextPacketNumber = 0;
+ this._encoding = 'utf-8';
+ this._paused = false;
+}
+
+Parser.prototype.write = function write(chunk) {
+ this._nextBuffers.push(chunk);
+
+ while (!this._paused) {
+ var packetHeader = this._tryReadPacketHeader();
+
+ if (!packetHeader) {
+ break;
}
- if (cookie.hostOnly == null) { // don't reset if already set
- cookie.hostOnly = false;
+ if (!this._combineNextBuffers(packetHeader.length)) {
+ break;
}
- } else {
- cookie.hostOnly = true;
- cookie.domain = host;
+ this._parsePacket(packetHeader);
}
+};
- //S5.2.4 If the attribute-value is empty or if the first character of the
- //attribute-value is not %x2F ("/"):
- //Let cookie-path be the default-path.
- if (!cookie.path || cookie.path[0] !== '/') {
- cookie.path = defaultPath(context.pathname);
- cookie.pathIsDefault = true;
+Parser.prototype.append = function append(chunk) {
+ if (!chunk || chunk.length === 0) {
+ return;
}
- // S5.3 step 8: NOOP; secure attribute
- // S5.3 step 9: NOOP; httpOnly attribute
-
- // S5.3 step 10
- if (options.http === false && cookie.httpOnly) {
- err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
+ // Calculate slice ranges
+ var sliceEnd = this._buffer.length;
+ var sliceStart = this._packetOffset === null
+ ? this._offset
+ : this._packetOffset;
+ var sliceLength = sliceEnd - sliceStart;
- var store = this.store;
+ // Get chunk data
+ var buffer = null;
+ var chunks = !(chunk instanceof Array || Array.isArray(chunk)) ? [chunk] : chunk;
+ var length = 0;
+ var offset = 0;
- if (!store.updateCookie) {
- store.updateCookie = function(oldCookie, newCookie, cb) {
- this.putCookie(newCookie, cb);
- };
+ for (var i = 0; i < chunks.length; i++) {
+ length += chunks[i].length;
}
- function withCookie(err, oldCookie) {
- if (err) {
- return cb(err);
- }
+ if (sliceLength !== 0) {
+ // Create a new Buffer
+ buffer = Buffer.allocUnsafe(sliceLength + length);
+ offset = 0;
- var next = function(err) {
- if (err) {
- return cb(err);
- } else {
- cb(null, cookie);
- }
- };
+ // Copy data slice
+ offset += this._buffer.copy(buffer, 0, sliceStart, sliceEnd);
- if (oldCookie) {
- // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
- // domain, and path as the newly created cookie:"
- if (options.http === false && oldCookie.httpOnly) { // step 11.2
- err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
- return cb(options.ignoreError ? null : err);
- }
- cookie.creation = oldCookie.creation; // step 11.3
- cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
- cookie.lastAccessed = now;
- // Step 11.4 (delete cookie) is implied by just setting the new one:
- store.updateCookie(oldCookie, cookie, next); // step 12
+ // Copy chunks
+ for (var i = 0; i < chunks.length; i++) {
+ offset += chunks[i].copy(buffer, offset);
+ }
+ } else if (chunks.length > 1) {
+ // Create a new Buffer
+ buffer = Buffer.allocUnsafe(length);
+ offset = 0;
- } else {
- cookie.creation = cookie.lastAccessed = now;
- store.putCookie(cookie, next); // step 12
+ // Copy chunks
+ for (var i = 0; i < chunks.length; i++) {
+ offset += chunks[i].copy(buffer, offset);
}
+ } else {
+ // Buffer is the only chunk
+ buffer = chunks[0];
}
- store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
+ // Adjust data-tracking pointers
+ this._buffer = buffer;
+ this._offset = this._offset - sliceStart;
+ this._packetEnd = this._packetEnd !== null
+ ? this._packetEnd - sliceStart
+ : null;
+ this._packetOffset = this._packetOffset !== null
+ ? this._packetOffset - sliceStart
+ : null;
};
-// RFC6365 S5.4
-CAN_BE_SYNC.push('getCookies');
-CookieJar.prototype.getCookies = function(url, options, cb) {
- var context = getCookieContext(url);
- if (options instanceof Function) {
- cb = options;
- options = {};
+Parser.prototype.pause = function() {
+ this._paused = true;
+};
+
+Parser.prototype.resume = function() {
+ this._paused = false;
+
+ // nextTick() to avoid entering write() multiple times within the same stack
+ // which would cause problems as write manipulates the state of the object.
+ process.nextTick(this.write.bind(this));
+};
+
+Parser.prototype.peak = function peak(offset) {
+ return this._buffer[this._offset + (offset >>> 0)];
+};
+
+Parser.prototype.parseUnsignedNumber = function parseUnsignedNumber(bytes) {
+ if (bytes === 1) {
+ return this._buffer[this._offset++];
}
- var host = canonicalDomain(context.hostname);
- var path = context.pathname || '/';
+ var buffer = this._buffer;
+ var offset = this._offset + bytes - 1;
+ var value = 0;
- var secure = options.secure;
- if (secure == null && context.protocol &&
- (context.protocol == 'https:' || context.protocol == 'wss:'))
- {
- secure = true;
+ if (bytes > 4) {
+ var err = new Error('parseUnsignedNumber: Supports only up to 4 bytes');
+ err.offset = (this._offset - this._packetOffset - 1);
+ err.code = 'PARSER_UNSIGNED_TOO_LONG';
+ throw err;
}
- var http = options.http;
- if (http == null) {
- http = true;
+ while (offset >= this._offset) {
+ value = ((value << 8) | buffer[offset]) >>> 0;
+ offset--;
}
- var now = options.now || Date.now();
- var expireCheck = options.expire !== false;
- var allPaths = !!options.allPaths;
- var store = this.store;
+ this._offset += bytes;
- function matchingCookie(c) {
- // "Either:
- // The cookie's host-only-flag is true and the canonicalized
- // request-host is identical to the cookie's domain.
- // Or:
- // The cookie's host-only-flag is false and the canonicalized
- // request-host domain-matches the cookie's domain."
- if (c.hostOnly) {
- if (c.domain != host) {
- return false;
- }
- } else {
- if (!domainMatch(host, c.domain, false)) {
- return false;
- }
- }
+ return value;
+};
- // "The request-uri's path path-matches the cookie's path."
- if (!allPaths && !pathMatch(path, c.path)) {
- return false;
- }
+Parser.prototype.parseLengthCodedString = function() {
+ var length = this.parseLengthCodedNumber();
- // "If the cookie's secure-only-flag is true, then the request-uri's
- // scheme must denote a "secure" protocol"
- if (c.secure && !secure) {
- return false;
- }
+ if (length === null) {
+ return null;
+ }
- // "If the cookie's http-only-flag is true, then exclude the cookie if the
- // cookie-string is being generated for a "non-HTTP" API"
- if (c.httpOnly && !http) {
- return false;
- }
+ return this.parseString(length);
+};
- // deferred from S5.3
- // non-RFC: allow retention of expired cookies by choice
- if (expireCheck && c.expiryTime() <= now) {
- store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
- return false;
- }
+Parser.prototype.parseLengthCodedBuffer = function() {
+ var length = this.parseLengthCodedNumber();
- return true;
+ if (length === null) {
+ return null;
}
- store.findCookies(host, allPaths ? null : path, function(err,cookies) {
- if (err) {
- return cb(err);
- }
+ return this.parseBuffer(length);
+};
- cookies = cookies.filter(matchingCookie);
+Parser.prototype.parseLengthCodedNumber = function parseLengthCodedNumber() {
+ if (this._offset >= this._buffer.length) {
+ var err = new Error('Parser: read past end');
+ err.offset = (this._offset - this._packetOffset);
+ err.code = 'PARSER_READ_PAST_END';
+ throw err;
+ }
- // sorting of S5.4 part 2
- if (options.sort !== false) {
- cookies = cookies.sort(cookieCompare);
- }
+ var bits = this._buffer[this._offset++];
- // S5.4 part 3
- var now = new Date();
- cookies.forEach(function(c) {
- c.lastAccessed = now;
- });
- // TODO persist lastAccessed
+ if (bits <= 250) {
+ return bits;
+ }
- cb(null,cookies);
- });
-};
+ switch (bits) {
+ case 251:
+ return null;
+ case 252:
+ return this.parseUnsignedNumber(2);
+ case 253:
+ return this.parseUnsignedNumber(3);
+ case 254:
+ break;
+ default:
+ var err = new Error('Unexpected first byte' + (bits ? ': 0x' + bits.toString(16) : ''));
+ err.offset = (this._offset - this._packetOffset - 1);
+ err.code = 'PARSER_BAD_LENGTH_BYTE';
+ throw err;
+ }
-CAN_BE_SYNC.push('getCookieString');
-CookieJar.prototype.getCookieString = function(/*..., cb*/) {
- var args = Array.prototype.slice.call(arguments,0);
- var cb = args.pop();
- var next = function(err,cookies) {
- if (err) {
- cb(err);
- } else {
- cb(null, cookies
- .sort(cookieCompare)
- .map(function(c){
- return c.cookieString();
- })
- .join('; '));
+ var low = this.parseUnsignedNumber(4);
+ var high = this.parseUnsignedNumber(4);
+ var value;
+
+ if (high >>> 21) {
+ value = BigNumber(MUL_32BIT).times(high).plus(low).toString();
+
+ if (this._supportBigNumbers) {
+ return value;
}
- };
- args.push(next);
- this.getCookies.apply(this,args);
+
+ var err = new Error(
+ 'parseLengthCodedNumber: JS precision range exceeded, ' +
+ 'number is >= 53 bit: "' + value + '"'
+ );
+ err.offset = (this._offset - this._packetOffset - 8);
+ err.code = 'PARSER_JS_PRECISION_RANGE_EXCEEDED';
+ throw err;
+ }
+
+ value = low + (MUL_32BIT * high);
+
+ return value;
};
-CAN_BE_SYNC.push('getSetCookieStrings');
-CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
- var args = Array.prototype.slice.call(arguments,0);
- var cb = args.pop();
- var next = function(err,cookies) {
- if (err) {
- cb(err);
- } else {
- cb(null, cookies.map(function(c){
- return c.toString();
- }));
- }
- };
- args.push(next);
- this.getCookies.apply(this,args);
+Parser.prototype.parseFiller = function(length) {
+ return this.parseBuffer(length);
};
-CAN_BE_SYNC.push('serialize');
-CookieJar.prototype.serialize = function(cb) {
- var type = this.store.constructor.name;
- if (type === 'Object') {
- type = null;
- }
+Parser.prototype.parseNullTerminatedBuffer = function() {
+ var end = this._nullByteOffset();
+ var value = this._buffer.slice(this._offset, end);
+ this._offset = end + 1;
- // update README.md "Serialization Format" if you change this, please!
- var serialized = {
- // The version of tough-cookie that serialized this jar. Generally a good
- // practice since future versions can make data import decisions based on
- // known past behavior. When/if this matters, use `semver`.
- version: 'tough-cookie@'+VERSION,
+ return value;
+};
+
+Parser.prototype.parseNullTerminatedString = function() {
+ var end = this._nullByteOffset();
+ var value = this._buffer.toString(this._encoding, this._offset, end);
+ this._offset = end + 1;
- // add the store type, to make humans happy:
- storeType: type,
+ return value;
+};
- // CookieJar configuration:
- rejectPublicSuffixes: !!this.rejectPublicSuffixes,
+Parser.prototype._nullByteOffset = function() {
+ var offset = this._offset;
- // this gets filled from getAllCookies:
- cookies: []
- };
+ while (this._buffer[offset] !== 0x00) {
+ offset++;
- if (!(this.store.getAllCookies &&
- typeof this.store.getAllCookies === 'function'))
- {
- return cb(new Error('store does not support getAllCookies and cannot be serialized'));
+ if (offset >= this._buffer.length) {
+ var err = new Error('Offset of null terminated string not found.');
+ err.offset = (this._offset - this._packetOffset);
+ err.code = 'PARSER_MISSING_NULL_BYTE';
+ throw err;
+ }
}
- this.store.getAllCookies(function(err,cookies) {
- if (err) {
- return cb(err);
- }
+ return offset;
+};
- serialized.cookies = cookies.map(function(cookie) {
- // convert to serialized 'raw' cookies
- cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;
+Parser.prototype.parsePacketTerminatedBuffer = function parsePacketTerminatedBuffer() {
+ var length = this._packetEnd - this._offset;
+ return this.parseBuffer(length);
+};
- // Remove the index so new ones get assigned during deserialization
- delete cookie.creationIndex;
+Parser.prototype.parsePacketTerminatedString = function() {
+ var length = this._packetEnd - this._offset;
+ return this.parseString(length);
+};
- return cookie;
- });
+Parser.prototype.parseBuffer = function(length) {
+ var response = Buffer.alloc(length);
+ this._buffer.copy(response, 0, this._offset, this._offset + length);
- return cb(null, serialized);
- });
+ this._offset += length;
+ return response;
};
-// well-known name that JSON.stringify calls
-CookieJar.prototype.toJSON = function() {
- return this.serializeSync();
+Parser.prototype.parseString = function(length) {
+ var offset = this._offset;
+ var end = offset + length;
+ var value = this._buffer.toString(this._encoding, offset, end);
+
+ this._offset = end;
+ return value;
};
-// use the class method CookieJar.deserialize instead of calling this directly
-CAN_BE_SYNC.push('_importCookies');
-CookieJar.prototype._importCookies = function(serialized, cb) {
- var jar = this;
- var cookies = serialized.cookies;
- if (!cookies || !Array.isArray(cookies)) {
- return cb(new Error('serialized jar has no cookies array'));
+Parser.prototype.parseGeometryValue = function() {
+ var buffer = this.parseLengthCodedBuffer();
+ var offset = 4;
+
+ if (buffer === null || !buffer.length) {
+ return null;
}
- cookies = cookies.slice(); // do not modify the original
- function putNext(err) {
- if (err) {
- return cb(err);
+ function parseGeometry() {
+ var result = null;
+ var byteOrder = buffer.readUInt8(offset); offset += 1;
+ var wkbType = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
+ switch (wkbType) {
+ case 1: // WKBPoint
+ var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ result = {x: x, y: y};
+ break;
+ case 2: // WKBLineString
+ var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
+ result = [];
+ for (var i = numPoints; i > 0; i--) {
+ var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ result.push({x: x, y: y});
+ }
+ break;
+ case 3: // WKBPolygon
+ var numRings = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
+ result = [];
+ for (var i = numRings; i > 0; i--) {
+ var numPoints = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
+ var line = [];
+ for (var j = numPoints; j > 0; j--) {
+ var x = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ var y = byteOrder ? buffer.readDoubleLE(offset) : buffer.readDoubleBE(offset); offset += 8;
+ line.push({x: x, y: y});
+ }
+ result.push(line);
+ }
+ break;
+ case 4: // WKBMultiPoint
+ case 5: // WKBMultiLineString
+ case 6: // WKBMultiPolygon
+ case 7: // WKBGeometryCollection
+ var num = byteOrder ? buffer.readUInt32LE(offset) : buffer.readUInt32BE(offset); offset += 4;
+ var result = [];
+ for (var i = num; i > 0; i--) {
+ result.push(parseGeometry());
+ }
+ break;
}
+ return result;
+ }
+ return parseGeometry();
+};
- if (!cookies.length) {
- return cb(err, jar);
- }
+Parser.prototype.reachedPacketEnd = function() {
+ return this._offset === this._packetEnd;
+};
- var cookie;
- try {
- cookie = fromJSON(cookies.shift());
- } catch (e) {
- return cb(e);
- }
+Parser.prototype.incrementPacketNumber = function() {
+ var currentPacketNumber = this._nextPacketNumber;
+ this._nextPacketNumber = (this._nextPacketNumber + 1) % 256;
- if (cookie === null) {
- return putNext(null); // skip this cookie
- }
+ return currentPacketNumber;
+};
- jar.store.putCookie(cookie, putNext);
+Parser.prototype.resetPacketNumber = function() {
+ this._nextPacketNumber = 0;
+};
+
+Parser.prototype.packetLength = function packetLength() {
+ if (!this._packetHeader) {
+ return null;
}
- putNext();
+ return this._packetHeader.length + this._longPacketBuffers.size;
};
-CookieJar.deserialize = function(strOrObj, store, cb) {
- if (arguments.length !== 3) {
- // store is optional
- cb = store;
- store = null;
- }
+Parser.prototype._combineNextBuffers = function _combineNextBuffers(bytes) {
+ var length = this._buffer.length - this._offset;
- var serialized;
- if (typeof strOrObj === 'string') {
- serialized = jsonParse(strOrObj);
- if (serialized instanceof Error) {
- return cb(serialized);
- }
- } else {
- serialized = strOrObj;
+ if (length >= bytes) {
+ return true;
}
- var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
- jar._importCookies(serialized, function(err) {
- if (err) {
- return cb(err);
- }
- cb(null, jar);
- });
-};
+ if ((length + this._nextBuffers.size) < bytes) {
+ return false;
+ }
-CookieJar.deserializeSync = function(strOrObj, store) {
- var serialized = typeof strOrObj === 'string' ?
- JSON.parse(strOrObj) : strOrObj;
- var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
+ var buffers = [];
+ var bytesNeeded = bytes - length;
- // catch this mistake early:
- if (!jar.store.synchronous) {
- throw new Error('CookieJar store is not synchronous; use async API instead.');
+ while (bytesNeeded > 0) {
+ var buffer = this._nextBuffers.shift();
+ buffers.push(buffer);
+ bytesNeeded -= buffer.length;
}
- jar._importCookiesSync(serialized);
- return jar;
+ this.append(buffers);
+ return true;
};
-CookieJar.fromJSON = CookieJar.deserializeSync;
-CookieJar.prototype.clone = function(newStore, cb) {
- if (arguments.length === 1) {
- cb = newStore;
- newStore = null;
+Parser.prototype._combineLongPacketBuffers = function _combineLongPacketBuffers() {
+ if (!this._longPacketBuffers.size) {
+ return;
}
- this.serialize(function(err,serialized) {
- if (err) {
- return cb(err);
- }
- CookieJar.deserialize(serialized, newStore, cb);
- });
-};
+ // Calculate bytes
+ var remainingBytes = this._buffer.length - this._offset;
+ var trailingPacketBytes = this._buffer.length - this._packetEnd;
-CAN_BE_SYNC.push('removeAllCookies');
-CookieJar.prototype.removeAllCookies = function(cb) {
- var store = this.store;
+ // Create buffer
+ var buf = null;
+ var buffer = Buffer.allocUnsafe(remainingBytes + this._longPacketBuffers.size);
+ var offset = 0;
- // Check that the store implements its own removeAllCookies(). The default
- // implementation in Store will immediately call the callback with a "not
- // implemented" Error.
- if (store.removeAllCookies instanceof Function &&
- store.removeAllCookies !== Store.prototype.removeAllCookies)
- {
- return store.removeAllCookies(cb);
+ // Copy long buffers
+ while ((buf = this._longPacketBuffers.shift())) {
+ offset += buf.copy(buffer, offset);
}
- store.getAllCookies(function(err, cookies) {
- if (err) {
- return cb(err);
- }
+ // Copy remaining bytes
+ this._buffer.copy(buffer, offset, this._offset);
- if (cookies.length === 0) {
- return cb(null);
- }
+ this._buffer = buffer;
+ this._offset = 0;
+ this._packetEnd = this._buffer.length - trailingPacketBytes;
+ this._packetOffset = 0;
+};
- var completedCount = 0;
- var removeErrors = [];
+Parser.prototype._parsePacket = function _parsePacket(packetHeader) {
+ this._packetEnd = this._offset + packetHeader.length;
+ this._packetOffset = this._offset;
- function removeCookieCb(removeErr) {
- if (removeErr) {
- removeErrors.push(removeErr);
- }
+ if (packetHeader.length === MAX_PACKET_LENGTH) {
+ this._longPacketBuffers.push(this._buffer.slice(this._packetOffset, this._packetEnd));
+ this._advanceToNextPacket();
+ return;
+ }
- completedCount++;
+ this._combineLongPacketBuffers();
- if (completedCount === cookies.length) {
- return cb(removeErrors.length ? removeErrors[0] : null);
- }
+ var hadException = true;
+ try {
+ this._onPacket(packetHeader);
+ hadException = false;
+ } catch (err) {
+ if (!err || typeof err.code !== 'string' || err.code.substr(0, 7) !== 'PARSER_') {
+ throw err; // Rethrow non-MySQL errors
}
- cookies.forEach(function(cookie) {
- store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb);
- });
- });
-};
+ // Pass down parser errors
+ this._onError(err);
+ hadException = false;
+ } finally {
+ this._advanceToNextPacket();
-CookieJar.prototype._cloneSync = syncWrap('clone');
-CookieJar.prototype.cloneSync = function(newStore) {
- if (!newStore.synchronous) {
- throw new Error('CookieJar clone destination store is not synchronous; use async API instead.');
+ // If there was an exception, the parser while loop will be broken out
+ // of after the finally block. So schedule a blank write to re-enter it
+ // to continue parsing any bytes that may already have been received.
+ if (hadException) {
+ process.nextTick(this.write.bind(this));
+ }
}
- return this._cloneSync(newStore);
};
-// Use a closure to provide a true imperative API for synchronous stores.
-function syncWrap(method) {
- return function() {
- if (!this.store.synchronous) {
- throw new Error('CookieJar store is not synchronous; use async API instead.');
- }
+Parser.prototype._tryReadPacketHeader = function _tryReadPacketHeader() {
+ if (this._packetHeader) {
+ return this._packetHeader;
+ }
- var args = Array.prototype.slice.call(arguments);
- var syncErr, syncResult;
- args.push(function syncCb(err, result) {
- syncErr = err;
- syncResult = result;
- });
- this[method].apply(this, args);
+ if (!this._combineNextBuffers(PACKET_HEADER_LENGTH)) {
+ return null;
+ }
- if (syncErr) {
- throw syncErr;
- }
- return syncResult;
- };
-}
+ this._packetHeader = new PacketHeader(
+ this.parseUnsignedNumber(3),
+ this.parseUnsignedNumber(1)
+ );
-// wrap all declared CAN_BE_SYNC methods in the sync wrapper
-CAN_BE_SYNC.forEach(function(method) {
- CookieJar.prototype[method+'Sync'] = syncWrap(method);
-});
+ if (this._packetHeader.number !== this._nextPacketNumber) {
+ var err = new Error(
+ 'Packets out of order. Got: ' + this._packetHeader.number + ' ' +
+ 'Expected: ' + this._nextPacketNumber
+ );
-exports.version = VERSION;
-exports.CookieJar = CookieJar;
-exports.Cookie = Cookie;
-exports.Store = Store;
-exports.MemoryCookieStore = MemoryCookieStore;
-exports.parseDate = parseDate;
-exports.formatDate = formatDate;
-exports.parse = parse;
-exports.fromJSON = fromJSON;
-exports.domainMatch = domainMatch;
-exports.defaultPath = defaultPath;
-exports.pathMatch = pathMatch;
-exports.getPublicSuffix = pubsuffix.getPublicSuffix;
-exports.cookieCompare = cookieCompare;
-exports.permuteDomain = __nccwpck_require__(91478).permuteDomain;
-exports.permutePath = permutePath;
-exports.canonicalDomain = canonicalDomain;
+ err.code = 'PROTOCOL_PACKETS_OUT_OF_ORDER';
+ err.fatal = true;
+
+ this._onError(err);
+ }
+
+ this.incrementPacketNumber();
+
+ return this._packetHeader;
+};
+
+Parser.prototype._advanceToNextPacket = function() {
+ this._offset = this._packetEnd;
+ this._packetHeader = null;
+ this._packetEnd = null;
+ this._packetOffset = null;
+};
/***/ }),
-/***/ 73533:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+/***/ 23714:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-"use strict";
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+var Parser = __nccwpck_require__(82017);
+var Sequences = __nccwpck_require__(30794);
+var Packets = __nccwpck_require__(87628);
+var Stream = __nccwpck_require__(92413).Stream;
+var Util = __nccwpck_require__(31669);
+var PacketWriter = __nccwpck_require__(36639);
-var Store = __nccwpck_require__(11013)/* .Store */ .y;
-var permuteDomain = __nccwpck_require__(91478).permuteDomain;
-var pathMatch = __nccwpck_require__(30495)/* .pathMatch */ .U;
-var util = __nccwpck_require__(31669);
+module.exports = Protocol;
+Util.inherits(Protocol, Stream);
+function Protocol(options) {
+ Stream.call(this);
-function MemoryCookieStore() {
- Store.call(this);
- this.idx = {};
-}
-util.inherits(MemoryCookieStore, Store);
-exports.m = MemoryCookieStore;
-MemoryCookieStore.prototype.idx = null;
+ options = options || {};
-// Since it's just a struct in RAM, this Store is synchronous
-MemoryCookieStore.prototype.synchronous = true;
+ this.readable = true;
+ this.writable = true;
-// force a default depth:
-MemoryCookieStore.prototype.inspect = function() {
- return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
-};
+ this._config = options.config || {};
+ this._connection = options.connection;
+ this._callback = null;
+ this._fatalError = null;
+ this._quitSequence = null;
+ this._handshake = false;
+ this._handshaked = false;
+ this._ended = false;
+ this._destroyed = false;
+ this._queue = [];
+ this._handshakeInitializationPacket = null;
-// Use the new custom inspection symbol to add the custom inspect function if
-// available.
-if (util.inspect.custom) {
- MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;
+ this._parser = new Parser({
+ onError : this.handleParserError.bind(this),
+ onPacket : this._parsePacket.bind(this),
+ config : this._config
+ });
}
-MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
- if (!this.idx[domain]) {
- return cb(null,undefined);
- }
- if (!this.idx[domain][path]) {
- return cb(null,undefined);
- }
- return cb(null,this.idx[domain][path][key]||null);
+Protocol.prototype.write = function(buffer) {
+ this._parser.write(buffer);
+ return true;
};
-MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
- var results = [];
- if (!domain) {
- return cb(null,[]);
+Protocol.prototype.handshake = function handshake(options, callback) {
+ if (typeof options === 'function') {
+ callback = options;
+ options = {};
}
- var pathMatcher;
- if (!path) {
- // null means "all paths"
- pathMatcher = function matchAll(domainIndex) {
- for (var curPath in domainIndex) {
- var pathIndex = domainIndex[curPath];
- for (var key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- };
-
- } else {
- pathMatcher = function matchRFC(domainIndex) {
- //NOTE: we should use path-match algorithm from S5.1.4 here
- //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
- Object.keys(domainIndex).forEach(function (cookiePath) {
- if (pathMatch(path, cookiePath)) {
- var pathIndex = domainIndex[cookiePath];
+ options = options || {};
+ options.config = this._config;
- for (var key in pathIndex) {
- results.push(pathIndex[key]);
- }
- }
- });
- };
- }
+ var sequence = this._enqueue(new Sequences.Handshake(options, callback));
- var domains = permuteDomain(domain) || [domain];
- var idx = this.idx;
- domains.forEach(function(curDomain) {
- var domainIndex = idx[curDomain];
- if (!domainIndex) {
- return;
- }
- pathMatcher(domainIndex);
- });
+ this._handshake = true;
- cb(null,results);
+ return sequence;
};
-MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
- if (!this.idx[cookie.domain]) {
- this.idx[cookie.domain] = {};
- }
- if (!this.idx[cookie.domain][cookie.path]) {
- this.idx[cookie.domain][cookie.path] = {};
- }
- this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
- cb(null);
+Protocol.prototype.query = function query(options, callback) {
+ return this._enqueue(new Sequences.Query(options, callback));
};
-MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {
- // updateCookie() may avoid updating cookies that are identical. For example,
- // lastAccessed may not be important to some stores and an equality
- // comparison could exclude that field.
- this.putCookie(newCookie,cb);
+Protocol.prototype.changeUser = function changeUser(options, callback) {
+ return this._enqueue(new Sequences.ChangeUser(options, callback));
};
-MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {
- if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
- delete this.idx[domain][path][key];
+Protocol.prototype.ping = function ping(options, callback) {
+ if (typeof options === 'function') {
+ callback = options;
+ options = {};
}
- cb(null);
+
+ return this._enqueue(new Sequences.Ping(options, callback));
};
-MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {
- if (this.idx[domain]) {
- if (path) {
- delete this.idx[domain][path];
- } else {
- delete this.idx[domain];
- }
+Protocol.prototype.stats = function stats(options, callback) {
+ if (typeof options === 'function') {
+ callback = options;
+ options = {};
}
- return cb(null);
-};
-MemoryCookieStore.prototype.removeAllCookies = function(cb) {
- this.idx = {};
- return cb(null);
-}
+ return this._enqueue(new Sequences.Statistics(options, callback));
+};
-MemoryCookieStore.prototype.getAllCookies = function(cb) {
- var cookies = [];
- var idx = this.idx;
+Protocol.prototype.quit = function quit(options, callback) {
+ if (typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
- var domains = Object.keys(idx);
- domains.forEach(function(domain) {
- var paths = Object.keys(idx[domain]);
- paths.forEach(function(path) {
- var keys = Object.keys(idx[domain][path]);
- keys.forEach(function(key) {
- if (key !== null) {
- cookies.push(idx[domain][path][key]);
- }
- });
- });
- });
+ var self = this;
+ var sequence = this._enqueue(new Sequences.Quit(options, callback));
- // Sort by creationIndex so deserializing retains the creation order.
- // When implementing your own store, this SHOULD retain the order too
- cookies.sort(function(a,b) {
- return (a.creationIndex||0) - (b.creationIndex||0);
+ sequence.on('end', function () {
+ self.end();
});
- cb(null, cookies);
+ return this._quitSequence = sequence;
};
-
-/***/ }),
-
-/***/ 30495:
-/***/ ((__unused_webpack_module, exports) => {
-
-"use strict";
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * "A request-path path-matches a given cookie-path if at least one of the
- * following conditions holds:"
- */
-function pathMatch (reqPath, cookiePath) {
- // "o The cookie-path and the request-path are identical."
- if (cookiePath === reqPath) {
- return true;
+Protocol.prototype.end = function() {
+ if (this._ended) {
+ return;
}
+ this._ended = true;
- var idx = reqPath.indexOf(cookiePath);
- if (idx === 0) {
- // "o The cookie-path is a prefix of the request-path, and the last
- // character of the cookie-path is %x2F ("/")."
- if (cookiePath.substr(-1) === "/") {
- return true;
- }
-
- // " o The cookie-path is a prefix of the request-path, and the first
- // character of the request-path that is not included in the cookie- path
- // is a %x2F ("/") character."
- if (reqPath.substr(cookiePath.length, 1) === "/") {
- return true;
- }
+ if (this._quitSequence && (this._quitSequence._ended || this._queue[0] === this._quitSequence)) {
+ this._quitSequence.end();
+ this.emit('end');
+ return;
}
- return false;
-}
-
-exports.U = pathMatch;
-
-
-/***/ }),
-
-/***/ 91478:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-"use strict";
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+ var err = new Error('Connection lost: The server closed the connection.');
+ err.fatal = true;
+ err.code = 'PROTOCOL_CONNECTION_LOST';
-var pubsuffix = __nccwpck_require__(34964);
+ this._delegateError(err);
+};
-// Gives the permutation of all possible domainMatch()es of a given domain. The
-// array is in shortest-to-longest order. Handy for indexing.
-function permuteDomain (domain) {
- var pubSuf = pubsuffix.getPublicSuffix(domain);
- if (!pubSuf) {
- return null;
- }
- if (pubSuf == domain) {
- return [domain];
+Protocol.prototype.pause = function() {
+ this._parser.pause();
+ // Since there is a file stream in query, we must transmit pause/resume event to current sequence.
+ var seq = this._queue[0];
+ if (seq && seq.emit) {
+ seq.emit('pause');
}
+};
- var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com"
- var parts = prefix.split('.').reverse();
- var cur = pubSuf;
- var permutations = [cur];
- while (parts.length) {
- cur = parts.shift() + '.' + cur;
- permutations.push(cur);
+Protocol.prototype.resume = function() {
+ this._parser.resume();
+ // Since there is a file stream in query, we must transmit pause/resume event to current sequence.
+ var seq = this._queue[0];
+ if (seq && seq.emit) {
+ seq.emit('resume');
}
- return permutations;
-}
-
-exports.permuteDomain = permuteDomain;
-
-
-/***/ }),
-
-/***/ 34964:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
+};
-"use strict";
-/*!
- * Copyright (c) 2018, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+Protocol.prototype._enqueue = function(sequence) {
+ if (!this._validateEnqueue(sequence)) {
+ return sequence;
+ }
-var psl = __nccwpck_require__(29975);
+ if (this._config.trace) {
+ // Long stack trace support
+ sequence._callSite = sequence._callSite || new Error();
+ }
-function getPublicSuffix(domain) {
- return psl.get(domain);
-}
+ this._queue.push(sequence);
+ this.emit('enqueue', sequence);
-exports.getPublicSuffix = getPublicSuffix;
+ var self = this;
+ sequence
+ .on('error', function(err) {
+ self._delegateError(err, sequence);
+ })
+ .on('packet', function(packet) {
+ sequence._timer.active();
+ self._emitPacket(packet);
+ })
+ .on('timeout', function() {
+ var err = new Error(sequence.constructor.name + ' inactivity timeout');
+ err.code = 'PROTOCOL_SEQUENCE_TIMEOUT';
+ err.fatal = true;
+ err.timeout = sequence._timeout;
-/***/ }),
+ self._delegateError(err, sequence);
+ });
-/***/ 11013:
-/***/ ((__unused_webpack_module, exports) => {
+ if (sequence.constructor === Sequences.Handshake) {
+ sequence.on('start-tls', function () {
+ sequence._timer.active();
+ self._connection._startTLS(function(err) {
+ if (err) {
+ // SSL negotiation error are fatal
+ err.code = 'HANDSHAKE_SSL_ERROR';
+ err.fatal = true;
+ sequence.end(err);
+ return;
+ }
-"use strict";
-/*!
- * Copyright (c) 2015, Salesforce.com, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * 3. Neither the name of Salesforce.com nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+ sequence._timer.active();
+ sequence._tlsUpgradeCompleteHandler();
+ });
+ });
-/*jshint unused:false */
+ sequence.on('end', function () {
+ self._handshaked = true;
-function Store() {
-}
-exports.y = Store;
+ if (!self._fatalError) {
+ self.emit('handshake', self._handshakeInitializationPacket);
+ }
+ });
+ }
-// Stores may be synchronous, but are still required to use a
-// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
-// API that converts from synchronous-callbacks to imperative style.
-Store.prototype.synchronous = false;
+ sequence.on('end', function () {
+ self._dequeue(sequence);
+ });
-Store.prototype.findCookie = function(domain, path, key, cb) {
- throw new Error('findCookie is not implemented');
-};
+ if (this._queue.length === 1) {
+ this._parser.resetPacketNumber();
+ this._startSequence(sequence);
+ }
-Store.prototype.findCookies = function(domain, path, cb) {
- throw new Error('findCookies is not implemented');
+ return sequence;
};
-Store.prototype.putCookie = function(cookie, cb) {
- throw new Error('putCookie is not implemented');
-};
+Protocol.prototype._validateEnqueue = function _validateEnqueue(sequence) {
+ var err;
+ var prefix = 'Cannot enqueue ' + sequence.constructor.name;
-Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
- // recommended default implementation:
- // return this.putCookie(newCookie, cb);
- throw new Error('updateCookie is not implemented');
-};
+ if (this._fatalError) {
+ err = new Error(prefix + ' after fatal error.');
+ err.code = 'PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR';
+ } else if (this._quitSequence) {
+ err = new Error(prefix + ' after invoking quit.');
+ err.code = 'PROTOCOL_ENQUEUE_AFTER_QUIT';
+ } else if (this._destroyed) {
+ err = new Error(prefix + ' after being destroyed.');
+ err.code = 'PROTOCOL_ENQUEUE_AFTER_DESTROY';
+ } else if ((this._handshake || this._handshaked) && sequence.constructor === Sequences.Handshake) {
+ err = new Error(prefix + ' after already enqueuing a Handshake.');
+ err.code = 'PROTOCOL_ENQUEUE_HANDSHAKE_TWICE';
+ } else {
+ return true;
+ }
-Store.prototype.removeCookie = function(domain, path, key, cb) {
- throw new Error('removeCookie is not implemented');
-};
+ var self = this;
+ err.fatal = false;
-Store.prototype.removeCookies = function(domain, path, cb) {
- throw new Error('removeCookies is not implemented');
-};
+ // add error handler
+ sequence.on('error', function (err) {
+ self._delegateError(err, sequence);
+ });
-Store.prototype.removeAllCookies = function(cb) {
- throw new Error('removeAllCookies is not implemented');
-}
+ process.nextTick(function () {
+ sequence.end(err);
+ });
-Store.prototype.getAllCookies = function(cb) {
- throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');
+ return false;
};
+Protocol.prototype._parsePacket = function() {
+ var sequence = this._queue[0];
-/***/ }),
+ if (!sequence) {
+ var err = new Error('Received packet with no active sequence.');
+ err.code = 'PROTOCOL_STRAY_PACKET';
+ err.fatal = true;
-/***/ 30380:
-/***/ ((module) => {
+ this._delegateError(err);
+ return;
+ }
-// generated by genversion
-module.exports = '2.5.0'
+ var Packet = this._determinePacket(sequence);
+ var packet = new Packet({protocol41: this._config.protocol41});
+ var packetName = Packet.name;
+ // Special case: Faster dispatch, and parsing done inside sequence
+ if (Packet === Packets.RowDataPacket) {
+ sequence.RowDataPacket(packet, this._parser, this._connection);
-/***/ }),
+ if (this._config.debug) {
+ this._debugPacket(true, packet);
+ }
-/***/ 67087:
-/***/ ((module) => {
+ return;
+ }
-/**
- * Convert array of 16 byte values to UUID string format of the form:
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- */
-var byteToHex = [];
-for (var i = 0; i < 256; ++i) {
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
-}
+ if (this._config.debug) {
+ this._parsePacketDebug(packet);
+ } else {
+ packet.parse(this._parser);
+ }
-function bytesToUuid(buf, offset) {
- var i = offset || 0;
- var bth = byteToHex;
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
- return ([
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]]
- ]).join('');
-}
+ if (Packet === Packets.HandshakeInitializationPacket) {
+ this._handshakeInitializationPacket = packet;
+ this.emit('initialize', packet);
+ }
-module.exports = bytesToUuid;
+ sequence._timer.active();
+ if (!sequence[packetName]) {
+ var err = new Error('Received packet in the wrong sequence.');
+ err.code = 'PROTOCOL_INCORRECT_PACKET_SEQUENCE';
+ err.fatal = true;
-/***/ }),
+ this._delegateError(err);
+ return;
+ }
-/***/ 9117:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ sequence[packetName](packet);
+};
-// Unique ID creation requires a high quality random # generator. In node.js
-// this is pretty straight-forward - we use the crypto API.
+Protocol.prototype._parsePacketDebug = function _parsePacketDebug(packet) {
+ try {
+ packet.parse(this._parser);
+ } finally {
+ this._debugPacket(true, packet);
+ }
+};
-var crypto = __nccwpck_require__(76417);
+Protocol.prototype._emitPacket = function(packet) {
+ var packetWriter = new PacketWriter();
+ packet.write(packetWriter);
+ this.emit('data', packetWriter.toBuffer(this._parser));
-module.exports = function nodeRNG() {
- return crypto.randomBytes(16);
+ if (this._config.debug) {
+ this._debugPacket(false, packet);
+ }
};
+Protocol.prototype._determinePacket = function(sequence) {
+ var firstByte = this._parser.peak();
-/***/ }),
+ if (sequence.determinePacket) {
+ var Packet = sequence.determinePacket(firstByte, this._parser);
+ if (Packet) {
+ return Packet;
+ }
+ }
-/***/ 71435:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ switch (firstByte) {
+ case 0x00: return Packets.OkPacket;
+ case 0xfe: return Packets.EofPacket;
+ case 0xff: return Packets.ErrorPacket;
+ }
-var rng = __nccwpck_require__(9117);
-var bytesToUuid = __nccwpck_require__(67087);
+ throw new Error('Could not determine packet, firstByte = ' + firstByte);
+};
-function v4(options, buf, offset) {
- var i = buf && offset || 0;
+Protocol.prototype._dequeue = function(sequence) {
+ sequence._timer.stop();
- if (typeof(options) == 'string') {
- buf = options === 'binary' ? new Array(16) : null;
- options = null;
+ // No point in advancing the queue, we are dead
+ if (this._fatalError) {
+ return;
}
- options = options || {};
- var rnds = options.random || (options.rng || rng)();
-
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
+ this._queue.shift();
- // Copy bytes to buffer, if provided
- if (buf) {
- for (var ii = 0; ii < 16; ++ii) {
- buf[i + ii] = rnds[ii];
- }
+ var sequence = this._queue[0];
+ if (!sequence) {
+ this.emit('drain');
+ return;
}
- return buf || bytesToUuid(rnds);
-}
+ this._parser.resetPacketNumber();
-module.exports = v4;
+ this._startSequence(sequence);
+};
+Protocol.prototype._startSequence = function(sequence) {
+ if (sequence._timeout > 0 && isFinite(sequence._timeout)) {
+ sequence._timer.start(sequence._timeout);
+ }
-/***/ }),
+ if (sequence.constructor === Sequences.ChangeUser) {
+ sequence.start(this._handshakeInitializationPacket);
+ } else {
+ sequence.start();
+ }
+};
-/***/ 70304:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+Protocol.prototype.handleNetworkError = function(err) {
+ err.fatal = true;
-"use strict";
+ var sequence = this._queue[0];
+ if (sequence) {
+ sequence.end(err);
+ } else {
+ this._delegateError(err);
+ }
+};
+Protocol.prototype.handleParserError = function handleParserError(err) {
+ var sequence = this._queue[0];
+ if (sequence) {
+ sequence.end(err);
+ } else {
+ this._delegateError(err);
+ }
+};
-var http = __nccwpck_require__(98605)
-var https = __nccwpck_require__(57211)
-var url = __nccwpck_require__(78835)
-var util = __nccwpck_require__(31669)
-var stream = __nccwpck_require__(92413)
-var zlib = __nccwpck_require__(78761)
-var aws2 = __nccwpck_require__(96342)
-var aws4 = __nccwpck_require__(16071)
-var httpSignature = __nccwpck_require__(42479)
-var mime = __nccwpck_require__(43583)
-var caseless = __nccwpck_require__(35684)
-var ForeverAgent = __nccwpck_require__(47568)
-var FormData = __nccwpck_require__(64334)
-var extend = __nccwpck_require__(38171)
-var isstream = __nccwpck_require__(83362)
-var isTypedArray = __nccwpck_require__(10657).strict
-var helpers = __nccwpck_require__(74845)
-var cookies = __nccwpck_require__(50976)
-var getProxyFromURI = __nccwpck_require__(75654)
-var Querystring = __nccwpck_require__(66476)/* .Querystring */ .h
-var Har = __nccwpck_require__(3248)/* .Har */ .t
-var Auth = __nccwpck_require__(76996)/* .Auth */ .g
-var OAuth = __nccwpck_require__(41174)/* .OAuth */ .f
-var hawk = __nccwpck_require__(34473)
-var Multipart = __nccwpck_require__(87810)/* .Multipart */ .$
-var Redirect = __nccwpck_require__(3048)/* .Redirect */ .l
-var Tunnel = __nccwpck_require__(17619)/* .Tunnel */ .n
-var now = __nccwpck_require__(85644)
-var Buffer = __nccwpck_require__(21867).Buffer
+Protocol.prototype._delegateError = function(err, sequence) {
+ // Stop delegating errors after the first fatal error
+ if (this._fatalError) {
+ return;
+ }
-var safeStringify = helpers.safeStringify
-var isReadStream = helpers.isReadStream
-var toBase64 = helpers.toBase64
-var defer = helpers.defer
-var copy = helpers.copy
-var version = helpers.version
-var globalCookieJar = cookies.jar()
+ if (err.fatal) {
+ this._fatalError = err;
+ }
-var globalPool = {}
+ if (this._shouldErrorBubbleUp(err, sequence)) {
+ // Can't use regular 'error' event here as that always destroys the pipe
+ // between socket and protocol which is not what we want (unless the
+ // exception was fatal).
+ this.emit('unhandledError', err);
+ } else if (err.fatal) {
+ // Send fatal error to all sequences in the queue
+ var queue = this._queue;
+ process.nextTick(function () {
+ queue.forEach(function (sequence) {
+ sequence.end(err);
+ });
+ queue.length = 0;
+ });
+ }
-function filterForNonReserved (reserved, options) {
- // Filter out properties that are not reserved.
- // Reserved values are passed in at call site.
+ // Make sure the stream we are piping to is getting closed
+ if (err.fatal) {
+ this.emit('end', err);
+ }
+};
- var object = {}
- for (var i in options) {
- var notReserved = (reserved.indexOf(i) === -1)
- if (notReserved) {
- object[i] = options[i]
+Protocol.prototype._shouldErrorBubbleUp = function(err, sequence) {
+ if (sequence) {
+ if (sequence.hasErrorHandler()) {
+ return false;
+ } else if (!err.fatal) {
+ return true;
}
}
- return object
-}
-function filterOutReservedFunctions (reserved, options) {
- // Filter out properties that are functions and are reserved.
- // Reserved values are passed in at call site.
+ return (err.fatal && !this._hasPendingErrorHandlers());
+};
- var object = {}
- for (var i in options) {
- var isReserved = !(reserved.indexOf(i) === -1)
- var isFunction = (typeof options[i] === 'function')
- if (!(isReserved && isFunction)) {
- object[i] = options[i]
+Protocol.prototype._hasPendingErrorHandlers = function() {
+ return this._queue.some(function(sequence) {
+ return sequence.hasErrorHandler();
+ });
+};
+
+Protocol.prototype.destroy = function() {
+ this._destroyed = true;
+ this._parser.pause();
+
+ if (this._connection.state !== 'disconnected') {
+ if (!this._ended) {
+ this.end();
}
}
- return object
-}
+};
-// Return a simpler request object to allow serialization
-function requestToJSON () {
- var self = this
- return {
- uri: self.uri,
- method: self.method,
- headers: self.headers
- }
-}
+Protocol.prototype._debugPacket = function(incoming, packet) {
+ var connection = this._connection;
+ var direction = incoming
+ ? '<--'
+ : '-->';
+ var packetName = packet.constructor.name;
+ var threadId = connection && connection.threadId !== null
+ ? ' (' + connection.threadId + ')'
+ : '';
-// Return a simpler response object to allow serialization
-function responseToJSON () {
- var self = this
- return {
- statusCode: self.statusCode,
- body: self.body,
- headers: self.headers,
- request: requestToJSON.call(self.request)
+ // check for debug packet restriction
+ if (Array.isArray(this._config.debug) && this._config.debug.indexOf(packetName) === -1) {
+ return;
}
-}
-
-function Request (options) {
- // if given the method property in options, set property explicitMethod to true
- // extend the Request instance with any non-reserved properties
- // remove any reserved functions from the options object
- // set Request instance to be readable and writable
- // call init
+ var packetPayload = Util.inspect(packet).replace(/^[^{]+/, '');
- var self = this
+ console.log('%s%s %s %s\n', direction, threadId, packetName, packetPayload);
+};
- // start with HAR, then override with additional options
- if (options.har) {
- self._har = new Har(self)
- options = self._har.options(options)
- }
- stream.Stream.call(self)
- var reserved = Object.keys(Request.prototype)
- var nonReserved = filterForNonReserved(reserved, options)
+/***/ }),
- extend(self, nonReserved)
- options = filterOutReservedFunctions(reserved, options)
+/***/ 18774:
+/***/ ((module) => {
- self.readable = true
- self.writable = true
- if (options.method) {
- self.explicitMethod = true
- }
- self._qs = new Querystring(self)
- self._auth = new Auth(self)
- self._oauth = new OAuth(self)
- self._multipart = new Multipart(self)
- self._redirect = new Redirect(self)
- self._tunnel = new Tunnel(self)
- self.init(options)
+module.exports = ResultSet;
+function ResultSet(resultSetHeaderPacket) {
+ this.resultSetHeaderPacket = resultSetHeaderPacket;
+ this.fieldPackets = [];
+ this.eofPackets = [];
+ this.rows = [];
}
-util.inherits(Request, stream.Stream)
-// Debugging
-Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG)
-function debug () {
- if (Request.debug) {
- console.error('REQUEST %s', util.format.apply(util, arguments))
- }
-}
-Request.prototype.debug = debug
+/***/ }),
-Request.prototype.init = function (options) {
- // init() contains all the code to setup the request object.
- // the actual outgoing request is not started until start() is called
- // this function is called from both the constructor and on redirect.
- var self = this
- if (!options) {
- options = {}
- }
- self.headers = self.headers ? copy(self.headers) : {}
+/***/ 27522:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- // Delete headers with value undefined since they break
- // ClientRequest.OutgoingMessage.setHeader in node 0.12
- for (var headerName in self.headers) {
- if (typeof self.headers[headerName] === 'undefined') {
- delete self.headers[headerName]
- }
- }
+module.exports = __nccwpck_require__(84386);
- caseless.httpify(self, self.headers)
- if (!self.method) {
- self.method = options.method || 'GET'
- }
- if (!self.localAddress) {
- self.localAddress = options.localAddress
- }
+/***/ }),
- self._qs.init(options)
+/***/ 42443:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- debug(options)
- if (!self.pool && self.pool !== false) {
- self.pool = globalPool
- }
- self.dests = self.dests || []
- self.__isRequestRequest = true
+var Timers = __nccwpck_require__(78213);
- // Protect against double callback
- if (!self._callback && self.callback) {
- self._callback = self.callback
- self.callback = function () {
- if (self._callbackCalled) {
- return // Print a warning maybe?
- }
- self._callbackCalled = true
- self._callback.apply(self, arguments)
+module.exports = Timer;
+function Timer(object) {
+ this._object = object;
+ this._timeout = null;
+}
+
+Timer.prototype.active = function active() {
+ if (this._timeout) {
+ if (this._timeout.refresh) {
+ this._timeout.refresh();
+ } else {
+ Timers.active(this._timeout);
}
- self.on('error', self.callback.bind())
- self.on('complete', self.callback.bind(self, null))
}
+};
- // People use this property instead all the time, so support it
- if (!self.uri && self.url) {
- self.uri = self.url
- delete self.url
+Timer.prototype.start = function start(msecs) {
+ this.stop();
+ this._timeout = Timers.setTimeout(this._onTimeout.bind(this), msecs);
+};
+
+Timer.prototype.stop = function stop() {
+ if (this._timeout) {
+ Timers.clearTimeout(this._timeout);
+ this._timeout = null;
}
+};
- // If there's a baseUrl, then use it as the base URL (i.e. uri must be
- // specified as a relative path and is appended to baseUrl).
- if (self.baseUrl) {
- if (typeof self.baseUrl !== 'string') {
- return self.emit('error', new Error('options.baseUrl must be a string'))
- }
+Timer.prototype._onTimeout = function _onTimeout() {
+ return this._object._onTimeout();
+};
- if (typeof self.uri !== 'string') {
- return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))
- }
- if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {
- return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))
- }
+/***/ }),
- // Handle all cases to make sure that there's only one slash between
- // baseUrl and uri.
- var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1
- var uriStartsWithSlash = self.uri.indexOf('/') === 0
+/***/ 30124:
+/***/ ((__unused_webpack_module, exports) => {
- if (baseUrlEndsWithSlash && uriStartsWithSlash) {
- self.uri = self.baseUrl + self.uri.slice(1)
- } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {
- self.uri = self.baseUrl + self.uri
- } else if (self.uri === '') {
- self.uri = self.baseUrl
- } else {
- self.uri = self.baseUrl + '/' + self.uri
- }
- delete self.baseUrl
- }
+exports.BIG5_CHINESE_CI = 1;
+exports.LATIN2_CZECH_CS = 2;
+exports.DEC8_SWEDISH_CI = 3;
+exports.CP850_GENERAL_CI = 4;
+exports.LATIN1_GERMAN1_CI = 5;
+exports.HP8_ENGLISH_CI = 6;
+exports.KOI8R_GENERAL_CI = 7;
+exports.LATIN1_SWEDISH_CI = 8;
+exports.LATIN2_GENERAL_CI = 9;
+exports.SWE7_SWEDISH_CI = 10;
+exports.ASCII_GENERAL_CI = 11;
+exports.UJIS_JAPANESE_CI = 12;
+exports.SJIS_JAPANESE_CI = 13;
+exports.CP1251_BULGARIAN_CI = 14;
+exports.LATIN1_DANISH_CI = 15;
+exports.HEBREW_GENERAL_CI = 16;
+exports.TIS620_THAI_CI = 18;
+exports.EUCKR_KOREAN_CI = 19;
+exports.LATIN7_ESTONIAN_CS = 20;
+exports.LATIN2_HUNGARIAN_CI = 21;
+exports.KOI8U_GENERAL_CI = 22;
+exports.CP1251_UKRAINIAN_CI = 23;
+exports.GB2312_CHINESE_CI = 24;
+exports.GREEK_GENERAL_CI = 25;
+exports.CP1250_GENERAL_CI = 26;
+exports.LATIN2_CROATIAN_CI = 27;
+exports.GBK_CHINESE_CI = 28;
+exports.CP1257_LITHUANIAN_CI = 29;
+exports.LATIN5_TURKISH_CI = 30;
+exports.LATIN1_GERMAN2_CI = 31;
+exports.ARMSCII8_GENERAL_CI = 32;
+exports.UTF8_GENERAL_CI = 33;
+exports.CP1250_CZECH_CS = 34;
+exports.UCS2_GENERAL_CI = 35;
+exports.CP866_GENERAL_CI = 36;
+exports.KEYBCS2_GENERAL_CI = 37;
+exports.MACCE_GENERAL_CI = 38;
+exports.MACROMAN_GENERAL_CI = 39;
+exports.CP852_GENERAL_CI = 40;
+exports.LATIN7_GENERAL_CI = 41;
+exports.LATIN7_GENERAL_CS = 42;
+exports.MACCE_BIN = 43;
+exports.CP1250_CROATIAN_CI = 44;
+exports.UTF8MB4_GENERAL_CI = 45;
+exports.UTF8MB4_BIN = 46;
+exports.LATIN1_BIN = 47;
+exports.LATIN1_GENERAL_CI = 48;
+exports.LATIN1_GENERAL_CS = 49;
+exports.CP1251_BIN = 50;
+exports.CP1251_GENERAL_CI = 51;
+exports.CP1251_GENERAL_CS = 52;
+exports.MACROMAN_BIN = 53;
+exports.UTF16_GENERAL_CI = 54;
+exports.UTF16_BIN = 55;
+exports.UTF16LE_GENERAL_CI = 56;
+exports.CP1256_GENERAL_CI = 57;
+exports.CP1257_BIN = 58;
+exports.CP1257_GENERAL_CI = 59;
+exports.UTF32_GENERAL_CI = 60;
+exports.UTF32_BIN = 61;
+exports.UTF16LE_BIN = 62;
+exports.BINARY = 63;
+exports.ARMSCII8_BIN = 64;
+exports.ASCII_BIN = 65;
+exports.CP1250_BIN = 66;
+exports.CP1256_BIN = 67;
+exports.CP866_BIN = 68;
+exports.DEC8_BIN = 69;
+exports.GREEK_BIN = 70;
+exports.HEBREW_BIN = 71;
+exports.HP8_BIN = 72;
+exports.KEYBCS2_BIN = 73;
+exports.KOI8R_BIN = 74;
+exports.KOI8U_BIN = 75;
+exports.LATIN2_BIN = 77;
+exports.LATIN5_BIN = 78;
+exports.LATIN7_BIN = 79;
+exports.CP850_BIN = 80;
+exports.CP852_BIN = 81;
+exports.SWE7_BIN = 82;
+exports.UTF8_BIN = 83;
+exports.BIG5_BIN = 84;
+exports.EUCKR_BIN = 85;
+exports.GB2312_BIN = 86;
+exports.GBK_BIN = 87;
+exports.SJIS_BIN = 88;
+exports.TIS620_BIN = 89;
+exports.UCS2_BIN = 90;
+exports.UJIS_BIN = 91;
+exports.GEOSTD8_GENERAL_CI = 92;
+exports.GEOSTD8_BIN = 93;
+exports.LATIN1_SPANISH_CI = 94;
+exports.CP932_JAPANESE_CI = 95;
+exports.CP932_BIN = 96;
+exports.EUCJPMS_JAPANESE_CI = 97;
+exports.EUCJPMS_BIN = 98;
+exports.CP1250_POLISH_CI = 99;
+exports.UTF16_UNICODE_CI = 101;
+exports.UTF16_ICELANDIC_CI = 102;
+exports.UTF16_LATVIAN_CI = 103;
+exports.UTF16_ROMANIAN_CI = 104;
+exports.UTF16_SLOVENIAN_CI = 105;
+exports.UTF16_POLISH_CI = 106;
+exports.UTF16_ESTONIAN_CI = 107;
+exports.UTF16_SPANISH_CI = 108;
+exports.UTF16_SWEDISH_CI = 109;
+exports.UTF16_TURKISH_CI = 110;
+exports.UTF16_CZECH_CI = 111;
+exports.UTF16_DANISH_CI = 112;
+exports.UTF16_LITHUANIAN_CI = 113;
+exports.UTF16_SLOVAK_CI = 114;
+exports.UTF16_SPANISH2_CI = 115;
+exports.UTF16_ROMAN_CI = 116;
+exports.UTF16_PERSIAN_CI = 117;
+exports.UTF16_ESPERANTO_CI = 118;
+exports.UTF16_HUNGARIAN_CI = 119;
+exports.UTF16_SINHALA_CI = 120;
+exports.UTF16_GERMAN2_CI = 121;
+exports.UTF16_CROATIAN_MYSQL561_CI = 122;
+exports.UTF16_UNICODE_520_CI = 123;
+exports.UTF16_VIETNAMESE_CI = 124;
+exports.UCS2_UNICODE_CI = 128;
+exports.UCS2_ICELANDIC_CI = 129;
+exports.UCS2_LATVIAN_CI = 130;
+exports.UCS2_ROMANIAN_CI = 131;
+exports.UCS2_SLOVENIAN_CI = 132;
+exports.UCS2_POLISH_CI = 133;
+exports.UCS2_ESTONIAN_CI = 134;
+exports.UCS2_SPANISH_CI = 135;
+exports.UCS2_SWEDISH_CI = 136;
+exports.UCS2_TURKISH_CI = 137;
+exports.UCS2_CZECH_CI = 138;
+exports.UCS2_DANISH_CI = 139;
+exports.UCS2_LITHUANIAN_CI = 140;
+exports.UCS2_SLOVAK_CI = 141;
+exports.UCS2_SPANISH2_CI = 142;
+exports.UCS2_ROMAN_CI = 143;
+exports.UCS2_PERSIAN_CI = 144;
+exports.UCS2_ESPERANTO_CI = 145;
+exports.UCS2_HUNGARIAN_CI = 146;
+exports.UCS2_SINHALA_CI = 147;
+exports.UCS2_GERMAN2_CI = 148;
+exports.UCS2_CROATIAN_MYSQL561_CI = 149;
+exports.UCS2_UNICODE_520_CI = 150;
+exports.UCS2_VIETNAMESE_CI = 151;
+exports.UCS2_GENERAL_MYSQL500_CI = 159;
+exports.UTF32_UNICODE_CI = 160;
+exports.UTF32_ICELANDIC_CI = 161;
+exports.UTF32_LATVIAN_CI = 162;
+exports.UTF32_ROMANIAN_CI = 163;
+exports.UTF32_SLOVENIAN_CI = 164;
+exports.UTF32_POLISH_CI = 165;
+exports.UTF32_ESTONIAN_CI = 166;
+exports.UTF32_SPANISH_CI = 167;
+exports.UTF32_SWEDISH_CI = 168;
+exports.UTF32_TURKISH_CI = 169;
+exports.UTF32_CZECH_CI = 170;
+exports.UTF32_DANISH_CI = 171;
+exports.UTF32_LITHUANIAN_CI = 172;
+exports.UTF32_SLOVAK_CI = 173;
+exports.UTF32_SPANISH2_CI = 174;
+exports.UTF32_ROMAN_CI = 175;
+exports.UTF32_PERSIAN_CI = 176;
+exports.UTF32_ESPERANTO_CI = 177;
+exports.UTF32_HUNGARIAN_CI = 178;
+exports.UTF32_SINHALA_CI = 179;
+exports.UTF32_GERMAN2_CI = 180;
+exports.UTF32_CROATIAN_MYSQL561_CI = 181;
+exports.UTF32_UNICODE_520_CI = 182;
+exports.UTF32_VIETNAMESE_CI = 183;
+exports.UTF8_UNICODE_CI = 192;
+exports.UTF8_ICELANDIC_CI = 193;
+exports.UTF8_LATVIAN_CI = 194;
+exports.UTF8_ROMANIAN_CI = 195;
+exports.UTF8_SLOVENIAN_CI = 196;
+exports.UTF8_POLISH_CI = 197;
+exports.UTF8_ESTONIAN_CI = 198;
+exports.UTF8_SPANISH_CI = 199;
+exports.UTF8_SWEDISH_CI = 200;
+exports.UTF8_TURKISH_CI = 201;
+exports.UTF8_CZECH_CI = 202;
+exports.UTF8_DANISH_CI = 203;
+exports.UTF8_LITHUANIAN_CI = 204;
+exports.UTF8_SLOVAK_CI = 205;
+exports.UTF8_SPANISH2_CI = 206;
+exports.UTF8_ROMAN_CI = 207;
+exports.UTF8_PERSIAN_CI = 208;
+exports.UTF8_ESPERANTO_CI = 209;
+exports.UTF8_HUNGARIAN_CI = 210;
+exports.UTF8_SINHALA_CI = 211;
+exports.UTF8_GERMAN2_CI = 212;
+exports.UTF8_CROATIAN_MYSQL561_CI = 213;
+exports.UTF8_UNICODE_520_CI = 214;
+exports.UTF8_VIETNAMESE_CI = 215;
+exports.UTF8_GENERAL_MYSQL500_CI = 223;
+exports.UTF8MB4_UNICODE_CI = 224;
+exports.UTF8MB4_ICELANDIC_CI = 225;
+exports.UTF8MB4_LATVIAN_CI = 226;
+exports.UTF8MB4_ROMANIAN_CI = 227;
+exports.UTF8MB4_SLOVENIAN_CI = 228;
+exports.UTF8MB4_POLISH_CI = 229;
+exports.UTF8MB4_ESTONIAN_CI = 230;
+exports.UTF8MB4_SPANISH_CI = 231;
+exports.UTF8MB4_SWEDISH_CI = 232;
+exports.UTF8MB4_TURKISH_CI = 233;
+exports.UTF8MB4_CZECH_CI = 234;
+exports.UTF8MB4_DANISH_CI = 235;
+exports.UTF8MB4_LITHUANIAN_CI = 236;
+exports.UTF8MB4_SLOVAK_CI = 237;
+exports.UTF8MB4_SPANISH2_CI = 238;
+exports.UTF8MB4_ROMAN_CI = 239;
+exports.UTF8MB4_PERSIAN_CI = 240;
+exports.UTF8MB4_ESPERANTO_CI = 241;
+exports.UTF8MB4_HUNGARIAN_CI = 242;
+exports.UTF8MB4_SINHALA_CI = 243;
+exports.UTF8MB4_GERMAN2_CI = 244;
+exports.UTF8MB4_CROATIAN_MYSQL561_CI = 245;
+exports.UTF8MB4_UNICODE_520_CI = 246;
+exports.UTF8MB4_VIETNAMESE_CI = 247;
+exports.UTF8_GENERAL50_CI = 253;
- // A URI is needed by this point, emit error if we haven't been able to get one
- if (!self.uri) {
- return self.emit('error', new Error('options.uri is a required argument'))
- }
+// short aliases
+exports.ARMSCII8 = exports.ARMSCII8_GENERAL_CI;
+exports.ASCII = exports.ASCII_GENERAL_CI;
+exports.BIG5 = exports.BIG5_CHINESE_CI;
+exports.BINARY = exports.BINARY;
+exports.CP1250 = exports.CP1250_GENERAL_CI;
+exports.CP1251 = exports.CP1251_GENERAL_CI;
+exports.CP1256 = exports.CP1256_GENERAL_CI;
+exports.CP1257 = exports.CP1257_GENERAL_CI;
+exports.CP866 = exports.CP866_GENERAL_CI;
+exports.CP850 = exports.CP850_GENERAL_CI;
+exports.CP852 = exports.CP852_GENERAL_CI;
+exports.CP932 = exports.CP932_JAPANESE_CI;
+exports.DEC8 = exports.DEC8_SWEDISH_CI;
+exports.EUCJPMS = exports.EUCJPMS_JAPANESE_CI;
+exports.EUCKR = exports.EUCKR_KOREAN_CI;
+exports.GB2312 = exports.GB2312_CHINESE_CI;
+exports.GBK = exports.GBK_CHINESE_CI;
+exports.GEOSTD8 = exports.GEOSTD8_GENERAL_CI;
+exports.GREEK = exports.GREEK_GENERAL_CI;
+exports.HEBREW = exports.HEBREW_GENERAL_CI;
+exports.HP8 = exports.HP8_ENGLISH_CI;
+exports.KEYBCS2 = exports.KEYBCS2_GENERAL_CI;
+exports.KOI8R = exports.KOI8R_GENERAL_CI;
+exports.KOI8U = exports.KOI8U_GENERAL_CI;
+exports.LATIN1 = exports.LATIN1_SWEDISH_CI;
+exports.LATIN2 = exports.LATIN2_GENERAL_CI;
+exports.LATIN5 = exports.LATIN5_TURKISH_CI;
+exports.LATIN7 = exports.LATIN7_GENERAL_CI;
+exports.MACCE = exports.MACCE_GENERAL_CI;
+exports.MACROMAN = exports.MACROMAN_GENERAL_CI;
+exports.SJIS = exports.SJIS_JAPANESE_CI;
+exports.SWE7 = exports.SWE7_SWEDISH_CI;
+exports.TIS620 = exports.TIS620_THAI_CI;
+exports.UCS2 = exports.UCS2_GENERAL_CI;
+exports.UJIS = exports.UJIS_JAPANESE_CI;
+exports.UTF16 = exports.UTF16_GENERAL_CI;
+exports.UTF16LE = exports.UTF16LE_GENERAL_CI;
+exports.UTF8 = exports.UTF8_GENERAL_CI;
+exports.UTF8MB4 = exports.UTF8MB4_GENERAL_CI;
+exports.UTF32 = exports.UTF32_GENERAL_CI;
- // If a string URI/URL was given, parse it into a URL object
- if (typeof self.uri === 'string') {
- self.uri = url.parse(self.uri)
- }
- // Some URL objects are not from a URL parsed string and need href added
- if (!self.uri.href) {
- self.uri.href = url.format(self.uri)
- }
+/***/ }),
- // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme
- if (self.uri.protocol === 'unix:') {
- return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))
- }
+/***/ 5427:
+/***/ ((__unused_webpack_module, exports) => {
- // Support Unix Sockets
- if (self.uri.host === 'unix') {
- self.enableUnixSocket()
- }
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
+exports.CLIENT_LONG_PASSWORD = 1; /* new more secure passwords */
+exports.CLIENT_FOUND_ROWS = 2; /* Found instead of affected rows */
+exports.CLIENT_LONG_FLAG = 4; /* Get all column flags */
+exports.CLIENT_CONNECT_WITH_DB = 8; /* One can specify db on connect */
+exports.CLIENT_NO_SCHEMA = 16; /* Don't allow database.table.column */
+exports.CLIENT_COMPRESS = 32; /* Can use compression protocol */
+exports.CLIENT_ODBC = 64; /* Odbc client */
+exports.CLIENT_LOCAL_FILES = 128; /* Can use LOAD DATA LOCAL */
+exports.CLIENT_IGNORE_SPACE = 256; /* Ignore spaces before '(' */
+exports.CLIENT_PROTOCOL_41 = 512; /* New 4.1 protocol */
+exports.CLIENT_INTERACTIVE = 1024; /* This is an interactive client */
+exports.CLIENT_SSL = 2048; /* Switch to SSL after handshake */
+exports.CLIENT_IGNORE_SIGPIPE = 4096; /* IGNORE sigpipes */
+exports.CLIENT_TRANSACTIONS = 8192; /* Client knows about transactions */
+exports.CLIENT_RESERVED = 16384; /* Old flag for 4.1 protocol */
+exports.CLIENT_SECURE_CONNECTION = 32768; /* New 4.1 authentication */
- if (self.strictSSL === false) {
- self.rejectUnauthorized = false
- }
+exports.CLIENT_MULTI_STATEMENTS = 65536; /* Enable/disable multi-stmt support */
+exports.CLIENT_MULTI_RESULTS = 131072; /* Enable/disable multi-results */
+exports.CLIENT_PS_MULTI_RESULTS = 262144; /* Multi-results in PS-protocol */
- if (!self.uri.pathname) { self.uri.pathname = '/' }
+exports.CLIENT_PLUGIN_AUTH = 524288; /* Client supports plugin authentication */
- if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {
- // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar
- // Detect and reject it as soon as possible
- var faultyUri = url.format(self.uri)
- var message = 'Invalid URI "' + faultyUri + '"'
- if (Object.keys(options).length === 0) {
- // No option ? This can be the sign of a redirect
- // As this is a case where the user cannot do anything (they didn't call request directly with this URL)
- // they should be warned that it can be caused by a redirection (can save some hair)
- message += '. This can be caused by a crappy redirection.'
- }
- // This error was fatal
- self.abort()
- return self.emit('error', new Error(message))
- }
+exports.CLIENT_SSL_VERIFY_SERVER_CERT = 1073741824;
+exports.CLIENT_REMEMBER_OPTIONS = 2147483648;
- if (!self.hasOwnProperty('proxy')) {
- self.proxy = getProxyFromURI(self.uri)
- }
- self.tunnel = self._tunnel.isEnabled()
- if (self.proxy) {
- self._tunnel.setup(options)
- }
+/***/ }),
+
+/***/ 95847:
+/***/ ((__unused_webpack_module, exports) => {
+
+/**
+ * MySQL error constants
+ *
+ * Extracted from version 5.7.29
+ *
+ * !! Generated by generate-error-constants.js, do not modify by hand !!
+ */
+
+exports.EE_CANTCREATEFILE = 1;
+exports.EE_READ = 2;
+exports.EE_WRITE = 3;
+exports.EE_BADCLOSE = 4;
+exports.EE_OUTOFMEMORY = 5;
+exports.EE_DELETE = 6;
+exports.EE_LINK = 7;
+exports.EE_EOFERR = 9;
+exports.EE_CANTLOCK = 10;
+exports.EE_CANTUNLOCK = 11;
+exports.EE_DIR = 12;
+exports.EE_STAT = 13;
+exports.EE_CANT_CHSIZE = 14;
+exports.EE_CANT_OPEN_STREAM = 15;
+exports.EE_GETWD = 16;
+exports.EE_SETWD = 17;
+exports.EE_LINK_WARNING = 18;
+exports.EE_OPEN_WARNING = 19;
+exports.EE_DISK_FULL = 20;
+exports.EE_CANT_MKDIR = 21;
+exports.EE_UNKNOWN_CHARSET = 22;
+exports.EE_OUT_OF_FILERESOURCES = 23;
+exports.EE_CANT_READLINK = 24;
+exports.EE_CANT_SYMLINK = 25;
+exports.EE_REALPATH = 26;
+exports.EE_SYNC = 27;
+exports.EE_UNKNOWN_COLLATION = 28;
+exports.EE_FILENOTFOUND = 29;
+exports.EE_FILE_NOT_CLOSED = 30;
+exports.EE_CHANGE_OWNERSHIP = 31;
+exports.EE_CHANGE_PERMISSIONS = 32;
+exports.EE_CANT_SEEK = 33;
+exports.EE_CAPACITY_EXCEEDED = 34;
+exports.HA_ERR_KEY_NOT_FOUND = 120;
+exports.HA_ERR_FOUND_DUPP_KEY = 121;
+exports.HA_ERR_INTERNAL_ERROR = 122;
+exports.HA_ERR_RECORD_CHANGED = 123;
+exports.HA_ERR_WRONG_INDEX = 124;
+exports.HA_ERR_CRASHED = 126;
+exports.HA_ERR_WRONG_IN_RECORD = 127;
+exports.HA_ERR_OUT_OF_MEM = 128;
+exports.HA_ERR_NOT_A_TABLE = 130;
+exports.HA_ERR_WRONG_COMMAND = 131;
+exports.HA_ERR_OLD_FILE = 132;
+exports.HA_ERR_NO_ACTIVE_RECORD = 133;
+exports.HA_ERR_RECORD_DELETED = 134;
+exports.HA_ERR_RECORD_FILE_FULL = 135;
+exports.HA_ERR_INDEX_FILE_FULL = 136;
+exports.HA_ERR_END_OF_FILE = 137;
+exports.HA_ERR_UNSUPPORTED = 138;
+exports.HA_ERR_TOO_BIG_ROW = 139;
+exports.HA_WRONG_CREATE_OPTION = 140;
+exports.HA_ERR_FOUND_DUPP_UNIQUE = 141;
+exports.HA_ERR_UNKNOWN_CHARSET = 142;
+exports.HA_ERR_WRONG_MRG_TABLE_DEF = 143;
+exports.HA_ERR_CRASHED_ON_REPAIR = 144;
+exports.HA_ERR_CRASHED_ON_USAGE = 145;
+exports.HA_ERR_LOCK_WAIT_TIMEOUT = 146;
+exports.HA_ERR_LOCK_TABLE_FULL = 147;
+exports.HA_ERR_READ_ONLY_TRANSACTION = 148;
+exports.HA_ERR_LOCK_DEADLOCK = 149;
+exports.HA_ERR_CANNOT_ADD_FOREIGN = 150;
+exports.HA_ERR_NO_REFERENCED_ROW = 151;
+exports.HA_ERR_ROW_IS_REFERENCED = 152;
+exports.HA_ERR_NO_SAVEPOINT = 153;
+exports.HA_ERR_NON_UNIQUE_BLOCK_SIZE = 154;
+exports.HA_ERR_NO_SUCH_TABLE = 155;
+exports.HA_ERR_TABLE_EXIST = 156;
+exports.HA_ERR_NO_CONNECTION = 157;
+exports.HA_ERR_NULL_IN_SPATIAL = 158;
+exports.HA_ERR_TABLE_DEF_CHANGED = 159;
+exports.HA_ERR_NO_PARTITION_FOUND = 160;
+exports.HA_ERR_RBR_LOGGING_FAILED = 161;
+exports.HA_ERR_DROP_INDEX_FK = 162;
+exports.HA_ERR_FOREIGN_DUPLICATE_KEY = 163;
+exports.HA_ERR_TABLE_NEEDS_UPGRADE = 164;
+exports.HA_ERR_TABLE_READONLY = 165;
+exports.HA_ERR_AUTOINC_READ_FAILED = 166;
+exports.HA_ERR_AUTOINC_ERANGE = 167;
+exports.HA_ERR_GENERIC = 168;
+exports.HA_ERR_RECORD_IS_THE_SAME = 169;
+exports.HA_ERR_LOGGING_IMPOSSIBLE = 170;
+exports.HA_ERR_CORRUPT_EVENT = 171;
+exports.HA_ERR_NEW_FILE = 172;
+exports.HA_ERR_ROWS_EVENT_APPLY = 173;
+exports.HA_ERR_INITIALIZATION = 174;
+exports.HA_ERR_FILE_TOO_SHORT = 175;
+exports.HA_ERR_WRONG_CRC = 176;
+exports.HA_ERR_TOO_MANY_CONCURRENT_TRXS = 177;
+exports.HA_ERR_NOT_IN_LOCK_PARTITIONS = 178;
+exports.HA_ERR_INDEX_COL_TOO_LONG = 179;
+exports.HA_ERR_INDEX_CORRUPT = 180;
+exports.HA_ERR_UNDO_REC_TOO_BIG = 181;
+exports.HA_FTS_INVALID_DOCID = 182;
+exports.HA_ERR_TABLE_IN_FK_CHECK = 183;
+exports.HA_ERR_TABLESPACE_EXISTS = 184;
+exports.HA_ERR_TOO_MANY_FIELDS = 185;
+exports.HA_ERR_ROW_IN_WRONG_PARTITION = 186;
+exports.HA_ERR_INNODB_READ_ONLY = 187;
+exports.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188;
+exports.HA_ERR_TEMP_FILE_WRITE_FAILURE = 189;
+exports.HA_ERR_INNODB_FORCED_RECOVERY = 190;
+exports.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE = 191;
+exports.HA_ERR_FK_DEPTH_EXCEEDED = 192;
+exports.HA_MISSING_CREATE_OPTION = 193;
+exports.HA_ERR_SE_OUT_OF_MEMORY = 194;
+exports.HA_ERR_TABLE_CORRUPT = 195;
+exports.HA_ERR_QUERY_INTERRUPTED = 196;
+exports.HA_ERR_TABLESPACE_MISSING = 197;
+exports.HA_ERR_TABLESPACE_IS_NOT_EMPTY = 198;
+exports.HA_ERR_WRONG_FILE_NAME = 199;
+exports.HA_ERR_NOT_ALLOWED_COMMAND = 200;
+exports.HA_ERR_COMPUTE_FAILED = 201;
+exports.ER_HASHCHK = 1000;
+exports.ER_NISAMCHK = 1001;
+exports.ER_NO = 1002;
+exports.ER_YES = 1003;
+exports.ER_CANT_CREATE_FILE = 1004;
+exports.ER_CANT_CREATE_TABLE = 1005;
+exports.ER_CANT_CREATE_DB = 1006;
+exports.ER_DB_CREATE_EXISTS = 1007;
+exports.ER_DB_DROP_EXISTS = 1008;
+exports.ER_DB_DROP_DELETE = 1009;
+exports.ER_DB_DROP_RMDIR = 1010;
+exports.ER_CANT_DELETE_FILE = 1011;
+exports.ER_CANT_FIND_SYSTEM_REC = 1012;
+exports.ER_CANT_GET_STAT = 1013;
+exports.ER_CANT_GET_WD = 1014;
+exports.ER_CANT_LOCK = 1015;
+exports.ER_CANT_OPEN_FILE = 1016;
+exports.ER_FILE_NOT_FOUND = 1017;
+exports.ER_CANT_READ_DIR = 1018;
+exports.ER_CANT_SET_WD = 1019;
+exports.ER_CHECKREAD = 1020;
+exports.ER_DISK_FULL = 1021;
+exports.ER_DUP_KEY = 1022;
+exports.ER_ERROR_ON_CLOSE = 1023;
+exports.ER_ERROR_ON_READ = 1024;
+exports.ER_ERROR_ON_RENAME = 1025;
+exports.ER_ERROR_ON_WRITE = 1026;
+exports.ER_FILE_USED = 1027;
+exports.ER_FILSORT_ABORT = 1028;
+exports.ER_FORM_NOT_FOUND = 1029;
+exports.ER_GET_ERRNO = 1030;
+exports.ER_ILLEGAL_HA = 1031;
+exports.ER_KEY_NOT_FOUND = 1032;
+exports.ER_NOT_FORM_FILE = 1033;
+exports.ER_NOT_KEYFILE = 1034;
+exports.ER_OLD_KEYFILE = 1035;
+exports.ER_OPEN_AS_READONLY = 1036;
+exports.ER_OUTOFMEMORY = 1037;
+exports.ER_OUT_OF_SORTMEMORY = 1038;
+exports.ER_UNEXPECTED_EOF = 1039;
+exports.ER_CON_COUNT_ERROR = 1040;
+exports.ER_OUT_OF_RESOURCES = 1041;
+exports.ER_BAD_HOST_ERROR = 1042;
+exports.ER_HANDSHAKE_ERROR = 1043;
+exports.ER_DBACCESS_DENIED_ERROR = 1044;
+exports.ER_ACCESS_DENIED_ERROR = 1045;
+exports.ER_NO_DB_ERROR = 1046;
+exports.ER_UNKNOWN_COM_ERROR = 1047;
+exports.ER_BAD_NULL_ERROR = 1048;
+exports.ER_BAD_DB_ERROR = 1049;
+exports.ER_TABLE_EXISTS_ERROR = 1050;
+exports.ER_BAD_TABLE_ERROR = 1051;
+exports.ER_NON_UNIQ_ERROR = 1052;
+exports.ER_SERVER_SHUTDOWN = 1053;
+exports.ER_BAD_FIELD_ERROR = 1054;
+exports.ER_WRONG_FIELD_WITH_GROUP = 1055;
+exports.ER_WRONG_GROUP_FIELD = 1056;
+exports.ER_WRONG_SUM_SELECT = 1057;
+exports.ER_WRONG_VALUE_COUNT = 1058;
+exports.ER_TOO_LONG_IDENT = 1059;
+exports.ER_DUP_FIELDNAME = 1060;
+exports.ER_DUP_KEYNAME = 1061;
+exports.ER_DUP_ENTRY = 1062;
+exports.ER_WRONG_FIELD_SPEC = 1063;
+exports.ER_PARSE_ERROR = 1064;
+exports.ER_EMPTY_QUERY = 1065;
+exports.ER_NONUNIQ_TABLE = 1066;
+exports.ER_INVALID_DEFAULT = 1067;
+exports.ER_MULTIPLE_PRI_KEY = 1068;
+exports.ER_TOO_MANY_KEYS = 1069;
+exports.ER_TOO_MANY_KEY_PARTS = 1070;
+exports.ER_TOO_LONG_KEY = 1071;
+exports.ER_KEY_COLUMN_DOES_NOT_EXITS = 1072;
+exports.ER_BLOB_USED_AS_KEY = 1073;
+exports.ER_TOO_BIG_FIELDLENGTH = 1074;
+exports.ER_WRONG_AUTO_KEY = 1075;
+exports.ER_READY = 1076;
+exports.ER_NORMAL_SHUTDOWN = 1077;
+exports.ER_GOT_SIGNAL = 1078;
+exports.ER_SHUTDOWN_COMPLETE = 1079;
+exports.ER_FORCING_CLOSE = 1080;
+exports.ER_IPSOCK_ERROR = 1081;
+exports.ER_NO_SUCH_INDEX = 1082;
+exports.ER_WRONG_FIELD_TERMINATORS = 1083;
+exports.ER_BLOBS_AND_NO_TERMINATED = 1084;
+exports.ER_TEXTFILE_NOT_READABLE = 1085;
+exports.ER_FILE_EXISTS_ERROR = 1086;
+exports.ER_LOAD_INFO = 1087;
+exports.ER_ALTER_INFO = 1088;
+exports.ER_WRONG_SUB_KEY = 1089;
+exports.ER_CANT_REMOVE_ALL_FIELDS = 1090;
+exports.ER_CANT_DROP_FIELD_OR_KEY = 1091;
+exports.ER_INSERT_INFO = 1092;
+exports.ER_UPDATE_TABLE_USED = 1093;
+exports.ER_NO_SUCH_THREAD = 1094;
+exports.ER_KILL_DENIED_ERROR = 1095;
+exports.ER_NO_TABLES_USED = 1096;
+exports.ER_TOO_BIG_SET = 1097;
+exports.ER_NO_UNIQUE_LOGFILE = 1098;
+exports.ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099;
+exports.ER_TABLE_NOT_LOCKED = 1100;
+exports.ER_BLOB_CANT_HAVE_DEFAULT = 1101;
+exports.ER_WRONG_DB_NAME = 1102;
+exports.ER_WRONG_TABLE_NAME = 1103;
+exports.ER_TOO_BIG_SELECT = 1104;
+exports.ER_UNKNOWN_ERROR = 1105;
+exports.ER_UNKNOWN_PROCEDURE = 1106;
+exports.ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107;
+exports.ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108;
+exports.ER_UNKNOWN_TABLE = 1109;
+exports.ER_FIELD_SPECIFIED_TWICE = 1110;
+exports.ER_INVALID_GROUP_FUNC_USE = 1111;
+exports.ER_UNSUPPORTED_EXTENSION = 1112;
+exports.ER_TABLE_MUST_HAVE_COLUMNS = 1113;
+exports.ER_RECORD_FILE_FULL = 1114;
+exports.ER_UNKNOWN_CHARACTER_SET = 1115;
+exports.ER_TOO_MANY_TABLES = 1116;
+exports.ER_TOO_MANY_FIELDS = 1117;
+exports.ER_TOO_BIG_ROWSIZE = 1118;
+exports.ER_STACK_OVERRUN = 1119;
+exports.ER_WRONG_OUTER_JOIN = 1120;
+exports.ER_NULL_COLUMN_IN_INDEX = 1121;
+exports.ER_CANT_FIND_UDF = 1122;
+exports.ER_CANT_INITIALIZE_UDF = 1123;
+exports.ER_UDF_NO_PATHS = 1124;
+exports.ER_UDF_EXISTS = 1125;
+exports.ER_CANT_OPEN_LIBRARY = 1126;
+exports.ER_CANT_FIND_DL_ENTRY = 1127;
+exports.ER_FUNCTION_NOT_DEFINED = 1128;
+exports.ER_HOST_IS_BLOCKED = 1129;
+exports.ER_HOST_NOT_PRIVILEGED = 1130;
+exports.ER_PASSWORD_ANONYMOUS_USER = 1131;
+exports.ER_PASSWORD_NOT_ALLOWED = 1132;
+exports.ER_PASSWORD_NO_MATCH = 1133;
+exports.ER_UPDATE_INFO = 1134;
+exports.ER_CANT_CREATE_THREAD = 1135;
+exports.ER_WRONG_VALUE_COUNT_ON_ROW = 1136;
+exports.ER_CANT_REOPEN_TABLE = 1137;
+exports.ER_INVALID_USE_OF_NULL = 1138;
+exports.ER_REGEXP_ERROR = 1139;
+exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140;
+exports.ER_NONEXISTING_GRANT = 1141;
+exports.ER_TABLEACCESS_DENIED_ERROR = 1142;
+exports.ER_COLUMNACCESS_DENIED_ERROR = 1143;
+exports.ER_ILLEGAL_GRANT_FOR_TABLE = 1144;
+exports.ER_GRANT_WRONG_HOST_OR_USER = 1145;
+exports.ER_NO_SUCH_TABLE = 1146;
+exports.ER_NONEXISTING_TABLE_GRANT = 1147;
+exports.ER_NOT_ALLOWED_COMMAND = 1148;
+exports.ER_SYNTAX_ERROR = 1149;
+exports.ER_DELAYED_CANT_CHANGE_LOCK = 1150;
+exports.ER_TOO_MANY_DELAYED_THREADS = 1151;
+exports.ER_ABORTING_CONNECTION = 1152;
+exports.ER_NET_PACKET_TOO_LARGE = 1153;
+exports.ER_NET_READ_ERROR_FROM_PIPE = 1154;
+exports.ER_NET_FCNTL_ERROR = 1155;
+exports.ER_NET_PACKETS_OUT_OF_ORDER = 1156;
+exports.ER_NET_UNCOMPRESS_ERROR = 1157;
+exports.ER_NET_READ_ERROR = 1158;
+exports.ER_NET_READ_INTERRUPTED = 1159;
+exports.ER_NET_ERROR_ON_WRITE = 1160;
+exports.ER_NET_WRITE_INTERRUPTED = 1161;
+exports.ER_TOO_LONG_STRING = 1162;
+exports.ER_TABLE_CANT_HANDLE_BLOB = 1163;
+exports.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164;
+exports.ER_DELAYED_INSERT_TABLE_LOCKED = 1165;
+exports.ER_WRONG_COLUMN_NAME = 1166;
+exports.ER_WRONG_KEY_COLUMN = 1167;
+exports.ER_WRONG_MRG_TABLE = 1168;
+exports.ER_DUP_UNIQUE = 1169;
+exports.ER_BLOB_KEY_WITHOUT_LENGTH = 1170;
+exports.ER_PRIMARY_CANT_HAVE_NULL = 1171;
+exports.ER_TOO_MANY_ROWS = 1172;
+exports.ER_REQUIRES_PRIMARY_KEY = 1173;
+exports.ER_NO_RAID_COMPILED = 1174;
+exports.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175;
+exports.ER_KEY_DOES_NOT_EXITS = 1176;
+exports.ER_CHECK_NO_SUCH_TABLE = 1177;
+exports.ER_CHECK_NOT_IMPLEMENTED = 1178;
+exports.ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179;
+exports.ER_ERROR_DURING_COMMIT = 1180;
+exports.ER_ERROR_DURING_ROLLBACK = 1181;
+exports.ER_ERROR_DURING_FLUSH_LOGS = 1182;
+exports.ER_ERROR_DURING_CHECKPOINT = 1183;
+exports.ER_NEW_ABORTING_CONNECTION = 1184;
+exports.ER_DUMP_NOT_IMPLEMENTED = 1185;
+exports.ER_FLUSH_MASTER_BINLOG_CLOSED = 1186;
+exports.ER_INDEX_REBUILD = 1187;
+exports.ER_MASTER = 1188;
+exports.ER_MASTER_NET_READ = 1189;
+exports.ER_MASTER_NET_WRITE = 1190;
+exports.ER_FT_MATCHING_KEY_NOT_FOUND = 1191;
+exports.ER_LOCK_OR_ACTIVE_TRANSACTION = 1192;
+exports.ER_UNKNOWN_SYSTEM_VARIABLE = 1193;
+exports.ER_CRASHED_ON_USAGE = 1194;
+exports.ER_CRASHED_ON_REPAIR = 1195;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196;
+exports.ER_TRANS_CACHE_FULL = 1197;
+exports.ER_SLAVE_MUST_STOP = 1198;
+exports.ER_SLAVE_NOT_RUNNING = 1199;
+exports.ER_BAD_SLAVE = 1200;
+exports.ER_MASTER_INFO = 1201;
+exports.ER_SLAVE_THREAD = 1202;
+exports.ER_TOO_MANY_USER_CONNECTIONS = 1203;
+exports.ER_SET_CONSTANTS_ONLY = 1204;
+exports.ER_LOCK_WAIT_TIMEOUT = 1205;
+exports.ER_LOCK_TABLE_FULL = 1206;
+exports.ER_READ_ONLY_TRANSACTION = 1207;
+exports.ER_DROP_DB_WITH_READ_LOCK = 1208;
+exports.ER_CREATE_DB_WITH_READ_LOCK = 1209;
+exports.ER_WRONG_ARGUMENTS = 1210;
+exports.ER_NO_PERMISSION_TO_CREATE_USER = 1211;
+exports.ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212;
+exports.ER_LOCK_DEADLOCK = 1213;
+exports.ER_TABLE_CANT_HANDLE_FT = 1214;
+exports.ER_CANNOT_ADD_FOREIGN = 1215;
+exports.ER_NO_REFERENCED_ROW = 1216;
+exports.ER_ROW_IS_REFERENCED = 1217;
+exports.ER_CONNECT_TO_MASTER = 1218;
+exports.ER_QUERY_ON_MASTER = 1219;
+exports.ER_ERROR_WHEN_EXECUTING_COMMAND = 1220;
+exports.ER_WRONG_USAGE = 1221;
+exports.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222;
+exports.ER_CANT_UPDATE_WITH_READLOCK = 1223;
+exports.ER_MIXING_NOT_ALLOWED = 1224;
+exports.ER_DUP_ARGUMENT = 1225;
+exports.ER_USER_LIMIT_REACHED = 1226;
+exports.ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227;
+exports.ER_LOCAL_VARIABLE = 1228;
+exports.ER_GLOBAL_VARIABLE = 1229;
+exports.ER_NO_DEFAULT = 1230;
+exports.ER_WRONG_VALUE_FOR_VAR = 1231;
+exports.ER_WRONG_TYPE_FOR_VAR = 1232;
+exports.ER_VAR_CANT_BE_READ = 1233;
+exports.ER_CANT_USE_OPTION_HERE = 1234;
+exports.ER_NOT_SUPPORTED_YET = 1235;
+exports.ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236;
+exports.ER_SLAVE_IGNORED_TABLE = 1237;
+exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238;
+exports.ER_WRONG_FK_DEF = 1239;
+exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240;
+exports.ER_OPERAND_COLUMNS = 1241;
+exports.ER_SUBQUERY_NO_1_ROW = 1242;
+exports.ER_UNKNOWN_STMT_HANDLER = 1243;
+exports.ER_CORRUPT_HELP_DB = 1244;
+exports.ER_CYCLIC_REFERENCE = 1245;
+exports.ER_AUTO_CONVERT = 1246;
+exports.ER_ILLEGAL_REFERENCE = 1247;
+exports.ER_DERIVED_MUST_HAVE_ALIAS = 1248;
+exports.ER_SELECT_REDUCED = 1249;
+exports.ER_TABLENAME_NOT_ALLOWED_HERE = 1250;
+exports.ER_NOT_SUPPORTED_AUTH_MODE = 1251;
+exports.ER_SPATIAL_CANT_HAVE_NULL = 1252;
+exports.ER_COLLATION_CHARSET_MISMATCH = 1253;
+exports.ER_SLAVE_WAS_RUNNING = 1254;
+exports.ER_SLAVE_WAS_NOT_RUNNING = 1255;
+exports.ER_TOO_BIG_FOR_UNCOMPRESS = 1256;
+exports.ER_ZLIB_Z_MEM_ERROR = 1257;
+exports.ER_ZLIB_Z_BUF_ERROR = 1258;
+exports.ER_ZLIB_Z_DATA_ERROR = 1259;
+exports.ER_CUT_VALUE_GROUP_CONCAT = 1260;
+exports.ER_WARN_TOO_FEW_RECORDS = 1261;
+exports.ER_WARN_TOO_MANY_RECORDS = 1262;
+exports.ER_WARN_NULL_TO_NOTNULL = 1263;
+exports.ER_WARN_DATA_OUT_OF_RANGE = 1264;
+exports.WARN_DATA_TRUNCATED = 1265;
+exports.ER_WARN_USING_OTHER_HANDLER = 1266;
+exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267;
+exports.ER_DROP_USER = 1268;
+exports.ER_REVOKE_GRANTS = 1269;
+exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270;
+exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271;
+exports.ER_VARIABLE_IS_NOT_STRUCT = 1272;
+exports.ER_UNKNOWN_COLLATION = 1273;
+exports.ER_SLAVE_IGNORED_SSL_PARAMS = 1274;
+exports.ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275;
+exports.ER_WARN_FIELD_RESOLVED = 1276;
+exports.ER_BAD_SLAVE_UNTIL_COND = 1277;
+exports.ER_MISSING_SKIP_SLAVE = 1278;
+exports.ER_UNTIL_COND_IGNORED = 1279;
+exports.ER_WRONG_NAME_FOR_INDEX = 1280;
+exports.ER_WRONG_NAME_FOR_CATALOG = 1281;
+exports.ER_WARN_QC_RESIZE = 1282;
+exports.ER_BAD_FT_COLUMN = 1283;
+exports.ER_UNKNOWN_KEY_CACHE = 1284;
+exports.ER_WARN_HOSTNAME_WONT_WORK = 1285;
+exports.ER_UNKNOWN_STORAGE_ENGINE = 1286;
+exports.ER_WARN_DEPRECATED_SYNTAX = 1287;
+exports.ER_NON_UPDATABLE_TABLE = 1288;
+exports.ER_FEATURE_DISABLED = 1289;
+exports.ER_OPTION_PREVENTS_STATEMENT = 1290;
+exports.ER_DUPLICATED_VALUE_IN_TYPE = 1291;
+exports.ER_TRUNCATED_WRONG_VALUE = 1292;
+exports.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293;
+exports.ER_INVALID_ON_UPDATE = 1294;
+exports.ER_UNSUPPORTED_PS = 1295;
+exports.ER_GET_ERRMSG = 1296;
+exports.ER_GET_TEMPORARY_ERRMSG = 1297;
+exports.ER_UNKNOWN_TIME_ZONE = 1298;
+exports.ER_WARN_INVALID_TIMESTAMP = 1299;
+exports.ER_INVALID_CHARACTER_STRING = 1300;
+exports.ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301;
+exports.ER_CONFLICTING_DECLARATIONS = 1302;
+exports.ER_SP_NO_RECURSIVE_CREATE = 1303;
+exports.ER_SP_ALREADY_EXISTS = 1304;
+exports.ER_SP_DOES_NOT_EXIST = 1305;
+exports.ER_SP_DROP_FAILED = 1306;
+exports.ER_SP_STORE_FAILED = 1307;
+exports.ER_SP_LILABEL_MISMATCH = 1308;
+exports.ER_SP_LABEL_REDEFINE = 1309;
+exports.ER_SP_LABEL_MISMATCH = 1310;
+exports.ER_SP_UNINIT_VAR = 1311;
+exports.ER_SP_BADSELECT = 1312;
+exports.ER_SP_BADRETURN = 1313;
+exports.ER_SP_BADSTATEMENT = 1314;
+exports.ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315;
+exports.ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316;
+exports.ER_QUERY_INTERRUPTED = 1317;
+exports.ER_SP_WRONG_NO_OF_ARGS = 1318;
+exports.ER_SP_COND_MISMATCH = 1319;
+exports.ER_SP_NORETURN = 1320;
+exports.ER_SP_NORETURNEND = 1321;
+exports.ER_SP_BAD_CURSOR_QUERY = 1322;
+exports.ER_SP_BAD_CURSOR_SELECT = 1323;
+exports.ER_SP_CURSOR_MISMATCH = 1324;
+exports.ER_SP_CURSOR_ALREADY_OPEN = 1325;
+exports.ER_SP_CURSOR_NOT_OPEN = 1326;
+exports.ER_SP_UNDECLARED_VAR = 1327;
+exports.ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328;
+exports.ER_SP_FETCH_NO_DATA = 1329;
+exports.ER_SP_DUP_PARAM = 1330;
+exports.ER_SP_DUP_VAR = 1331;
+exports.ER_SP_DUP_COND = 1332;
+exports.ER_SP_DUP_CURS = 1333;
+exports.ER_SP_CANT_ALTER = 1334;
+exports.ER_SP_SUBSELECT_NYI = 1335;
+exports.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336;
+exports.ER_SP_VARCOND_AFTER_CURSHNDLR = 1337;
+exports.ER_SP_CURSOR_AFTER_HANDLER = 1338;
+exports.ER_SP_CASE_NOT_FOUND = 1339;
+exports.ER_FPARSER_TOO_BIG_FILE = 1340;
+exports.ER_FPARSER_BAD_HEADER = 1341;
+exports.ER_FPARSER_EOF_IN_COMMENT = 1342;
+exports.ER_FPARSER_ERROR_IN_PARAMETER = 1343;
+exports.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344;
+exports.ER_VIEW_NO_EXPLAIN = 1345;
+exports.ER_FRM_UNKNOWN_TYPE = 1346;
+exports.ER_WRONG_OBJECT = 1347;
+exports.ER_NONUPDATEABLE_COLUMN = 1348;
+exports.ER_VIEW_SELECT_DERIVED = 1349;
+exports.ER_VIEW_SELECT_CLAUSE = 1350;
+exports.ER_VIEW_SELECT_VARIABLE = 1351;
+exports.ER_VIEW_SELECT_TMPTABLE = 1352;
+exports.ER_VIEW_WRONG_LIST = 1353;
+exports.ER_WARN_VIEW_MERGE = 1354;
+exports.ER_WARN_VIEW_WITHOUT_KEY = 1355;
+exports.ER_VIEW_INVALID = 1356;
+exports.ER_SP_NO_DROP_SP = 1357;
+exports.ER_SP_GOTO_IN_HNDLR = 1358;
+exports.ER_TRG_ALREADY_EXISTS = 1359;
+exports.ER_TRG_DOES_NOT_EXIST = 1360;
+exports.ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361;
+exports.ER_TRG_CANT_CHANGE_ROW = 1362;
+exports.ER_TRG_NO_SUCH_ROW_IN_TRG = 1363;
+exports.ER_NO_DEFAULT_FOR_FIELD = 1364;
+exports.ER_DIVISION_BY_ZERO = 1365;
+exports.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366;
+exports.ER_ILLEGAL_VALUE_FOR_TYPE = 1367;
+exports.ER_VIEW_NONUPD_CHECK = 1368;
+exports.ER_VIEW_CHECK_FAILED = 1369;
+exports.ER_PROCACCESS_DENIED_ERROR = 1370;
+exports.ER_RELAY_LOG_FAIL = 1371;
+exports.ER_PASSWD_LENGTH = 1372;
+exports.ER_UNKNOWN_TARGET_BINLOG = 1373;
+exports.ER_IO_ERR_LOG_INDEX_READ = 1374;
+exports.ER_BINLOG_PURGE_PROHIBITED = 1375;
+exports.ER_FSEEK_FAIL = 1376;
+exports.ER_BINLOG_PURGE_FATAL_ERR = 1377;
+exports.ER_LOG_IN_USE = 1378;
+exports.ER_LOG_PURGE_UNKNOWN_ERR = 1379;
+exports.ER_RELAY_LOG_INIT = 1380;
+exports.ER_NO_BINARY_LOGGING = 1381;
+exports.ER_RESERVED_SYNTAX = 1382;
+exports.ER_WSAS_FAILED = 1383;
+exports.ER_DIFF_GROUPS_PROC = 1384;
+exports.ER_NO_GROUP_FOR_PROC = 1385;
+exports.ER_ORDER_WITH_PROC = 1386;
+exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 1387;
+exports.ER_NO_FILE_MAPPING = 1388;
+exports.ER_WRONG_MAGIC = 1389;
+exports.ER_PS_MANY_PARAM = 1390;
+exports.ER_KEY_PART_0 = 1391;
+exports.ER_VIEW_CHECKSUM = 1392;
+exports.ER_VIEW_MULTIUPDATE = 1393;
+exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394;
+exports.ER_VIEW_DELETE_MERGE_VIEW = 1395;
+exports.ER_CANNOT_USER = 1396;
+exports.ER_XAER_NOTA = 1397;
+exports.ER_XAER_INVAL = 1398;
+exports.ER_XAER_RMFAIL = 1399;
+exports.ER_XAER_OUTSIDE = 1400;
+exports.ER_XAER_RMERR = 1401;
+exports.ER_XA_RBROLLBACK = 1402;
+exports.ER_NONEXISTING_PROC_GRANT = 1403;
+exports.ER_PROC_AUTO_GRANT_FAIL = 1404;
+exports.ER_PROC_AUTO_REVOKE_FAIL = 1405;
+exports.ER_DATA_TOO_LONG = 1406;
+exports.ER_SP_BAD_SQLSTATE = 1407;
+exports.ER_STARTUP = 1408;
+exports.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409;
+exports.ER_CANT_CREATE_USER_WITH_GRANT = 1410;
+exports.ER_WRONG_VALUE_FOR_TYPE = 1411;
+exports.ER_TABLE_DEF_CHANGED = 1412;
+exports.ER_SP_DUP_HANDLER = 1413;
+exports.ER_SP_NOT_VAR_ARG = 1414;
+exports.ER_SP_NO_RETSET = 1415;
+exports.ER_CANT_CREATE_GEOMETRY_OBJECT = 1416;
+exports.ER_FAILED_ROUTINE_BREAK_BINLOG = 1417;
+exports.ER_BINLOG_UNSAFE_ROUTINE = 1418;
+exports.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419;
+exports.ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420;
+exports.ER_STMT_HAS_NO_OPEN_CURSOR = 1421;
+exports.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422;
+exports.ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423;
+exports.ER_SP_NO_RECURSION = 1424;
+exports.ER_TOO_BIG_SCALE = 1425;
+exports.ER_TOO_BIG_PRECISION = 1426;
+exports.ER_M_BIGGER_THAN_D = 1427;
+exports.ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428;
+exports.ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429;
+exports.ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430;
+exports.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431;
+exports.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432;
+exports.ER_FOREIGN_DATA_STRING_INVALID = 1433;
+exports.ER_CANT_CREATE_FEDERATED_TABLE = 1434;
+exports.ER_TRG_IN_WRONG_SCHEMA = 1435;
+exports.ER_STACK_OVERRUN_NEED_MORE = 1436;
+exports.ER_TOO_LONG_BODY = 1437;
+exports.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438;
+exports.ER_TOO_BIG_DISPLAYWIDTH = 1439;
+exports.ER_XAER_DUPID = 1440;
+exports.ER_DATETIME_FUNCTION_OVERFLOW = 1441;
+exports.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442;
+exports.ER_VIEW_PREVENT_UPDATE = 1443;
+exports.ER_PS_NO_RECURSION = 1444;
+exports.ER_SP_CANT_SET_AUTOCOMMIT = 1445;
+exports.ER_MALFORMED_DEFINER = 1446;
+exports.ER_VIEW_FRM_NO_USER = 1447;
+exports.ER_VIEW_OTHER_USER = 1448;
+exports.ER_NO_SUCH_USER = 1449;
+exports.ER_FORBID_SCHEMA_CHANGE = 1450;
+exports.ER_ROW_IS_REFERENCED_2 = 1451;
+exports.ER_NO_REFERENCED_ROW_2 = 1452;
+exports.ER_SP_BAD_VAR_SHADOW = 1453;
+exports.ER_TRG_NO_DEFINER = 1454;
+exports.ER_OLD_FILE_FORMAT = 1455;
+exports.ER_SP_RECURSION_LIMIT = 1456;
+exports.ER_SP_PROC_TABLE_CORRUPT = 1457;
+exports.ER_SP_WRONG_NAME = 1458;
+exports.ER_TABLE_NEEDS_UPGRADE = 1459;
+exports.ER_SP_NO_AGGREGATE = 1460;
+exports.ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461;
+exports.ER_VIEW_RECURSIVE = 1462;
+exports.ER_NON_GROUPING_FIELD_USED = 1463;
+exports.ER_TABLE_CANT_HANDLE_SPKEYS = 1464;
+exports.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465;
+exports.ER_REMOVED_SPACES = 1466;
+exports.ER_AUTOINC_READ_FAILED = 1467;
+exports.ER_USERNAME = 1468;
+exports.ER_HOSTNAME = 1469;
+exports.ER_WRONG_STRING_LENGTH = 1470;
+exports.ER_NON_INSERTABLE_TABLE = 1471;
+exports.ER_ADMIN_WRONG_MRG_TABLE = 1472;
+exports.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT = 1473;
+exports.ER_NAME_BECOMES_EMPTY = 1474;
+exports.ER_AMBIGUOUS_FIELD_TERM = 1475;
+exports.ER_FOREIGN_SERVER_EXISTS = 1476;
+exports.ER_FOREIGN_SERVER_DOESNT_EXIST = 1477;
+exports.ER_ILLEGAL_HA_CREATE_OPTION = 1478;
+exports.ER_PARTITION_REQUIRES_VALUES_ERROR = 1479;
+exports.ER_PARTITION_WRONG_VALUES_ERROR = 1480;
+exports.ER_PARTITION_MAXVALUE_ERROR = 1481;
+exports.ER_PARTITION_SUBPARTITION_ERROR = 1482;
+exports.ER_PARTITION_SUBPART_MIX_ERROR = 1483;
+exports.ER_PARTITION_WRONG_NO_PART_ERROR = 1484;
+exports.ER_PARTITION_WRONG_NO_SUBPART_ERROR = 1485;
+exports.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR = 1486;
+exports.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR = 1487;
+exports.ER_FIELD_NOT_FOUND_PART_ERROR = 1488;
+exports.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR = 1489;
+exports.ER_INCONSISTENT_PARTITION_INFO_ERROR = 1490;
+exports.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR = 1491;
+exports.ER_PARTITIONS_MUST_BE_DEFINED_ERROR = 1492;
+exports.ER_RANGE_NOT_INCREASING_ERROR = 1493;
+exports.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR = 1494;
+exports.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR = 1495;
+exports.ER_PARTITION_ENTRY_ERROR = 1496;
+exports.ER_MIX_HANDLER_ERROR = 1497;
+exports.ER_PARTITION_NOT_DEFINED_ERROR = 1498;
+exports.ER_TOO_MANY_PARTITIONS_ERROR = 1499;
+exports.ER_SUBPARTITION_ERROR = 1500;
+exports.ER_CANT_CREATE_HANDLER_FILE = 1501;
+exports.ER_BLOB_FIELD_IN_PART_FUNC_ERROR = 1502;
+exports.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF = 1503;
+exports.ER_NO_PARTS_ERROR = 1504;
+exports.ER_PARTITION_MGMT_ON_NONPARTITIONED = 1505;
+exports.ER_FOREIGN_KEY_ON_PARTITIONED = 1506;
+exports.ER_DROP_PARTITION_NON_EXISTENT = 1507;
+exports.ER_DROP_LAST_PARTITION = 1508;
+exports.ER_COALESCE_ONLY_ON_HASH_PARTITION = 1509;
+exports.ER_REORG_HASH_ONLY_ON_SAME_NO = 1510;
+exports.ER_REORG_NO_PARAM_ERROR = 1511;
+exports.ER_ONLY_ON_RANGE_LIST_PARTITION = 1512;
+exports.ER_ADD_PARTITION_SUBPART_ERROR = 1513;
+exports.ER_ADD_PARTITION_NO_NEW_PARTITION = 1514;
+exports.ER_COALESCE_PARTITION_NO_PARTITION = 1515;
+exports.ER_REORG_PARTITION_NOT_EXIST = 1516;
+exports.ER_SAME_NAME_PARTITION = 1517;
+exports.ER_NO_BINLOG_ERROR = 1518;
+exports.ER_CONSECUTIVE_REORG_PARTITIONS = 1519;
+exports.ER_REORG_OUTSIDE_RANGE = 1520;
+exports.ER_PARTITION_FUNCTION_FAILURE = 1521;
+exports.ER_PART_STATE_ERROR = 1522;
+exports.ER_LIMITED_PART_RANGE = 1523;
+exports.ER_PLUGIN_IS_NOT_LOADED = 1524;
+exports.ER_WRONG_VALUE = 1525;
+exports.ER_NO_PARTITION_FOR_GIVEN_VALUE = 1526;
+exports.ER_FILEGROUP_OPTION_ONLY_ONCE = 1527;
+exports.ER_CREATE_FILEGROUP_FAILED = 1528;
+exports.ER_DROP_FILEGROUP_FAILED = 1529;
+exports.ER_TABLESPACE_AUTO_EXTEND_ERROR = 1530;
+exports.ER_WRONG_SIZE_NUMBER = 1531;
+exports.ER_SIZE_OVERFLOW_ERROR = 1532;
+exports.ER_ALTER_FILEGROUP_FAILED = 1533;
+exports.ER_BINLOG_ROW_LOGGING_FAILED = 1534;
+exports.ER_BINLOG_ROW_WRONG_TABLE_DEF = 1535;
+exports.ER_BINLOG_ROW_RBR_TO_SBR = 1536;
+exports.ER_EVENT_ALREADY_EXISTS = 1537;
+exports.ER_EVENT_STORE_FAILED = 1538;
+exports.ER_EVENT_DOES_NOT_EXIST = 1539;
+exports.ER_EVENT_CANT_ALTER = 1540;
+exports.ER_EVENT_DROP_FAILED = 1541;
+exports.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG = 1542;
+exports.ER_EVENT_ENDS_BEFORE_STARTS = 1543;
+exports.ER_EVENT_EXEC_TIME_IN_THE_PAST = 1544;
+exports.ER_EVENT_OPEN_TABLE_FAILED = 1545;
+exports.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT = 1546;
+exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED = 1547;
+exports.ER_CANNOT_LOAD_FROM_TABLE = 1548;
+exports.ER_EVENT_CANNOT_DELETE = 1549;
+exports.ER_EVENT_COMPILE_ERROR = 1550;
+exports.ER_EVENT_SAME_NAME = 1551;
+exports.ER_EVENT_DATA_TOO_LONG = 1552;
+exports.ER_DROP_INDEX_FK = 1553;
+exports.ER_WARN_DEPRECATED_SYNTAX_WITH_VER = 1554;
+exports.ER_CANT_WRITE_LOCK_LOG_TABLE = 1555;
+exports.ER_CANT_LOCK_LOG_TABLE = 1556;
+exports.ER_FOREIGN_DUPLICATE_KEY = 1557;
+exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE = 1558;
+exports.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR = 1559;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1560;
+exports.ER_NDB_CANT_SWITCH_BINLOG_FORMAT = 1561;
+exports.ER_PARTITION_NO_TEMPORARY = 1562;
+exports.ER_PARTITION_CONST_DOMAIN_ERROR = 1563;
+exports.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED = 1564;
+exports.ER_DDL_LOG_ERROR = 1565;
+exports.ER_NULL_IN_VALUES_LESS_THAN = 1566;
+exports.ER_WRONG_PARTITION_NAME = 1567;
+exports.ER_CANT_CHANGE_TX_CHARACTERISTICS = 1568;
+exports.ER_DUP_ENTRY_AUTOINCREMENT_CASE = 1569;
+exports.ER_EVENT_MODIFY_QUEUE_ERROR = 1570;
+exports.ER_EVENT_SET_VAR_ERROR = 1571;
+exports.ER_PARTITION_MERGE_ERROR = 1572;
+exports.ER_CANT_ACTIVATE_LOG = 1573;
+exports.ER_RBR_NOT_AVAILABLE = 1574;
+exports.ER_BASE64_DECODE_ERROR = 1575;
+exports.ER_EVENT_RECURSION_FORBIDDEN = 1576;
+exports.ER_EVENTS_DB_ERROR = 1577;
+exports.ER_ONLY_INTEGERS_ALLOWED = 1578;
+exports.ER_UNSUPORTED_LOG_ENGINE = 1579;
+exports.ER_BAD_LOG_STATEMENT = 1580;
+exports.ER_CANT_RENAME_LOG_TABLE = 1581;
+exports.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT = 1582;
+exports.ER_WRONG_PARAMETERS_TO_NATIVE_FCT = 1583;
+exports.ER_WRONG_PARAMETERS_TO_STORED_FCT = 1584;
+exports.ER_NATIVE_FCT_NAME_COLLISION = 1585;
+exports.ER_DUP_ENTRY_WITH_KEY_NAME = 1586;
+exports.ER_BINLOG_PURGE_EMFILE = 1587;
+exports.ER_EVENT_CANNOT_CREATE_IN_THE_PAST = 1588;
+exports.ER_EVENT_CANNOT_ALTER_IN_THE_PAST = 1589;
+exports.ER_SLAVE_INCIDENT = 1590;
+exports.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT = 1591;
+exports.ER_BINLOG_UNSAFE_STATEMENT = 1592;
+exports.ER_SLAVE_FATAL_ERROR = 1593;
+exports.ER_SLAVE_RELAY_LOG_READ_FAILURE = 1594;
+exports.ER_SLAVE_RELAY_LOG_WRITE_FAILURE = 1595;
+exports.ER_SLAVE_CREATE_EVENT_FAILURE = 1596;
+exports.ER_SLAVE_MASTER_COM_FAILURE = 1597;
+exports.ER_BINLOG_LOGGING_IMPOSSIBLE = 1598;
+exports.ER_VIEW_NO_CREATION_CTX = 1599;
+exports.ER_VIEW_INVALID_CREATION_CTX = 1600;
+exports.ER_SR_INVALID_CREATION_CTX = 1601;
+exports.ER_TRG_CORRUPTED_FILE = 1602;
+exports.ER_TRG_NO_CREATION_CTX = 1603;
+exports.ER_TRG_INVALID_CREATION_CTX = 1604;
+exports.ER_EVENT_INVALID_CREATION_CTX = 1605;
+exports.ER_TRG_CANT_OPEN_TABLE = 1606;
+exports.ER_CANT_CREATE_SROUTINE = 1607;
+exports.ER_NEVER_USED = 1608;
+exports.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT = 1609;
+exports.ER_SLAVE_CORRUPT_EVENT = 1610;
+exports.ER_LOAD_DATA_INVALID_COLUMN = 1611;
+exports.ER_LOG_PURGE_NO_FILE = 1612;
+exports.ER_XA_RBTIMEOUT = 1613;
+exports.ER_XA_RBDEADLOCK = 1614;
+exports.ER_NEED_REPREPARE = 1615;
+exports.ER_DELAYED_NOT_SUPPORTED = 1616;
+exports.WARN_NO_MASTER_INFO = 1617;
+exports.WARN_OPTION_IGNORED = 1618;
+exports.ER_PLUGIN_DELETE_BUILTIN = 1619;
+exports.WARN_PLUGIN_BUSY = 1620;
+exports.ER_VARIABLE_IS_READONLY = 1621;
+exports.ER_WARN_ENGINE_TRANSACTION_ROLLBACK = 1622;
+exports.ER_SLAVE_HEARTBEAT_FAILURE = 1623;
+exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE = 1624;
+exports.ER_NDB_REPLICATION_SCHEMA_ERROR = 1625;
+exports.ER_CONFLICT_FN_PARSE_ERROR = 1626;
+exports.ER_EXCEPTIONS_WRITE_ERROR = 1627;
+exports.ER_TOO_LONG_TABLE_COMMENT = 1628;
+exports.ER_TOO_LONG_FIELD_COMMENT = 1629;
+exports.ER_FUNC_INEXISTENT_NAME_COLLISION = 1630;
+exports.ER_DATABASE_NAME = 1631;
+exports.ER_TABLE_NAME = 1632;
+exports.ER_PARTITION_NAME = 1633;
+exports.ER_SUBPARTITION_NAME = 1634;
+exports.ER_TEMPORARY_NAME = 1635;
+exports.ER_RENAMED_NAME = 1636;
+exports.ER_TOO_MANY_CONCURRENT_TRXS = 1637;
+exports.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED = 1638;
+exports.ER_DEBUG_SYNC_TIMEOUT = 1639;
+exports.ER_DEBUG_SYNC_HIT_LIMIT = 1640;
+exports.ER_DUP_SIGNAL_SET = 1641;
+exports.ER_SIGNAL_WARN = 1642;
+exports.ER_SIGNAL_NOT_FOUND = 1643;
+exports.ER_SIGNAL_EXCEPTION = 1644;
+exports.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER = 1645;
+exports.ER_SIGNAL_BAD_CONDITION_TYPE = 1646;
+exports.WARN_COND_ITEM_TRUNCATED = 1647;
+exports.ER_COND_ITEM_TOO_LONG = 1648;
+exports.ER_UNKNOWN_LOCALE = 1649;
+exports.ER_SLAVE_IGNORE_SERVER_IDS = 1650;
+exports.ER_QUERY_CACHE_DISABLED = 1651;
+exports.ER_SAME_NAME_PARTITION_FIELD = 1652;
+exports.ER_PARTITION_COLUMN_LIST_ERROR = 1653;
+exports.ER_WRONG_TYPE_COLUMN_VALUE_ERROR = 1654;
+exports.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR = 1655;
+exports.ER_MAXVALUE_IN_VALUES_IN = 1656;
+exports.ER_TOO_MANY_VALUES_ERROR = 1657;
+exports.ER_ROW_SINGLE_PARTITION_FIELD_ERROR = 1658;
+exports.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD = 1659;
+exports.ER_PARTITION_FIELDS_TOO_LONG = 1660;
+exports.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE = 1661;
+exports.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE = 1662;
+exports.ER_BINLOG_UNSAFE_AND_STMT_ENGINE = 1663;
+exports.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE = 1664;
+exports.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE = 1665;
+exports.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE = 1666;
+exports.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1667;
+exports.ER_BINLOG_UNSAFE_LIMIT = 1668;
+exports.ER_BINLOG_UNSAFE_INSERT_DELAYED = 1669;
+exports.ER_BINLOG_UNSAFE_SYSTEM_TABLE = 1670;
+exports.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS = 1671;
+exports.ER_BINLOG_UNSAFE_UDF = 1672;
+exports.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE = 1673;
+exports.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION = 1674;
+exports.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS = 1675;
+exports.ER_MESSAGE_AND_STATEMENT = 1676;
+exports.ER_SLAVE_CONVERSION_FAILED = 1677;
+exports.ER_SLAVE_CANT_CREATE_CONVERSION = 1678;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT = 1679;
+exports.ER_PATH_LENGTH = 1680;
+exports.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT = 1681;
+exports.ER_WRONG_NATIVE_TABLE_STRUCTURE = 1682;
+exports.ER_WRONG_PERFSCHEMA_USAGE = 1683;
+exports.ER_WARN_I_S_SKIPPED_TABLE = 1684;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1685;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT = 1686;
+exports.ER_SPATIAL_MUST_HAVE_GEOM_COL = 1687;
+exports.ER_TOO_LONG_INDEX_COMMENT = 1688;
+exports.ER_LOCK_ABORTED = 1689;
+exports.ER_DATA_OUT_OF_RANGE = 1690;
+exports.ER_WRONG_SPVAR_TYPE_IN_LIMIT = 1691;
+exports.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE = 1692;
+exports.ER_BINLOG_UNSAFE_MIXED_STATEMENT = 1693;
+exports.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1694;
+exports.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN = 1695;
+exports.ER_FAILED_READ_FROM_PAR_FILE = 1696;
+exports.ER_VALUES_IS_NOT_INT_TYPE_ERROR = 1697;
+exports.ER_ACCESS_DENIED_NO_PASSWORD_ERROR = 1698;
+exports.ER_SET_PASSWORD_AUTH_PLUGIN = 1699;
+exports.ER_GRANT_PLUGIN_USER_EXISTS = 1700;
+exports.ER_TRUNCATE_ILLEGAL_FK = 1701;
+exports.ER_PLUGIN_IS_PERMANENT = 1702;
+exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN = 1703;
+exports.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX = 1704;
+exports.ER_STMT_CACHE_FULL = 1705;
+exports.ER_MULTI_UPDATE_KEY_CONFLICT = 1706;
+exports.ER_TABLE_NEEDS_REBUILD = 1707;
+exports.WARN_OPTION_BELOW_LIMIT = 1708;
+exports.ER_INDEX_COLUMN_TOO_LONG = 1709;
+exports.ER_ERROR_IN_TRIGGER_BODY = 1710;
+exports.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY = 1711;
+exports.ER_INDEX_CORRUPT = 1712;
+exports.ER_UNDO_RECORD_TOO_BIG = 1713;
+exports.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT = 1714;
+exports.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE = 1715;
+exports.ER_BINLOG_UNSAFE_REPLACE_SELECT = 1716;
+exports.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT = 1717;
+exports.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT = 1718;
+exports.ER_BINLOG_UNSAFE_UPDATE_IGNORE = 1719;
+exports.ER_PLUGIN_NO_UNINSTALL = 1720;
+exports.ER_PLUGIN_NO_INSTALL = 1721;
+exports.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT = 1722;
+exports.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC = 1723;
+exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 1724;
+exports.ER_TABLE_IN_FK_CHECK = 1725;
+exports.ER_UNSUPPORTED_ENGINE = 1726;
+exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727;
+exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728;
+exports.ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729;
+exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730;
+exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731;
+exports.ER_PARTITION_EXCHANGE_PART_TABLE = 1732;
+exports.ER_PARTITION_EXCHANGE_TEMP_TABLE = 1733;
+exports.ER_PARTITION_INSTEAD_OF_SUBPARTITION = 1734;
+exports.ER_UNKNOWN_PARTITION = 1735;
+exports.ER_TABLES_DIFFERENT_METADATA = 1736;
+exports.ER_ROW_DOES_NOT_MATCH_PARTITION = 1737;
+exports.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX = 1738;
+exports.ER_WARN_INDEX_NOT_APPLICABLE = 1739;
+exports.ER_PARTITION_EXCHANGE_FOREIGN_KEY = 1740;
+exports.ER_NO_SUCH_KEY_VALUE = 1741;
+exports.ER_RPL_INFO_DATA_TOO_LONG = 1742;
+exports.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE = 1743;
+exports.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE = 1744;
+exports.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX = 1745;
+exports.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT = 1746;
+exports.ER_PARTITION_CLAUSE_ON_NONPARTITIONED = 1747;
+exports.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET = 1748;
+exports.ER_NO_SUCH_PARTITION = 1749;
+exports.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE = 1750;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE = 1751;
+exports.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE = 1752;
+exports.ER_MTS_FEATURE_IS_NOT_SUPPORTED = 1753;
+exports.ER_MTS_UPDATED_DBS_GREATER_MAX = 1754;
+exports.ER_MTS_CANT_PARALLEL = 1755;
+exports.ER_MTS_INCONSISTENT_DATA = 1756;
+exports.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING = 1757;
+exports.ER_DA_INVALID_CONDITION_NUMBER = 1758;
+exports.ER_INSECURE_PLAIN_TEXT = 1759;
+exports.ER_INSECURE_CHANGE_MASTER = 1760;
+exports.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO = 1761;
+exports.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO = 1762;
+exports.ER_SQLTHREAD_WITH_SECURE_SLAVE = 1763;
+exports.ER_TABLE_HAS_NO_FT = 1764;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER = 1765;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION = 1766;
+exports.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST = 1767;
+exports.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION = 1768;
+exports.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION = 1769;
+exports.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL = 1770;
+exports.ER_SKIPPING_LOGGED_TRANSACTION = 1771;
+exports.ER_MALFORMED_GTID_SET_SPECIFICATION = 1772;
+exports.ER_MALFORMED_GTID_SET_ENCODING = 1773;
+exports.ER_MALFORMED_GTID_SPECIFICATION = 1774;
+exports.ER_GNO_EXHAUSTED = 1775;
+exports.ER_BAD_SLAVE_AUTO_POSITION = 1776;
+exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF = 1777;
+exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778;
+exports.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779;
+exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780;
+exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781;
+exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782;
+exports.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF = 1783;
+exports.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF = 1784;
+exports.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE = 1785;
+exports.ER_GTID_UNSAFE_CREATE_SELECT = 1786;
+exports.ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION = 1787;
+exports.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME = 1788;
+exports.ER_MASTER_HAS_PURGED_REQUIRED_GTIDS = 1789;
+exports.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID = 1790;
+exports.ER_UNKNOWN_EXPLAIN_FORMAT = 1791;
+exports.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION = 1792;
+exports.ER_TOO_LONG_TABLE_PARTITION_COMMENT = 1793;
+exports.ER_SLAVE_CONFIGURATION = 1794;
+exports.ER_INNODB_FT_LIMIT = 1795;
+exports.ER_INNODB_NO_FT_TEMP_TABLE = 1796;
+exports.ER_INNODB_FT_WRONG_DOCID_COLUMN = 1797;
+exports.ER_INNODB_FT_WRONG_DOCID_INDEX = 1798;
+exports.ER_INNODB_ONLINE_LOG_TOO_BIG = 1799;
+exports.ER_UNKNOWN_ALTER_ALGORITHM = 1800;
+exports.ER_UNKNOWN_ALTER_LOCK = 1801;
+exports.ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802;
+exports.ER_MTS_RECOVERY_FAILURE = 1803;
+exports.ER_MTS_RESET_WORKERS = 1804;
+exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805;
+exports.ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806;
+exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807;
+exports.ER_TABLE_SCHEMA_MISMATCH = 1808;
+exports.ER_TABLE_IN_SYSTEM_TABLESPACE = 1809;
+exports.ER_IO_READ_ERROR = 1810;
+exports.ER_IO_WRITE_ERROR = 1811;
+exports.ER_TABLESPACE_MISSING = 1812;
+exports.ER_TABLESPACE_EXISTS = 1813;
+exports.ER_TABLESPACE_DISCARDED = 1814;
+exports.ER_INTERNAL_ERROR = 1815;
+exports.ER_INNODB_IMPORT_ERROR = 1816;
+exports.ER_INNODB_INDEX_CORRUPT = 1817;
+exports.ER_INVALID_YEAR_COLUMN_LENGTH = 1818;
+exports.ER_NOT_VALID_PASSWORD = 1819;
+exports.ER_MUST_CHANGE_PASSWORD = 1820;
+exports.ER_FK_NO_INDEX_CHILD = 1821;
+exports.ER_FK_NO_INDEX_PARENT = 1822;
+exports.ER_FK_FAIL_ADD_SYSTEM = 1823;
+exports.ER_FK_CANNOT_OPEN_PARENT = 1824;
+exports.ER_FK_INCORRECT_OPTION = 1825;
+exports.ER_FK_DUP_NAME = 1826;
+exports.ER_PASSWORD_FORMAT = 1827;
+exports.ER_FK_COLUMN_CANNOT_DROP = 1828;
+exports.ER_FK_COLUMN_CANNOT_DROP_CHILD = 1829;
+exports.ER_FK_COLUMN_NOT_NULL = 1830;
+exports.ER_DUP_INDEX = 1831;
+exports.ER_FK_COLUMN_CANNOT_CHANGE = 1832;
+exports.ER_FK_COLUMN_CANNOT_CHANGE_CHILD = 1833;
+exports.ER_FK_CANNOT_DELETE_PARENT = 1834;
+exports.ER_MALFORMED_PACKET = 1835;
+exports.ER_READ_ONLY_MODE = 1836;
+exports.ER_GTID_NEXT_TYPE_UNDEFINED_GROUP = 1837;
+exports.ER_VARIABLE_NOT_SETTABLE_IN_SP = 1838;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF = 1839;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY = 1840;
+exports.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY = 1841;
+exports.ER_GTID_PURGED_WAS_CHANGED = 1842;
+exports.ER_GTID_EXECUTED_WAS_CHANGED = 1843;
+exports.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES = 1844;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED = 1845;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON = 1846;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY = 1847;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION = 1848;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME = 1849;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE = 1850;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK = 1851;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE = 1852;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK = 1853;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC = 1854;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS = 1855;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS = 1856;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS = 1857;
+exports.ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE = 1858;
+exports.ER_DUP_UNKNOWN_IN_INDEX = 1859;
+exports.ER_IDENT_CAUSES_TOO_LONG_PATH = 1860;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL = 1861;
+exports.ER_MUST_CHANGE_PASSWORD_LOGIN = 1862;
+exports.ER_ROW_IN_WRONG_PARTITION = 1863;
+exports.ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX = 1864;
+exports.ER_INNODB_NO_FT_USES_PARSER = 1865;
+exports.ER_BINLOG_LOGICAL_CORRUPTION = 1866;
+exports.ER_WARN_PURGE_LOG_IN_USE = 1867;
+exports.ER_WARN_PURGE_LOG_IS_ACTIVE = 1868;
+exports.ER_AUTO_INCREMENT_CONFLICT = 1869;
+exports.WARN_ON_BLOCKHOLE_IN_RBR = 1870;
+exports.ER_SLAVE_MI_INIT_REPOSITORY = 1871;
+exports.ER_SLAVE_RLI_INIT_REPOSITORY = 1872;
+exports.ER_ACCESS_DENIED_CHANGE_USER_ERROR = 1873;
+exports.ER_INNODB_READ_ONLY = 1874;
+exports.ER_STOP_SLAVE_SQL_THREAD_TIMEOUT = 1875;
+exports.ER_STOP_SLAVE_IO_THREAD_TIMEOUT = 1876;
+exports.ER_TABLE_CORRUPT = 1877;
+exports.ER_TEMP_FILE_WRITE_FAILURE = 1878;
+exports.ER_INNODB_FT_AUX_NOT_HEX_ID = 1879;
+exports.ER_OLD_TEMPORALS_UPGRADED = 1880;
+exports.ER_INNODB_FORCED_RECOVERY = 1881;
+exports.ER_AES_INVALID_IV = 1882;
+exports.ER_PLUGIN_CANNOT_BE_UNINSTALLED = 1883;
+exports.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP = 1884;
+exports.ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER = 1885;
+exports.ER_MISSING_KEY = 1886;
+exports.WARN_NAMED_PIPE_ACCESS_EVERYONE = 1887;
+exports.ER_FOUND_MISSING_GTIDS = 1888;
+exports.ER_FILE_CORRUPT = 3000;
+exports.ER_ERROR_ON_MASTER = 3001;
+exports.ER_INCONSISTENT_ERROR = 3002;
+exports.ER_STORAGE_ENGINE_NOT_LOADED = 3003;
+exports.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER = 3004;
+exports.ER_WARN_LEGACY_SYNTAX_CONVERTED = 3005;
+exports.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN = 3006;
+exports.ER_CANNOT_DISCARD_TEMPORARY_TABLE = 3007;
+exports.ER_FK_DEPTH_EXCEEDED = 3008;
+exports.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2 = 3009;
+exports.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED = 3010;
+exports.ER_REFERENCED_TRG_DOES_NOT_EXIST = 3011;
+exports.ER_EXPLAIN_NOT_SUPPORTED = 3012;
+exports.ER_INVALID_FIELD_SIZE = 3013;
+exports.ER_MISSING_HA_CREATE_OPTION = 3014;
+exports.ER_ENGINE_OUT_OF_MEMORY = 3015;
+exports.ER_PASSWORD_EXPIRE_ANONYMOUS_USER = 3016;
+exports.ER_SLAVE_SQL_THREAD_MUST_STOP = 3017;
+exports.ER_NO_FT_MATERIALIZED_SUBQUERY = 3018;
+exports.ER_INNODB_UNDO_LOG_FULL = 3019;
+exports.ER_INVALID_ARGUMENT_FOR_LOGARITHM = 3020;
+exports.ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP = 3021;
+exports.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO = 3022;
+exports.ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS = 3023;
+exports.ER_QUERY_TIMEOUT = 3024;
+exports.ER_NON_RO_SELECT_DISABLE_TIMER = 3025;
+exports.ER_DUP_LIST_ENTRY = 3026;
+exports.ER_SQL_MODE_NO_EFFECT = 3027;
+exports.ER_AGGREGATE_ORDER_FOR_UNION = 3028;
+exports.ER_AGGREGATE_ORDER_NON_AGG_QUERY = 3029;
+exports.ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR = 3030;
+exports.ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER = 3031;
+exports.ER_SERVER_OFFLINE_MODE = 3032;
+exports.ER_GIS_DIFFERENT_SRIDS = 3033;
+exports.ER_GIS_UNSUPPORTED_ARGUMENT = 3034;
+exports.ER_GIS_UNKNOWN_ERROR = 3035;
+exports.ER_GIS_UNKNOWN_EXCEPTION = 3036;
+exports.ER_GIS_INVALID_DATA = 3037;
+exports.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION = 3038;
+exports.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION = 3039;
+exports.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION = 3040;
+exports.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION = 3041;
+exports.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION = 3042;
+exports.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION = 3043;
+exports.ER_STD_BAD_ALLOC_ERROR = 3044;
+exports.ER_STD_DOMAIN_ERROR = 3045;
+exports.ER_STD_LENGTH_ERROR = 3046;
+exports.ER_STD_INVALID_ARGUMENT = 3047;
+exports.ER_STD_OUT_OF_RANGE_ERROR = 3048;
+exports.ER_STD_OVERFLOW_ERROR = 3049;
+exports.ER_STD_RANGE_ERROR = 3050;
+exports.ER_STD_UNDERFLOW_ERROR = 3051;
+exports.ER_STD_LOGIC_ERROR = 3052;
+exports.ER_STD_RUNTIME_ERROR = 3053;
+exports.ER_STD_UNKNOWN_EXCEPTION = 3054;
+exports.ER_GIS_DATA_WRONG_ENDIANESS = 3055;
+exports.ER_CHANGE_MASTER_PASSWORD_LENGTH = 3056;
+exports.ER_USER_LOCK_WRONG_NAME = 3057;
+exports.ER_USER_LOCK_DEADLOCK = 3058;
+exports.ER_REPLACE_INACCESSIBLE_ROWS = 3059;
+exports.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS = 3060;
+exports.ER_ILLEGAL_USER_VAR = 3061;
+exports.ER_GTID_MODE_OFF = 3062;
+exports.ER_UNSUPPORTED_BY_REPLICATION_THREAD = 3063;
+exports.ER_INCORRECT_TYPE = 3064;
+exports.ER_FIELD_IN_ORDER_NOT_SELECT = 3065;
+exports.ER_AGGREGATE_IN_ORDER_NOT_SELECT = 3066;
+exports.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN = 3067;
+exports.ER_NET_OK_PACKET_TOO_LARGE = 3068;
+exports.ER_INVALID_JSON_DATA = 3069;
+exports.ER_INVALID_GEOJSON_MISSING_MEMBER = 3070;
+exports.ER_INVALID_GEOJSON_WRONG_TYPE = 3071;
+exports.ER_INVALID_GEOJSON_UNSPECIFIED = 3072;
+exports.ER_DIMENSION_UNSUPPORTED = 3073;
+exports.ER_SLAVE_CHANNEL_DOES_NOT_EXIST = 3074;
+exports.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT = 3075;
+exports.ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG = 3076;
+exports.ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY = 3077;
+exports.ER_SLAVE_CHANNEL_DELETE = 3078;
+exports.ER_SLAVE_MULTIPLE_CHANNELS_CMD = 3079;
+exports.ER_SLAVE_MAX_CHANNELS_EXCEEDED = 3080;
+exports.ER_SLAVE_CHANNEL_MUST_STOP = 3081;
+exports.ER_SLAVE_CHANNEL_NOT_RUNNING = 3082;
+exports.ER_SLAVE_CHANNEL_WAS_RUNNING = 3083;
+exports.ER_SLAVE_CHANNEL_WAS_NOT_RUNNING = 3084;
+exports.ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP = 3085;
+exports.ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER = 3086;
+exports.ER_WRONG_FIELD_WITH_GROUP_V2 = 3087;
+exports.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2 = 3088;
+exports.ER_WARN_DEPRECATED_SYSVAR_UPDATE = 3089;
+exports.ER_WARN_DEPRECATED_SQLMODE = 3090;
+exports.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID = 3091;
+exports.ER_GROUP_REPLICATION_CONFIGURATION = 3092;
+exports.ER_GROUP_REPLICATION_RUNNING = 3093;
+exports.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR = 3094;
+exports.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT = 3095;
+exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR = 3096;
+exports.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR = 3097;
+exports.ER_BEFORE_DML_VALIDATION_ERROR = 3098;
+exports.ER_PREVENTS_VARIABLE_WITHOUT_RBR = 3099;
+exports.ER_RUN_HOOK_ERROR = 3100;
+exports.ER_TRANSACTION_ROLLBACK_DURING_COMMIT = 3101;
+exports.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED = 3102;
+exports.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN = 3103;
+exports.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN = 3104;
+exports.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN = 3105;
+exports.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN = 3106;
+exports.ER_GENERATED_COLUMN_NON_PRIOR = 3107;
+exports.ER_DEPENDENT_BY_GENERATED_COLUMN = 3108;
+exports.ER_GENERATED_COLUMN_REF_AUTO_INC = 3109;
+exports.ER_FEATURE_NOT_AVAILABLE = 3110;
+exports.ER_CANT_SET_GTID_MODE = 3111;
+exports.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF = 3112;
+exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION = 3113;
+exports.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON = 3114;
+exports.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF = 3115;
+exports.ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3116;
+exports.ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS = 3117;
+exports.ER_ACCOUNT_HAS_BEEN_LOCKED = 3118;
+exports.ER_WRONG_TABLESPACE_NAME = 3119;
+exports.ER_TABLESPACE_IS_NOT_EMPTY = 3120;
+exports.ER_WRONG_FILE_NAME = 3121;
+exports.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION = 3122;
+exports.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR = 3123;
+exports.ER_WARN_BAD_MAX_EXECUTION_TIME = 3124;
+exports.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME = 3125;
+exports.ER_WARN_CONFLICTING_HINT = 3126;
+exports.ER_WARN_UNKNOWN_QB_NAME = 3127;
+exports.ER_UNRESOLVED_HINT_NAME = 3128;
+exports.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE = 3129;
+exports.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED = 3130;
+exports.ER_LOCKING_SERVICE_WRONG_NAME = 3131;
+exports.ER_LOCKING_SERVICE_DEADLOCK = 3132;
+exports.ER_LOCKING_SERVICE_TIMEOUT = 3133;
+exports.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED = 3134;
+exports.ER_SQL_MODE_MERGED = 3135;
+exports.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH = 3136;
+exports.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND = 3137;
+exports.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID = 3138;
+exports.ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED = 3139;
+exports.ER_INVALID_JSON_TEXT = 3140;
+exports.ER_INVALID_JSON_TEXT_IN_PARAM = 3141;
+exports.ER_INVALID_JSON_BINARY_DATA = 3142;
+exports.ER_INVALID_JSON_PATH = 3143;
+exports.ER_INVALID_JSON_CHARSET = 3144;
+exports.ER_INVALID_JSON_CHARSET_IN_FUNCTION = 3145;
+exports.ER_INVALID_TYPE_FOR_JSON = 3146;
+exports.ER_INVALID_CAST_TO_JSON = 3147;
+exports.ER_INVALID_JSON_PATH_CHARSET = 3148;
+exports.ER_INVALID_JSON_PATH_WILDCARD = 3149;
+exports.ER_JSON_VALUE_TOO_BIG = 3150;
+exports.ER_JSON_KEY_TOO_BIG = 3151;
+exports.ER_JSON_USED_AS_KEY = 3152;
+exports.ER_JSON_VACUOUS_PATH = 3153;
+exports.ER_JSON_BAD_ONE_OR_ALL_ARG = 3154;
+exports.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE = 3155;
+exports.ER_INVALID_JSON_VALUE_FOR_CAST = 3156;
+exports.ER_JSON_DOCUMENT_TOO_DEEP = 3157;
+exports.ER_JSON_DOCUMENT_NULL_KEY = 3158;
+exports.ER_SECURE_TRANSPORT_REQUIRED = 3159;
+exports.ER_NO_SECURE_TRANSPORTS_CONFIGURED = 3160;
+exports.ER_DISABLED_STORAGE_ENGINE = 3161;
+exports.ER_USER_DOES_NOT_EXIST = 3162;
+exports.ER_USER_ALREADY_EXISTS = 3163;
+exports.ER_AUDIT_API_ABORT = 3164;
+exports.ER_INVALID_JSON_PATH_ARRAY_CELL = 3165;
+exports.ER_BUFPOOL_RESIZE_INPROGRESS = 3166;
+exports.ER_FEATURE_DISABLED_SEE_DOC = 3167;
+exports.ER_SERVER_ISNT_AVAILABLE = 3168;
+exports.ER_SESSION_WAS_KILLED = 3169;
+exports.ER_CAPACITY_EXCEEDED = 3170;
+exports.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER = 3171;
+exports.ER_TABLE_NEEDS_UPG_PART = 3172;
+exports.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID = 3173;
+exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL = 3174;
+exports.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT = 3175;
+exports.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE = 3176;
+exports.ER_LOCK_REFUSED_BY_ENGINE = 3177;
+exports.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN = 3178;
+exports.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE = 3179;
+exports.ER_MASTER_KEY_ROTATION_ERROR_BY_SE = 3180;
+exports.ER_MASTER_KEY_ROTATION_BINLOG_FAILED = 3181;
+exports.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE = 3182;
+exports.ER_TABLESPACE_CANNOT_ENCRYPT = 3183;
+exports.ER_INVALID_ENCRYPTION_OPTION = 3184;
+exports.ER_CANNOT_FIND_KEY_IN_KEYRING = 3185;
+exports.ER_CAPACITY_EXCEEDED_IN_PARSER = 3186;
+exports.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE = 3187;
+exports.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR = 3188;
+exports.ER_USER_COLUMN_OLD_LENGTH = 3189;
+exports.ER_CANT_RESET_MASTER = 3190;
+exports.ER_GROUP_REPLICATION_MAX_GROUP_SIZE = 3191;
+exports.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED = 3192;
+exports.ER_TABLE_REFERENCED = 3193;
+exports.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE = 3194;
+exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO = 3195;
+exports.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID = 3196;
+exports.ER_XA_RETRY = 3197;
+exports.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR = 3198;
+exports.ER_BINLOG_UNSAFE_XA = 3199;
+exports.ER_UDF_ERROR = 3200;
+exports.ER_KEYRING_MIGRATION_FAILURE = 3201;
+exports.ER_KEYRING_ACCESS_DENIED_ERROR = 3202;
+exports.ER_KEYRING_MIGRATION_STATUS = 3203;
+exports.ER_PLUGIN_FAILED_TO_OPEN_TABLES = 3204;
+exports.ER_PLUGIN_FAILED_TO_OPEN_TABLE = 3205;
+exports.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED = 3206;
+exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET = 3207;
+exports.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY = 3208;
+exports.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED = 3209;
+exports.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED = 3210;
+exports.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE = 3211;
+exports.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED = 3212;
+exports.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS = 3213;
+exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE = 3214;
+exports.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT = 3215;
+exports.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED = 3216;
+exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE = 3217;
+exports.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE = 3218;
+exports.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR = 3219;
+exports.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY = 3220;
+exports.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY = 3221;
+exports.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS = 3222;
+exports.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC = 3223;
+exports.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER = 3224;
+exports.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER = 3225;
+exports.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP = 3226;
+exports.ER_XA_REPLICATION_FILTERS = 3227;
+exports.ER_CANT_OPEN_ERROR_LOG = 3228;
+exports.ER_GROUPING_ON_TIMESTAMP_IN_DST = 3229;
+exports.ER_CANT_START_SERVER_NAMED_PIPE = 3230;
- self._redirect.onRequest(options)
+// Lookup-by-number table
+exports[1] = 'EE_CANTCREATEFILE';
+exports[2] = 'EE_READ';
+exports[3] = 'EE_WRITE';
+exports[4] = 'EE_BADCLOSE';
+exports[5] = 'EE_OUTOFMEMORY';
+exports[6] = 'EE_DELETE';
+exports[7] = 'EE_LINK';
+exports[9] = 'EE_EOFERR';
+exports[10] = 'EE_CANTLOCK';
+exports[11] = 'EE_CANTUNLOCK';
+exports[12] = 'EE_DIR';
+exports[13] = 'EE_STAT';
+exports[14] = 'EE_CANT_CHSIZE';
+exports[15] = 'EE_CANT_OPEN_STREAM';
+exports[16] = 'EE_GETWD';
+exports[17] = 'EE_SETWD';
+exports[18] = 'EE_LINK_WARNING';
+exports[19] = 'EE_OPEN_WARNING';
+exports[20] = 'EE_DISK_FULL';
+exports[21] = 'EE_CANT_MKDIR';
+exports[22] = 'EE_UNKNOWN_CHARSET';
+exports[23] = 'EE_OUT_OF_FILERESOURCES';
+exports[24] = 'EE_CANT_READLINK';
+exports[25] = 'EE_CANT_SYMLINK';
+exports[26] = 'EE_REALPATH';
+exports[27] = 'EE_SYNC';
+exports[28] = 'EE_UNKNOWN_COLLATION';
+exports[29] = 'EE_FILENOTFOUND';
+exports[30] = 'EE_FILE_NOT_CLOSED';
+exports[31] = 'EE_CHANGE_OWNERSHIP';
+exports[32] = 'EE_CHANGE_PERMISSIONS';
+exports[33] = 'EE_CANT_SEEK';
+exports[34] = 'EE_CAPACITY_EXCEEDED';
+exports[120] = 'HA_ERR_KEY_NOT_FOUND';
+exports[121] = 'HA_ERR_FOUND_DUPP_KEY';
+exports[122] = 'HA_ERR_INTERNAL_ERROR';
+exports[123] = 'HA_ERR_RECORD_CHANGED';
+exports[124] = 'HA_ERR_WRONG_INDEX';
+exports[126] = 'HA_ERR_CRASHED';
+exports[127] = 'HA_ERR_WRONG_IN_RECORD';
+exports[128] = 'HA_ERR_OUT_OF_MEM';
+exports[130] = 'HA_ERR_NOT_A_TABLE';
+exports[131] = 'HA_ERR_WRONG_COMMAND';
+exports[132] = 'HA_ERR_OLD_FILE';
+exports[133] = 'HA_ERR_NO_ACTIVE_RECORD';
+exports[134] = 'HA_ERR_RECORD_DELETED';
+exports[135] = 'HA_ERR_RECORD_FILE_FULL';
+exports[136] = 'HA_ERR_INDEX_FILE_FULL';
+exports[137] = 'HA_ERR_END_OF_FILE';
+exports[138] = 'HA_ERR_UNSUPPORTED';
+exports[139] = 'HA_ERR_TOO_BIG_ROW';
+exports[140] = 'HA_WRONG_CREATE_OPTION';
+exports[141] = 'HA_ERR_FOUND_DUPP_UNIQUE';
+exports[142] = 'HA_ERR_UNKNOWN_CHARSET';
+exports[143] = 'HA_ERR_WRONG_MRG_TABLE_DEF';
+exports[144] = 'HA_ERR_CRASHED_ON_REPAIR';
+exports[145] = 'HA_ERR_CRASHED_ON_USAGE';
+exports[146] = 'HA_ERR_LOCK_WAIT_TIMEOUT';
+exports[147] = 'HA_ERR_LOCK_TABLE_FULL';
+exports[148] = 'HA_ERR_READ_ONLY_TRANSACTION';
+exports[149] = 'HA_ERR_LOCK_DEADLOCK';
+exports[150] = 'HA_ERR_CANNOT_ADD_FOREIGN';
+exports[151] = 'HA_ERR_NO_REFERENCED_ROW';
+exports[152] = 'HA_ERR_ROW_IS_REFERENCED';
+exports[153] = 'HA_ERR_NO_SAVEPOINT';
+exports[154] = 'HA_ERR_NON_UNIQUE_BLOCK_SIZE';
+exports[155] = 'HA_ERR_NO_SUCH_TABLE';
+exports[156] = 'HA_ERR_TABLE_EXIST';
+exports[157] = 'HA_ERR_NO_CONNECTION';
+exports[158] = 'HA_ERR_NULL_IN_SPATIAL';
+exports[159] = 'HA_ERR_TABLE_DEF_CHANGED';
+exports[160] = 'HA_ERR_NO_PARTITION_FOUND';
+exports[161] = 'HA_ERR_RBR_LOGGING_FAILED';
+exports[162] = 'HA_ERR_DROP_INDEX_FK';
+exports[163] = 'HA_ERR_FOREIGN_DUPLICATE_KEY';
+exports[164] = 'HA_ERR_TABLE_NEEDS_UPGRADE';
+exports[165] = 'HA_ERR_TABLE_READONLY';
+exports[166] = 'HA_ERR_AUTOINC_READ_FAILED';
+exports[167] = 'HA_ERR_AUTOINC_ERANGE';
+exports[168] = 'HA_ERR_GENERIC';
+exports[169] = 'HA_ERR_RECORD_IS_THE_SAME';
+exports[170] = 'HA_ERR_LOGGING_IMPOSSIBLE';
+exports[171] = 'HA_ERR_CORRUPT_EVENT';
+exports[172] = 'HA_ERR_NEW_FILE';
+exports[173] = 'HA_ERR_ROWS_EVENT_APPLY';
+exports[174] = 'HA_ERR_INITIALIZATION';
+exports[175] = 'HA_ERR_FILE_TOO_SHORT';
+exports[176] = 'HA_ERR_WRONG_CRC';
+exports[177] = 'HA_ERR_TOO_MANY_CONCURRENT_TRXS';
+exports[178] = 'HA_ERR_NOT_IN_LOCK_PARTITIONS';
+exports[179] = 'HA_ERR_INDEX_COL_TOO_LONG';
+exports[180] = 'HA_ERR_INDEX_CORRUPT';
+exports[181] = 'HA_ERR_UNDO_REC_TOO_BIG';
+exports[182] = 'HA_FTS_INVALID_DOCID';
+exports[183] = 'HA_ERR_TABLE_IN_FK_CHECK';
+exports[184] = 'HA_ERR_TABLESPACE_EXISTS';
+exports[185] = 'HA_ERR_TOO_MANY_FIELDS';
+exports[186] = 'HA_ERR_ROW_IN_WRONG_PARTITION';
+exports[187] = 'HA_ERR_INNODB_READ_ONLY';
+exports[188] = 'HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT';
+exports[189] = 'HA_ERR_TEMP_FILE_WRITE_FAILURE';
+exports[190] = 'HA_ERR_INNODB_FORCED_RECOVERY';
+exports[191] = 'HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE';
+exports[192] = 'HA_ERR_FK_DEPTH_EXCEEDED';
+exports[193] = 'HA_MISSING_CREATE_OPTION';
+exports[194] = 'HA_ERR_SE_OUT_OF_MEMORY';
+exports[195] = 'HA_ERR_TABLE_CORRUPT';
+exports[196] = 'HA_ERR_QUERY_INTERRUPTED';
+exports[197] = 'HA_ERR_TABLESPACE_MISSING';
+exports[198] = 'HA_ERR_TABLESPACE_IS_NOT_EMPTY';
+exports[199] = 'HA_ERR_WRONG_FILE_NAME';
+exports[200] = 'HA_ERR_NOT_ALLOWED_COMMAND';
+exports[201] = 'HA_ERR_COMPUTE_FAILED';
+exports[1000] = 'ER_HASHCHK';
+exports[1001] = 'ER_NISAMCHK';
+exports[1002] = 'ER_NO';
+exports[1003] = 'ER_YES';
+exports[1004] = 'ER_CANT_CREATE_FILE';
+exports[1005] = 'ER_CANT_CREATE_TABLE';
+exports[1006] = 'ER_CANT_CREATE_DB';
+exports[1007] = 'ER_DB_CREATE_EXISTS';
+exports[1008] = 'ER_DB_DROP_EXISTS';
+exports[1009] = 'ER_DB_DROP_DELETE';
+exports[1010] = 'ER_DB_DROP_RMDIR';
+exports[1011] = 'ER_CANT_DELETE_FILE';
+exports[1012] = 'ER_CANT_FIND_SYSTEM_REC';
+exports[1013] = 'ER_CANT_GET_STAT';
+exports[1014] = 'ER_CANT_GET_WD';
+exports[1015] = 'ER_CANT_LOCK';
+exports[1016] = 'ER_CANT_OPEN_FILE';
+exports[1017] = 'ER_FILE_NOT_FOUND';
+exports[1018] = 'ER_CANT_READ_DIR';
+exports[1019] = 'ER_CANT_SET_WD';
+exports[1020] = 'ER_CHECKREAD';
+exports[1021] = 'ER_DISK_FULL';
+exports[1022] = 'ER_DUP_KEY';
+exports[1023] = 'ER_ERROR_ON_CLOSE';
+exports[1024] = 'ER_ERROR_ON_READ';
+exports[1025] = 'ER_ERROR_ON_RENAME';
+exports[1026] = 'ER_ERROR_ON_WRITE';
+exports[1027] = 'ER_FILE_USED';
+exports[1028] = 'ER_FILSORT_ABORT';
+exports[1029] = 'ER_FORM_NOT_FOUND';
+exports[1030] = 'ER_GET_ERRNO';
+exports[1031] = 'ER_ILLEGAL_HA';
+exports[1032] = 'ER_KEY_NOT_FOUND';
+exports[1033] = 'ER_NOT_FORM_FILE';
+exports[1034] = 'ER_NOT_KEYFILE';
+exports[1035] = 'ER_OLD_KEYFILE';
+exports[1036] = 'ER_OPEN_AS_READONLY';
+exports[1037] = 'ER_OUTOFMEMORY';
+exports[1038] = 'ER_OUT_OF_SORTMEMORY';
+exports[1039] = 'ER_UNEXPECTED_EOF';
+exports[1040] = 'ER_CON_COUNT_ERROR';
+exports[1041] = 'ER_OUT_OF_RESOURCES';
+exports[1042] = 'ER_BAD_HOST_ERROR';
+exports[1043] = 'ER_HANDSHAKE_ERROR';
+exports[1044] = 'ER_DBACCESS_DENIED_ERROR';
+exports[1045] = 'ER_ACCESS_DENIED_ERROR';
+exports[1046] = 'ER_NO_DB_ERROR';
+exports[1047] = 'ER_UNKNOWN_COM_ERROR';
+exports[1048] = 'ER_BAD_NULL_ERROR';
+exports[1049] = 'ER_BAD_DB_ERROR';
+exports[1050] = 'ER_TABLE_EXISTS_ERROR';
+exports[1051] = 'ER_BAD_TABLE_ERROR';
+exports[1052] = 'ER_NON_UNIQ_ERROR';
+exports[1053] = 'ER_SERVER_SHUTDOWN';
+exports[1054] = 'ER_BAD_FIELD_ERROR';
+exports[1055] = 'ER_WRONG_FIELD_WITH_GROUP';
+exports[1056] = 'ER_WRONG_GROUP_FIELD';
+exports[1057] = 'ER_WRONG_SUM_SELECT';
+exports[1058] = 'ER_WRONG_VALUE_COUNT';
+exports[1059] = 'ER_TOO_LONG_IDENT';
+exports[1060] = 'ER_DUP_FIELDNAME';
+exports[1061] = 'ER_DUP_KEYNAME';
+exports[1062] = 'ER_DUP_ENTRY';
+exports[1063] = 'ER_WRONG_FIELD_SPEC';
+exports[1064] = 'ER_PARSE_ERROR';
+exports[1065] = 'ER_EMPTY_QUERY';
+exports[1066] = 'ER_NONUNIQ_TABLE';
+exports[1067] = 'ER_INVALID_DEFAULT';
+exports[1068] = 'ER_MULTIPLE_PRI_KEY';
+exports[1069] = 'ER_TOO_MANY_KEYS';
+exports[1070] = 'ER_TOO_MANY_KEY_PARTS';
+exports[1071] = 'ER_TOO_LONG_KEY';
+exports[1072] = 'ER_KEY_COLUMN_DOES_NOT_EXITS';
+exports[1073] = 'ER_BLOB_USED_AS_KEY';
+exports[1074] = 'ER_TOO_BIG_FIELDLENGTH';
+exports[1075] = 'ER_WRONG_AUTO_KEY';
+exports[1076] = 'ER_READY';
+exports[1077] = 'ER_NORMAL_SHUTDOWN';
+exports[1078] = 'ER_GOT_SIGNAL';
+exports[1079] = 'ER_SHUTDOWN_COMPLETE';
+exports[1080] = 'ER_FORCING_CLOSE';
+exports[1081] = 'ER_IPSOCK_ERROR';
+exports[1082] = 'ER_NO_SUCH_INDEX';
+exports[1083] = 'ER_WRONG_FIELD_TERMINATORS';
+exports[1084] = 'ER_BLOBS_AND_NO_TERMINATED';
+exports[1085] = 'ER_TEXTFILE_NOT_READABLE';
+exports[1086] = 'ER_FILE_EXISTS_ERROR';
+exports[1087] = 'ER_LOAD_INFO';
+exports[1088] = 'ER_ALTER_INFO';
+exports[1089] = 'ER_WRONG_SUB_KEY';
+exports[1090] = 'ER_CANT_REMOVE_ALL_FIELDS';
+exports[1091] = 'ER_CANT_DROP_FIELD_OR_KEY';
+exports[1092] = 'ER_INSERT_INFO';
+exports[1093] = 'ER_UPDATE_TABLE_USED';
+exports[1094] = 'ER_NO_SUCH_THREAD';
+exports[1095] = 'ER_KILL_DENIED_ERROR';
+exports[1096] = 'ER_NO_TABLES_USED';
+exports[1097] = 'ER_TOO_BIG_SET';
+exports[1098] = 'ER_NO_UNIQUE_LOGFILE';
+exports[1099] = 'ER_TABLE_NOT_LOCKED_FOR_WRITE';
+exports[1100] = 'ER_TABLE_NOT_LOCKED';
+exports[1101] = 'ER_BLOB_CANT_HAVE_DEFAULT';
+exports[1102] = 'ER_WRONG_DB_NAME';
+exports[1103] = 'ER_WRONG_TABLE_NAME';
+exports[1104] = 'ER_TOO_BIG_SELECT';
+exports[1105] = 'ER_UNKNOWN_ERROR';
+exports[1106] = 'ER_UNKNOWN_PROCEDURE';
+exports[1107] = 'ER_WRONG_PARAMCOUNT_TO_PROCEDURE';
+exports[1108] = 'ER_WRONG_PARAMETERS_TO_PROCEDURE';
+exports[1109] = 'ER_UNKNOWN_TABLE';
+exports[1110] = 'ER_FIELD_SPECIFIED_TWICE';
+exports[1111] = 'ER_INVALID_GROUP_FUNC_USE';
+exports[1112] = 'ER_UNSUPPORTED_EXTENSION';
+exports[1113] = 'ER_TABLE_MUST_HAVE_COLUMNS';
+exports[1114] = 'ER_RECORD_FILE_FULL';
+exports[1115] = 'ER_UNKNOWN_CHARACTER_SET';
+exports[1116] = 'ER_TOO_MANY_TABLES';
+exports[1117] = 'ER_TOO_MANY_FIELDS';
+exports[1118] = 'ER_TOO_BIG_ROWSIZE';
+exports[1119] = 'ER_STACK_OVERRUN';
+exports[1120] = 'ER_WRONG_OUTER_JOIN';
+exports[1121] = 'ER_NULL_COLUMN_IN_INDEX';
+exports[1122] = 'ER_CANT_FIND_UDF';
+exports[1123] = 'ER_CANT_INITIALIZE_UDF';
+exports[1124] = 'ER_UDF_NO_PATHS';
+exports[1125] = 'ER_UDF_EXISTS';
+exports[1126] = 'ER_CANT_OPEN_LIBRARY';
+exports[1127] = 'ER_CANT_FIND_DL_ENTRY';
+exports[1128] = 'ER_FUNCTION_NOT_DEFINED';
+exports[1129] = 'ER_HOST_IS_BLOCKED';
+exports[1130] = 'ER_HOST_NOT_PRIVILEGED';
+exports[1131] = 'ER_PASSWORD_ANONYMOUS_USER';
+exports[1132] = 'ER_PASSWORD_NOT_ALLOWED';
+exports[1133] = 'ER_PASSWORD_NO_MATCH';
+exports[1134] = 'ER_UPDATE_INFO';
+exports[1135] = 'ER_CANT_CREATE_THREAD';
+exports[1136] = 'ER_WRONG_VALUE_COUNT_ON_ROW';
+exports[1137] = 'ER_CANT_REOPEN_TABLE';
+exports[1138] = 'ER_INVALID_USE_OF_NULL';
+exports[1139] = 'ER_REGEXP_ERROR';
+exports[1140] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS';
+exports[1141] = 'ER_NONEXISTING_GRANT';
+exports[1142] = 'ER_TABLEACCESS_DENIED_ERROR';
+exports[1143] = 'ER_COLUMNACCESS_DENIED_ERROR';
+exports[1144] = 'ER_ILLEGAL_GRANT_FOR_TABLE';
+exports[1145] = 'ER_GRANT_WRONG_HOST_OR_USER';
+exports[1146] = 'ER_NO_SUCH_TABLE';
+exports[1147] = 'ER_NONEXISTING_TABLE_GRANT';
+exports[1148] = 'ER_NOT_ALLOWED_COMMAND';
+exports[1149] = 'ER_SYNTAX_ERROR';
+exports[1150] = 'ER_DELAYED_CANT_CHANGE_LOCK';
+exports[1151] = 'ER_TOO_MANY_DELAYED_THREADS';
+exports[1152] = 'ER_ABORTING_CONNECTION';
+exports[1153] = 'ER_NET_PACKET_TOO_LARGE';
+exports[1154] = 'ER_NET_READ_ERROR_FROM_PIPE';
+exports[1155] = 'ER_NET_FCNTL_ERROR';
+exports[1156] = 'ER_NET_PACKETS_OUT_OF_ORDER';
+exports[1157] = 'ER_NET_UNCOMPRESS_ERROR';
+exports[1158] = 'ER_NET_READ_ERROR';
+exports[1159] = 'ER_NET_READ_INTERRUPTED';
+exports[1160] = 'ER_NET_ERROR_ON_WRITE';
+exports[1161] = 'ER_NET_WRITE_INTERRUPTED';
+exports[1162] = 'ER_TOO_LONG_STRING';
+exports[1163] = 'ER_TABLE_CANT_HANDLE_BLOB';
+exports[1164] = 'ER_TABLE_CANT_HANDLE_AUTO_INCREMENT';
+exports[1165] = 'ER_DELAYED_INSERT_TABLE_LOCKED';
+exports[1166] = 'ER_WRONG_COLUMN_NAME';
+exports[1167] = 'ER_WRONG_KEY_COLUMN';
+exports[1168] = 'ER_WRONG_MRG_TABLE';
+exports[1169] = 'ER_DUP_UNIQUE';
+exports[1170] = 'ER_BLOB_KEY_WITHOUT_LENGTH';
+exports[1171] = 'ER_PRIMARY_CANT_HAVE_NULL';
+exports[1172] = 'ER_TOO_MANY_ROWS';
+exports[1173] = 'ER_REQUIRES_PRIMARY_KEY';
+exports[1174] = 'ER_NO_RAID_COMPILED';
+exports[1175] = 'ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE';
+exports[1176] = 'ER_KEY_DOES_NOT_EXITS';
+exports[1177] = 'ER_CHECK_NO_SUCH_TABLE';
+exports[1178] = 'ER_CHECK_NOT_IMPLEMENTED';
+exports[1179] = 'ER_CANT_DO_THIS_DURING_AN_TRANSACTION';
+exports[1180] = 'ER_ERROR_DURING_COMMIT';
+exports[1181] = 'ER_ERROR_DURING_ROLLBACK';
+exports[1182] = 'ER_ERROR_DURING_FLUSH_LOGS';
+exports[1183] = 'ER_ERROR_DURING_CHECKPOINT';
+exports[1184] = 'ER_NEW_ABORTING_CONNECTION';
+exports[1185] = 'ER_DUMP_NOT_IMPLEMENTED';
+exports[1186] = 'ER_FLUSH_MASTER_BINLOG_CLOSED';
+exports[1187] = 'ER_INDEX_REBUILD';
+exports[1188] = 'ER_MASTER';
+exports[1189] = 'ER_MASTER_NET_READ';
+exports[1190] = 'ER_MASTER_NET_WRITE';
+exports[1191] = 'ER_FT_MATCHING_KEY_NOT_FOUND';
+exports[1192] = 'ER_LOCK_OR_ACTIVE_TRANSACTION';
+exports[1193] = 'ER_UNKNOWN_SYSTEM_VARIABLE';
+exports[1194] = 'ER_CRASHED_ON_USAGE';
+exports[1195] = 'ER_CRASHED_ON_REPAIR';
+exports[1196] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK';
+exports[1197] = 'ER_TRANS_CACHE_FULL';
+exports[1198] = 'ER_SLAVE_MUST_STOP';
+exports[1199] = 'ER_SLAVE_NOT_RUNNING';
+exports[1200] = 'ER_BAD_SLAVE';
+exports[1201] = 'ER_MASTER_INFO';
+exports[1202] = 'ER_SLAVE_THREAD';
+exports[1203] = 'ER_TOO_MANY_USER_CONNECTIONS';
+exports[1204] = 'ER_SET_CONSTANTS_ONLY';
+exports[1205] = 'ER_LOCK_WAIT_TIMEOUT';
+exports[1206] = 'ER_LOCK_TABLE_FULL';
+exports[1207] = 'ER_READ_ONLY_TRANSACTION';
+exports[1208] = 'ER_DROP_DB_WITH_READ_LOCK';
+exports[1209] = 'ER_CREATE_DB_WITH_READ_LOCK';
+exports[1210] = 'ER_WRONG_ARGUMENTS';
+exports[1211] = 'ER_NO_PERMISSION_TO_CREATE_USER';
+exports[1212] = 'ER_UNION_TABLES_IN_DIFFERENT_DIR';
+exports[1213] = 'ER_LOCK_DEADLOCK';
+exports[1214] = 'ER_TABLE_CANT_HANDLE_FT';
+exports[1215] = 'ER_CANNOT_ADD_FOREIGN';
+exports[1216] = 'ER_NO_REFERENCED_ROW';
+exports[1217] = 'ER_ROW_IS_REFERENCED';
+exports[1218] = 'ER_CONNECT_TO_MASTER';
+exports[1219] = 'ER_QUERY_ON_MASTER';
+exports[1220] = 'ER_ERROR_WHEN_EXECUTING_COMMAND';
+exports[1221] = 'ER_WRONG_USAGE';
+exports[1222] = 'ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT';
+exports[1223] = 'ER_CANT_UPDATE_WITH_READLOCK';
+exports[1224] = 'ER_MIXING_NOT_ALLOWED';
+exports[1225] = 'ER_DUP_ARGUMENT';
+exports[1226] = 'ER_USER_LIMIT_REACHED';
+exports[1227] = 'ER_SPECIFIC_ACCESS_DENIED_ERROR';
+exports[1228] = 'ER_LOCAL_VARIABLE';
+exports[1229] = 'ER_GLOBAL_VARIABLE';
+exports[1230] = 'ER_NO_DEFAULT';
+exports[1231] = 'ER_WRONG_VALUE_FOR_VAR';
+exports[1232] = 'ER_WRONG_TYPE_FOR_VAR';
+exports[1233] = 'ER_VAR_CANT_BE_READ';
+exports[1234] = 'ER_CANT_USE_OPTION_HERE';
+exports[1235] = 'ER_NOT_SUPPORTED_YET';
+exports[1236] = 'ER_MASTER_FATAL_ERROR_READING_BINLOG';
+exports[1237] = 'ER_SLAVE_IGNORED_TABLE';
+exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR';
+exports[1239] = 'ER_WRONG_FK_DEF';
+exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF';
+exports[1241] = 'ER_OPERAND_COLUMNS';
+exports[1242] = 'ER_SUBQUERY_NO_1_ROW';
+exports[1243] = 'ER_UNKNOWN_STMT_HANDLER';
+exports[1244] = 'ER_CORRUPT_HELP_DB';
+exports[1245] = 'ER_CYCLIC_REFERENCE';
+exports[1246] = 'ER_AUTO_CONVERT';
+exports[1247] = 'ER_ILLEGAL_REFERENCE';
+exports[1248] = 'ER_DERIVED_MUST_HAVE_ALIAS';
+exports[1249] = 'ER_SELECT_REDUCED';
+exports[1250] = 'ER_TABLENAME_NOT_ALLOWED_HERE';
+exports[1251] = 'ER_NOT_SUPPORTED_AUTH_MODE';
+exports[1252] = 'ER_SPATIAL_CANT_HAVE_NULL';
+exports[1253] = 'ER_COLLATION_CHARSET_MISMATCH';
+exports[1254] = 'ER_SLAVE_WAS_RUNNING';
+exports[1255] = 'ER_SLAVE_WAS_NOT_RUNNING';
+exports[1256] = 'ER_TOO_BIG_FOR_UNCOMPRESS';
+exports[1257] = 'ER_ZLIB_Z_MEM_ERROR';
+exports[1258] = 'ER_ZLIB_Z_BUF_ERROR';
+exports[1259] = 'ER_ZLIB_Z_DATA_ERROR';
+exports[1260] = 'ER_CUT_VALUE_GROUP_CONCAT';
+exports[1261] = 'ER_WARN_TOO_FEW_RECORDS';
+exports[1262] = 'ER_WARN_TOO_MANY_RECORDS';
+exports[1263] = 'ER_WARN_NULL_TO_NOTNULL';
+exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE';
+exports[1265] = 'WARN_DATA_TRUNCATED';
+exports[1266] = 'ER_WARN_USING_OTHER_HANDLER';
+exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS';
+exports[1268] = 'ER_DROP_USER';
+exports[1269] = 'ER_REVOKE_GRANTS';
+exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS';
+exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS';
+exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT';
+exports[1273] = 'ER_UNKNOWN_COLLATION';
+exports[1274] = 'ER_SLAVE_IGNORED_SSL_PARAMS';
+exports[1275] = 'ER_SERVER_IS_IN_SECURE_AUTH_MODE';
+exports[1276] = 'ER_WARN_FIELD_RESOLVED';
+exports[1277] = 'ER_BAD_SLAVE_UNTIL_COND';
+exports[1278] = 'ER_MISSING_SKIP_SLAVE';
+exports[1279] = 'ER_UNTIL_COND_IGNORED';
+exports[1280] = 'ER_WRONG_NAME_FOR_INDEX';
+exports[1281] = 'ER_WRONG_NAME_FOR_CATALOG';
+exports[1282] = 'ER_WARN_QC_RESIZE';
+exports[1283] = 'ER_BAD_FT_COLUMN';
+exports[1284] = 'ER_UNKNOWN_KEY_CACHE';
+exports[1285] = 'ER_WARN_HOSTNAME_WONT_WORK';
+exports[1286] = 'ER_UNKNOWN_STORAGE_ENGINE';
+exports[1287] = 'ER_WARN_DEPRECATED_SYNTAX';
+exports[1288] = 'ER_NON_UPDATABLE_TABLE';
+exports[1289] = 'ER_FEATURE_DISABLED';
+exports[1290] = 'ER_OPTION_PREVENTS_STATEMENT';
+exports[1291] = 'ER_DUPLICATED_VALUE_IN_TYPE';
+exports[1292] = 'ER_TRUNCATED_WRONG_VALUE';
+exports[1293] = 'ER_TOO_MUCH_AUTO_TIMESTAMP_COLS';
+exports[1294] = 'ER_INVALID_ON_UPDATE';
+exports[1295] = 'ER_UNSUPPORTED_PS';
+exports[1296] = 'ER_GET_ERRMSG';
+exports[1297] = 'ER_GET_TEMPORARY_ERRMSG';
+exports[1298] = 'ER_UNKNOWN_TIME_ZONE';
+exports[1299] = 'ER_WARN_INVALID_TIMESTAMP';
+exports[1300] = 'ER_INVALID_CHARACTER_STRING';
+exports[1301] = 'ER_WARN_ALLOWED_PACKET_OVERFLOWED';
+exports[1302] = 'ER_CONFLICTING_DECLARATIONS';
+exports[1303] = 'ER_SP_NO_RECURSIVE_CREATE';
+exports[1304] = 'ER_SP_ALREADY_EXISTS';
+exports[1305] = 'ER_SP_DOES_NOT_EXIST';
+exports[1306] = 'ER_SP_DROP_FAILED';
+exports[1307] = 'ER_SP_STORE_FAILED';
+exports[1308] = 'ER_SP_LILABEL_MISMATCH';
+exports[1309] = 'ER_SP_LABEL_REDEFINE';
+exports[1310] = 'ER_SP_LABEL_MISMATCH';
+exports[1311] = 'ER_SP_UNINIT_VAR';
+exports[1312] = 'ER_SP_BADSELECT';
+exports[1313] = 'ER_SP_BADRETURN';
+exports[1314] = 'ER_SP_BADSTATEMENT';
+exports[1315] = 'ER_UPDATE_LOG_DEPRECATED_IGNORED';
+exports[1316] = 'ER_UPDATE_LOG_DEPRECATED_TRANSLATED';
+exports[1317] = 'ER_QUERY_INTERRUPTED';
+exports[1318] = 'ER_SP_WRONG_NO_OF_ARGS';
+exports[1319] = 'ER_SP_COND_MISMATCH';
+exports[1320] = 'ER_SP_NORETURN';
+exports[1321] = 'ER_SP_NORETURNEND';
+exports[1322] = 'ER_SP_BAD_CURSOR_QUERY';
+exports[1323] = 'ER_SP_BAD_CURSOR_SELECT';
+exports[1324] = 'ER_SP_CURSOR_MISMATCH';
+exports[1325] = 'ER_SP_CURSOR_ALREADY_OPEN';
+exports[1326] = 'ER_SP_CURSOR_NOT_OPEN';
+exports[1327] = 'ER_SP_UNDECLARED_VAR';
+exports[1328] = 'ER_SP_WRONG_NO_OF_FETCH_ARGS';
+exports[1329] = 'ER_SP_FETCH_NO_DATA';
+exports[1330] = 'ER_SP_DUP_PARAM';
+exports[1331] = 'ER_SP_DUP_VAR';
+exports[1332] = 'ER_SP_DUP_COND';
+exports[1333] = 'ER_SP_DUP_CURS';
+exports[1334] = 'ER_SP_CANT_ALTER';
+exports[1335] = 'ER_SP_SUBSELECT_NYI';
+exports[1336] = 'ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG';
+exports[1337] = 'ER_SP_VARCOND_AFTER_CURSHNDLR';
+exports[1338] = 'ER_SP_CURSOR_AFTER_HANDLER';
+exports[1339] = 'ER_SP_CASE_NOT_FOUND';
+exports[1340] = 'ER_FPARSER_TOO_BIG_FILE';
+exports[1341] = 'ER_FPARSER_BAD_HEADER';
+exports[1342] = 'ER_FPARSER_EOF_IN_COMMENT';
+exports[1343] = 'ER_FPARSER_ERROR_IN_PARAMETER';
+exports[1344] = 'ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER';
+exports[1345] = 'ER_VIEW_NO_EXPLAIN';
+exports[1346] = 'ER_FRM_UNKNOWN_TYPE';
+exports[1347] = 'ER_WRONG_OBJECT';
+exports[1348] = 'ER_NONUPDATEABLE_COLUMN';
+exports[1349] = 'ER_VIEW_SELECT_DERIVED';
+exports[1350] = 'ER_VIEW_SELECT_CLAUSE';
+exports[1351] = 'ER_VIEW_SELECT_VARIABLE';
+exports[1352] = 'ER_VIEW_SELECT_TMPTABLE';
+exports[1353] = 'ER_VIEW_WRONG_LIST';
+exports[1354] = 'ER_WARN_VIEW_MERGE';
+exports[1355] = 'ER_WARN_VIEW_WITHOUT_KEY';
+exports[1356] = 'ER_VIEW_INVALID';
+exports[1357] = 'ER_SP_NO_DROP_SP';
+exports[1358] = 'ER_SP_GOTO_IN_HNDLR';
+exports[1359] = 'ER_TRG_ALREADY_EXISTS';
+exports[1360] = 'ER_TRG_DOES_NOT_EXIST';
+exports[1361] = 'ER_TRG_ON_VIEW_OR_TEMP_TABLE';
+exports[1362] = 'ER_TRG_CANT_CHANGE_ROW';
+exports[1363] = 'ER_TRG_NO_SUCH_ROW_IN_TRG';
+exports[1364] = 'ER_NO_DEFAULT_FOR_FIELD';
+exports[1365] = 'ER_DIVISION_BY_ZERO';
+exports[1366] = 'ER_TRUNCATED_WRONG_VALUE_FOR_FIELD';
+exports[1367] = 'ER_ILLEGAL_VALUE_FOR_TYPE';
+exports[1368] = 'ER_VIEW_NONUPD_CHECK';
+exports[1369] = 'ER_VIEW_CHECK_FAILED';
+exports[1370] = 'ER_PROCACCESS_DENIED_ERROR';
+exports[1371] = 'ER_RELAY_LOG_FAIL';
+exports[1372] = 'ER_PASSWD_LENGTH';
+exports[1373] = 'ER_UNKNOWN_TARGET_BINLOG';
+exports[1374] = 'ER_IO_ERR_LOG_INDEX_READ';
+exports[1375] = 'ER_BINLOG_PURGE_PROHIBITED';
+exports[1376] = 'ER_FSEEK_FAIL';
+exports[1377] = 'ER_BINLOG_PURGE_FATAL_ERR';
+exports[1378] = 'ER_LOG_IN_USE';
+exports[1379] = 'ER_LOG_PURGE_UNKNOWN_ERR';
+exports[1380] = 'ER_RELAY_LOG_INIT';
+exports[1381] = 'ER_NO_BINARY_LOGGING';
+exports[1382] = 'ER_RESERVED_SYNTAX';
+exports[1383] = 'ER_WSAS_FAILED';
+exports[1384] = 'ER_DIFF_GROUPS_PROC';
+exports[1385] = 'ER_NO_GROUP_FOR_PROC';
+exports[1386] = 'ER_ORDER_WITH_PROC';
+exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF';
+exports[1388] = 'ER_NO_FILE_MAPPING';
+exports[1389] = 'ER_WRONG_MAGIC';
+exports[1390] = 'ER_PS_MANY_PARAM';
+exports[1391] = 'ER_KEY_PART_0';
+exports[1392] = 'ER_VIEW_CHECKSUM';
+exports[1393] = 'ER_VIEW_MULTIUPDATE';
+exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST';
+exports[1395] = 'ER_VIEW_DELETE_MERGE_VIEW';
+exports[1396] = 'ER_CANNOT_USER';
+exports[1397] = 'ER_XAER_NOTA';
+exports[1398] = 'ER_XAER_INVAL';
+exports[1399] = 'ER_XAER_RMFAIL';
+exports[1400] = 'ER_XAER_OUTSIDE';
+exports[1401] = 'ER_XAER_RMERR';
+exports[1402] = 'ER_XA_RBROLLBACK';
+exports[1403] = 'ER_NONEXISTING_PROC_GRANT';
+exports[1404] = 'ER_PROC_AUTO_GRANT_FAIL';
+exports[1405] = 'ER_PROC_AUTO_REVOKE_FAIL';
+exports[1406] = 'ER_DATA_TOO_LONG';
+exports[1407] = 'ER_SP_BAD_SQLSTATE';
+exports[1408] = 'ER_STARTUP';
+exports[1409] = 'ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR';
+exports[1410] = 'ER_CANT_CREATE_USER_WITH_GRANT';
+exports[1411] = 'ER_WRONG_VALUE_FOR_TYPE';
+exports[1412] = 'ER_TABLE_DEF_CHANGED';
+exports[1413] = 'ER_SP_DUP_HANDLER';
+exports[1414] = 'ER_SP_NOT_VAR_ARG';
+exports[1415] = 'ER_SP_NO_RETSET';
+exports[1416] = 'ER_CANT_CREATE_GEOMETRY_OBJECT';
+exports[1417] = 'ER_FAILED_ROUTINE_BREAK_BINLOG';
+exports[1418] = 'ER_BINLOG_UNSAFE_ROUTINE';
+exports[1419] = 'ER_BINLOG_CREATE_ROUTINE_NEED_SUPER';
+exports[1420] = 'ER_EXEC_STMT_WITH_OPEN_CURSOR';
+exports[1421] = 'ER_STMT_HAS_NO_OPEN_CURSOR';
+exports[1422] = 'ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG';
+exports[1423] = 'ER_NO_DEFAULT_FOR_VIEW_FIELD';
+exports[1424] = 'ER_SP_NO_RECURSION';
+exports[1425] = 'ER_TOO_BIG_SCALE';
+exports[1426] = 'ER_TOO_BIG_PRECISION';
+exports[1427] = 'ER_M_BIGGER_THAN_D';
+exports[1428] = 'ER_WRONG_LOCK_OF_SYSTEM_TABLE';
+exports[1429] = 'ER_CONNECT_TO_FOREIGN_DATA_SOURCE';
+exports[1430] = 'ER_QUERY_ON_FOREIGN_DATA_SOURCE';
+exports[1431] = 'ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST';
+exports[1432] = 'ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE';
+exports[1433] = 'ER_FOREIGN_DATA_STRING_INVALID';
+exports[1434] = 'ER_CANT_CREATE_FEDERATED_TABLE';
+exports[1435] = 'ER_TRG_IN_WRONG_SCHEMA';
+exports[1436] = 'ER_STACK_OVERRUN_NEED_MORE';
+exports[1437] = 'ER_TOO_LONG_BODY';
+exports[1438] = 'ER_WARN_CANT_DROP_DEFAULT_KEYCACHE';
+exports[1439] = 'ER_TOO_BIG_DISPLAYWIDTH';
+exports[1440] = 'ER_XAER_DUPID';
+exports[1441] = 'ER_DATETIME_FUNCTION_OVERFLOW';
+exports[1442] = 'ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG';
+exports[1443] = 'ER_VIEW_PREVENT_UPDATE';
+exports[1444] = 'ER_PS_NO_RECURSION';
+exports[1445] = 'ER_SP_CANT_SET_AUTOCOMMIT';
+exports[1446] = 'ER_MALFORMED_DEFINER';
+exports[1447] = 'ER_VIEW_FRM_NO_USER';
+exports[1448] = 'ER_VIEW_OTHER_USER';
+exports[1449] = 'ER_NO_SUCH_USER';
+exports[1450] = 'ER_FORBID_SCHEMA_CHANGE';
+exports[1451] = 'ER_ROW_IS_REFERENCED_2';
+exports[1452] = 'ER_NO_REFERENCED_ROW_2';
+exports[1453] = 'ER_SP_BAD_VAR_SHADOW';
+exports[1454] = 'ER_TRG_NO_DEFINER';
+exports[1455] = 'ER_OLD_FILE_FORMAT';
+exports[1456] = 'ER_SP_RECURSION_LIMIT';
+exports[1457] = 'ER_SP_PROC_TABLE_CORRUPT';
+exports[1458] = 'ER_SP_WRONG_NAME';
+exports[1459] = 'ER_TABLE_NEEDS_UPGRADE';
+exports[1460] = 'ER_SP_NO_AGGREGATE';
+exports[1461] = 'ER_MAX_PREPARED_STMT_COUNT_REACHED';
+exports[1462] = 'ER_VIEW_RECURSIVE';
+exports[1463] = 'ER_NON_GROUPING_FIELD_USED';
+exports[1464] = 'ER_TABLE_CANT_HANDLE_SPKEYS';
+exports[1465] = 'ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA';
+exports[1466] = 'ER_REMOVED_SPACES';
+exports[1467] = 'ER_AUTOINC_READ_FAILED';
+exports[1468] = 'ER_USERNAME';
+exports[1469] = 'ER_HOSTNAME';
+exports[1470] = 'ER_WRONG_STRING_LENGTH';
+exports[1471] = 'ER_NON_INSERTABLE_TABLE';
+exports[1472] = 'ER_ADMIN_WRONG_MRG_TABLE';
+exports[1473] = 'ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT';
+exports[1474] = 'ER_NAME_BECOMES_EMPTY';
+exports[1475] = 'ER_AMBIGUOUS_FIELD_TERM';
+exports[1476] = 'ER_FOREIGN_SERVER_EXISTS';
+exports[1477] = 'ER_FOREIGN_SERVER_DOESNT_EXIST';
+exports[1478] = 'ER_ILLEGAL_HA_CREATE_OPTION';
+exports[1479] = 'ER_PARTITION_REQUIRES_VALUES_ERROR';
+exports[1480] = 'ER_PARTITION_WRONG_VALUES_ERROR';
+exports[1481] = 'ER_PARTITION_MAXVALUE_ERROR';
+exports[1482] = 'ER_PARTITION_SUBPARTITION_ERROR';
+exports[1483] = 'ER_PARTITION_SUBPART_MIX_ERROR';
+exports[1484] = 'ER_PARTITION_WRONG_NO_PART_ERROR';
+exports[1485] = 'ER_PARTITION_WRONG_NO_SUBPART_ERROR';
+exports[1486] = 'ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR';
+exports[1487] = 'ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR';
+exports[1488] = 'ER_FIELD_NOT_FOUND_PART_ERROR';
+exports[1489] = 'ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR';
+exports[1490] = 'ER_INCONSISTENT_PARTITION_INFO_ERROR';
+exports[1491] = 'ER_PARTITION_FUNC_NOT_ALLOWED_ERROR';
+exports[1492] = 'ER_PARTITIONS_MUST_BE_DEFINED_ERROR';
+exports[1493] = 'ER_RANGE_NOT_INCREASING_ERROR';
+exports[1494] = 'ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR';
+exports[1495] = 'ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR';
+exports[1496] = 'ER_PARTITION_ENTRY_ERROR';
+exports[1497] = 'ER_MIX_HANDLER_ERROR';
+exports[1498] = 'ER_PARTITION_NOT_DEFINED_ERROR';
+exports[1499] = 'ER_TOO_MANY_PARTITIONS_ERROR';
+exports[1500] = 'ER_SUBPARTITION_ERROR';
+exports[1501] = 'ER_CANT_CREATE_HANDLER_FILE';
+exports[1502] = 'ER_BLOB_FIELD_IN_PART_FUNC_ERROR';
+exports[1503] = 'ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF';
+exports[1504] = 'ER_NO_PARTS_ERROR';
+exports[1505] = 'ER_PARTITION_MGMT_ON_NONPARTITIONED';
+exports[1506] = 'ER_FOREIGN_KEY_ON_PARTITIONED';
+exports[1507] = 'ER_DROP_PARTITION_NON_EXISTENT';
+exports[1508] = 'ER_DROP_LAST_PARTITION';
+exports[1509] = 'ER_COALESCE_ONLY_ON_HASH_PARTITION';
+exports[1510] = 'ER_REORG_HASH_ONLY_ON_SAME_NO';
+exports[1511] = 'ER_REORG_NO_PARAM_ERROR';
+exports[1512] = 'ER_ONLY_ON_RANGE_LIST_PARTITION';
+exports[1513] = 'ER_ADD_PARTITION_SUBPART_ERROR';
+exports[1514] = 'ER_ADD_PARTITION_NO_NEW_PARTITION';
+exports[1515] = 'ER_COALESCE_PARTITION_NO_PARTITION';
+exports[1516] = 'ER_REORG_PARTITION_NOT_EXIST';
+exports[1517] = 'ER_SAME_NAME_PARTITION';
+exports[1518] = 'ER_NO_BINLOG_ERROR';
+exports[1519] = 'ER_CONSECUTIVE_REORG_PARTITIONS';
+exports[1520] = 'ER_REORG_OUTSIDE_RANGE';
+exports[1521] = 'ER_PARTITION_FUNCTION_FAILURE';
+exports[1522] = 'ER_PART_STATE_ERROR';
+exports[1523] = 'ER_LIMITED_PART_RANGE';
+exports[1524] = 'ER_PLUGIN_IS_NOT_LOADED';
+exports[1525] = 'ER_WRONG_VALUE';
+exports[1526] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE';
+exports[1527] = 'ER_FILEGROUP_OPTION_ONLY_ONCE';
+exports[1528] = 'ER_CREATE_FILEGROUP_FAILED';
+exports[1529] = 'ER_DROP_FILEGROUP_FAILED';
+exports[1530] = 'ER_TABLESPACE_AUTO_EXTEND_ERROR';
+exports[1531] = 'ER_WRONG_SIZE_NUMBER';
+exports[1532] = 'ER_SIZE_OVERFLOW_ERROR';
+exports[1533] = 'ER_ALTER_FILEGROUP_FAILED';
+exports[1534] = 'ER_BINLOG_ROW_LOGGING_FAILED';
+exports[1535] = 'ER_BINLOG_ROW_WRONG_TABLE_DEF';
+exports[1536] = 'ER_BINLOG_ROW_RBR_TO_SBR';
+exports[1537] = 'ER_EVENT_ALREADY_EXISTS';
+exports[1538] = 'ER_EVENT_STORE_FAILED';
+exports[1539] = 'ER_EVENT_DOES_NOT_EXIST';
+exports[1540] = 'ER_EVENT_CANT_ALTER';
+exports[1541] = 'ER_EVENT_DROP_FAILED';
+exports[1542] = 'ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG';
+exports[1543] = 'ER_EVENT_ENDS_BEFORE_STARTS';
+exports[1544] = 'ER_EVENT_EXEC_TIME_IN_THE_PAST';
+exports[1545] = 'ER_EVENT_OPEN_TABLE_FAILED';
+exports[1546] = 'ER_EVENT_NEITHER_M_EXPR_NOR_M_AT';
+exports[1547] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED';
+exports[1548] = 'ER_CANNOT_LOAD_FROM_TABLE';
+exports[1549] = 'ER_EVENT_CANNOT_DELETE';
+exports[1550] = 'ER_EVENT_COMPILE_ERROR';
+exports[1551] = 'ER_EVENT_SAME_NAME';
+exports[1552] = 'ER_EVENT_DATA_TOO_LONG';
+exports[1553] = 'ER_DROP_INDEX_FK';
+exports[1554] = 'ER_WARN_DEPRECATED_SYNTAX_WITH_VER';
+exports[1555] = 'ER_CANT_WRITE_LOCK_LOG_TABLE';
+exports[1556] = 'ER_CANT_LOCK_LOG_TABLE';
+exports[1557] = 'ER_FOREIGN_DUPLICATE_KEY';
+exports[1558] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE';
+exports[1559] = 'ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR';
+exports[1560] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT';
+exports[1561] = 'ER_NDB_CANT_SWITCH_BINLOG_FORMAT';
+exports[1562] = 'ER_PARTITION_NO_TEMPORARY';
+exports[1563] = 'ER_PARTITION_CONST_DOMAIN_ERROR';
+exports[1564] = 'ER_PARTITION_FUNCTION_IS_NOT_ALLOWED';
+exports[1565] = 'ER_DDL_LOG_ERROR';
+exports[1566] = 'ER_NULL_IN_VALUES_LESS_THAN';
+exports[1567] = 'ER_WRONG_PARTITION_NAME';
+exports[1568] = 'ER_CANT_CHANGE_TX_CHARACTERISTICS';
+exports[1569] = 'ER_DUP_ENTRY_AUTOINCREMENT_CASE';
+exports[1570] = 'ER_EVENT_MODIFY_QUEUE_ERROR';
+exports[1571] = 'ER_EVENT_SET_VAR_ERROR';
+exports[1572] = 'ER_PARTITION_MERGE_ERROR';
+exports[1573] = 'ER_CANT_ACTIVATE_LOG';
+exports[1574] = 'ER_RBR_NOT_AVAILABLE';
+exports[1575] = 'ER_BASE64_DECODE_ERROR';
+exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN';
+exports[1577] = 'ER_EVENTS_DB_ERROR';
+exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED';
+exports[1579] = 'ER_UNSUPORTED_LOG_ENGINE';
+exports[1580] = 'ER_BAD_LOG_STATEMENT';
+exports[1581] = 'ER_CANT_RENAME_LOG_TABLE';
+exports[1582] = 'ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT';
+exports[1583] = 'ER_WRONG_PARAMETERS_TO_NATIVE_FCT';
+exports[1584] = 'ER_WRONG_PARAMETERS_TO_STORED_FCT';
+exports[1585] = 'ER_NATIVE_FCT_NAME_COLLISION';
+exports[1586] = 'ER_DUP_ENTRY_WITH_KEY_NAME';
+exports[1587] = 'ER_BINLOG_PURGE_EMFILE';
+exports[1588] = 'ER_EVENT_CANNOT_CREATE_IN_THE_PAST';
+exports[1589] = 'ER_EVENT_CANNOT_ALTER_IN_THE_PAST';
+exports[1590] = 'ER_SLAVE_INCIDENT';
+exports[1591] = 'ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT';
+exports[1592] = 'ER_BINLOG_UNSAFE_STATEMENT';
+exports[1593] = 'ER_SLAVE_FATAL_ERROR';
+exports[1594] = 'ER_SLAVE_RELAY_LOG_READ_FAILURE';
+exports[1595] = 'ER_SLAVE_RELAY_LOG_WRITE_FAILURE';
+exports[1596] = 'ER_SLAVE_CREATE_EVENT_FAILURE';
+exports[1597] = 'ER_SLAVE_MASTER_COM_FAILURE';
+exports[1598] = 'ER_BINLOG_LOGGING_IMPOSSIBLE';
+exports[1599] = 'ER_VIEW_NO_CREATION_CTX';
+exports[1600] = 'ER_VIEW_INVALID_CREATION_CTX';
+exports[1601] = 'ER_SR_INVALID_CREATION_CTX';
+exports[1602] = 'ER_TRG_CORRUPTED_FILE';
+exports[1603] = 'ER_TRG_NO_CREATION_CTX';
+exports[1604] = 'ER_TRG_INVALID_CREATION_CTX';
+exports[1605] = 'ER_EVENT_INVALID_CREATION_CTX';
+exports[1606] = 'ER_TRG_CANT_OPEN_TABLE';
+exports[1607] = 'ER_CANT_CREATE_SROUTINE';
+exports[1608] = 'ER_NEVER_USED';
+exports[1609] = 'ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT';
+exports[1610] = 'ER_SLAVE_CORRUPT_EVENT';
+exports[1611] = 'ER_LOAD_DATA_INVALID_COLUMN';
+exports[1612] = 'ER_LOG_PURGE_NO_FILE';
+exports[1613] = 'ER_XA_RBTIMEOUT';
+exports[1614] = 'ER_XA_RBDEADLOCK';
+exports[1615] = 'ER_NEED_REPREPARE';
+exports[1616] = 'ER_DELAYED_NOT_SUPPORTED';
+exports[1617] = 'WARN_NO_MASTER_INFO';
+exports[1618] = 'WARN_OPTION_IGNORED';
+exports[1619] = 'ER_PLUGIN_DELETE_BUILTIN';
+exports[1620] = 'WARN_PLUGIN_BUSY';
+exports[1621] = 'ER_VARIABLE_IS_READONLY';
+exports[1622] = 'ER_WARN_ENGINE_TRANSACTION_ROLLBACK';
+exports[1623] = 'ER_SLAVE_HEARTBEAT_FAILURE';
+exports[1624] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE';
+exports[1625] = 'ER_NDB_REPLICATION_SCHEMA_ERROR';
+exports[1626] = 'ER_CONFLICT_FN_PARSE_ERROR';
+exports[1627] = 'ER_EXCEPTIONS_WRITE_ERROR';
+exports[1628] = 'ER_TOO_LONG_TABLE_COMMENT';
+exports[1629] = 'ER_TOO_LONG_FIELD_COMMENT';
+exports[1630] = 'ER_FUNC_INEXISTENT_NAME_COLLISION';
+exports[1631] = 'ER_DATABASE_NAME';
+exports[1632] = 'ER_TABLE_NAME';
+exports[1633] = 'ER_PARTITION_NAME';
+exports[1634] = 'ER_SUBPARTITION_NAME';
+exports[1635] = 'ER_TEMPORARY_NAME';
+exports[1636] = 'ER_RENAMED_NAME';
+exports[1637] = 'ER_TOO_MANY_CONCURRENT_TRXS';
+exports[1638] = 'WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED';
+exports[1639] = 'ER_DEBUG_SYNC_TIMEOUT';
+exports[1640] = 'ER_DEBUG_SYNC_HIT_LIMIT';
+exports[1641] = 'ER_DUP_SIGNAL_SET';
+exports[1642] = 'ER_SIGNAL_WARN';
+exports[1643] = 'ER_SIGNAL_NOT_FOUND';
+exports[1644] = 'ER_SIGNAL_EXCEPTION';
+exports[1645] = 'ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER';
+exports[1646] = 'ER_SIGNAL_BAD_CONDITION_TYPE';
+exports[1647] = 'WARN_COND_ITEM_TRUNCATED';
+exports[1648] = 'ER_COND_ITEM_TOO_LONG';
+exports[1649] = 'ER_UNKNOWN_LOCALE';
+exports[1650] = 'ER_SLAVE_IGNORE_SERVER_IDS';
+exports[1651] = 'ER_QUERY_CACHE_DISABLED';
+exports[1652] = 'ER_SAME_NAME_PARTITION_FIELD';
+exports[1653] = 'ER_PARTITION_COLUMN_LIST_ERROR';
+exports[1654] = 'ER_WRONG_TYPE_COLUMN_VALUE_ERROR';
+exports[1655] = 'ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR';
+exports[1656] = 'ER_MAXVALUE_IN_VALUES_IN';
+exports[1657] = 'ER_TOO_MANY_VALUES_ERROR';
+exports[1658] = 'ER_ROW_SINGLE_PARTITION_FIELD_ERROR';
+exports[1659] = 'ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD';
+exports[1660] = 'ER_PARTITION_FIELDS_TOO_LONG';
+exports[1661] = 'ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE';
+exports[1662] = 'ER_BINLOG_ROW_MODE_AND_STMT_ENGINE';
+exports[1663] = 'ER_BINLOG_UNSAFE_AND_STMT_ENGINE';
+exports[1664] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE';
+exports[1665] = 'ER_BINLOG_STMT_MODE_AND_ROW_ENGINE';
+exports[1666] = 'ER_BINLOG_ROW_INJECTION_AND_STMT_MODE';
+exports[1667] = 'ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
+exports[1668] = 'ER_BINLOG_UNSAFE_LIMIT';
+exports[1669] = 'ER_BINLOG_UNSAFE_INSERT_DELAYED';
+exports[1670] = 'ER_BINLOG_UNSAFE_SYSTEM_TABLE';
+exports[1671] = 'ER_BINLOG_UNSAFE_AUTOINC_COLUMNS';
+exports[1672] = 'ER_BINLOG_UNSAFE_UDF';
+exports[1673] = 'ER_BINLOG_UNSAFE_SYSTEM_VARIABLE';
+exports[1674] = 'ER_BINLOG_UNSAFE_SYSTEM_FUNCTION';
+exports[1675] = 'ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS';
+exports[1676] = 'ER_MESSAGE_AND_STATEMENT';
+exports[1677] = 'ER_SLAVE_CONVERSION_FAILED';
+exports[1678] = 'ER_SLAVE_CANT_CREATE_CONVERSION';
+exports[1679] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT';
+exports[1680] = 'ER_PATH_LENGTH';
+exports[1681] = 'ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT';
+exports[1682] = 'ER_WRONG_NATIVE_TABLE_STRUCTURE';
+exports[1683] = 'ER_WRONG_PERFSCHEMA_USAGE';
+exports[1684] = 'ER_WARN_I_S_SKIPPED_TABLE';
+exports[1685] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT';
+exports[1686] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT';
+exports[1687] = 'ER_SPATIAL_MUST_HAVE_GEOM_COL';
+exports[1688] = 'ER_TOO_LONG_INDEX_COMMENT';
+exports[1689] = 'ER_LOCK_ABORTED';
+exports[1690] = 'ER_DATA_OUT_OF_RANGE';
+exports[1691] = 'ER_WRONG_SPVAR_TYPE_IN_LIMIT';
+exports[1692] = 'ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE';
+exports[1693] = 'ER_BINLOG_UNSAFE_MIXED_STATEMENT';
+exports[1694] = 'ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN';
+exports[1695] = 'ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN';
+exports[1696] = 'ER_FAILED_READ_FROM_PAR_FILE';
+exports[1697] = 'ER_VALUES_IS_NOT_INT_TYPE_ERROR';
+exports[1698] = 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR';
+exports[1699] = 'ER_SET_PASSWORD_AUTH_PLUGIN';
+exports[1700] = 'ER_GRANT_PLUGIN_USER_EXISTS';
+exports[1701] = 'ER_TRUNCATE_ILLEGAL_FK';
+exports[1702] = 'ER_PLUGIN_IS_PERMANENT';
+exports[1703] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN';
+exports[1704] = 'ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX';
+exports[1705] = 'ER_STMT_CACHE_FULL';
+exports[1706] = 'ER_MULTI_UPDATE_KEY_CONFLICT';
+exports[1707] = 'ER_TABLE_NEEDS_REBUILD';
+exports[1708] = 'WARN_OPTION_BELOW_LIMIT';
+exports[1709] = 'ER_INDEX_COLUMN_TOO_LONG';
+exports[1710] = 'ER_ERROR_IN_TRIGGER_BODY';
+exports[1711] = 'ER_ERROR_IN_UNKNOWN_TRIGGER_BODY';
+exports[1712] = 'ER_INDEX_CORRUPT';
+exports[1713] = 'ER_UNDO_RECORD_TOO_BIG';
+exports[1714] = 'ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT';
+exports[1715] = 'ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE';
+exports[1716] = 'ER_BINLOG_UNSAFE_REPLACE_SELECT';
+exports[1717] = 'ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT';
+exports[1718] = 'ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT';
+exports[1719] = 'ER_BINLOG_UNSAFE_UPDATE_IGNORE';
+exports[1720] = 'ER_PLUGIN_NO_UNINSTALL';
+exports[1721] = 'ER_PLUGIN_NO_INSTALL';
+exports[1722] = 'ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT';
+exports[1723] = 'ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC';
+exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS';
+exports[1725] = 'ER_TABLE_IN_FK_CHECK';
+exports[1726] = 'ER_UNSUPPORTED_ENGINE';
+exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST';
+exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2';
+exports[1729] = 'ER_MASTER_DELAY_VALUE_OUT_OF_RANGE';
+exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT';
+exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION';
+exports[1732] = 'ER_PARTITION_EXCHANGE_PART_TABLE';
+exports[1733] = 'ER_PARTITION_EXCHANGE_TEMP_TABLE';
+exports[1734] = 'ER_PARTITION_INSTEAD_OF_SUBPARTITION';
+exports[1735] = 'ER_UNKNOWN_PARTITION';
+exports[1736] = 'ER_TABLES_DIFFERENT_METADATA';
+exports[1737] = 'ER_ROW_DOES_NOT_MATCH_PARTITION';
+exports[1738] = 'ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX';
+exports[1739] = 'ER_WARN_INDEX_NOT_APPLICABLE';
+exports[1740] = 'ER_PARTITION_EXCHANGE_FOREIGN_KEY';
+exports[1741] = 'ER_NO_SUCH_KEY_VALUE';
+exports[1742] = 'ER_RPL_INFO_DATA_TOO_LONG';
+exports[1743] = 'ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE';
+exports[1744] = 'ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE';
+exports[1745] = 'ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX';
+exports[1746] = 'ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT';
+exports[1747] = 'ER_PARTITION_CLAUSE_ON_NONPARTITIONED';
+exports[1748] = 'ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET';
+exports[1749] = 'ER_NO_SUCH_PARTITION';
+exports[1750] = 'ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE';
+exports[1751] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE';
+exports[1752] = 'ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE';
+exports[1753] = 'ER_MTS_FEATURE_IS_NOT_SUPPORTED';
+exports[1754] = 'ER_MTS_UPDATED_DBS_GREATER_MAX';
+exports[1755] = 'ER_MTS_CANT_PARALLEL';
+exports[1756] = 'ER_MTS_INCONSISTENT_DATA';
+exports[1757] = 'ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING';
+exports[1758] = 'ER_DA_INVALID_CONDITION_NUMBER';
+exports[1759] = 'ER_INSECURE_PLAIN_TEXT';
+exports[1760] = 'ER_INSECURE_CHANGE_MASTER';
+exports[1761] = 'ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO';
+exports[1762] = 'ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO';
+exports[1763] = 'ER_SQLTHREAD_WITH_SECURE_SLAVE';
+exports[1764] = 'ER_TABLE_HAS_NO_FT';
+exports[1765] = 'ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER';
+exports[1766] = 'ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION';
+exports[1767] = 'ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST';
+exports[1768] = 'ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION';
+exports[1769] = 'ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION';
+exports[1770] = 'ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL';
+exports[1771] = 'ER_SKIPPING_LOGGED_TRANSACTION';
+exports[1772] = 'ER_MALFORMED_GTID_SET_SPECIFICATION';
+exports[1773] = 'ER_MALFORMED_GTID_SET_ENCODING';
+exports[1774] = 'ER_MALFORMED_GTID_SPECIFICATION';
+exports[1775] = 'ER_GNO_EXHAUSTED';
+exports[1776] = 'ER_BAD_SLAVE_AUTO_POSITION';
+exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF';
+exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET';
+exports[1779] = 'ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON';
+exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG';
+exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF';
+exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON';
+exports[1783] = 'ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF';
+exports[1784] = 'ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF';
+exports[1785] = 'ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE';
+exports[1786] = 'ER_GTID_UNSAFE_CREATE_SELECT';
+exports[1787] = 'ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION';
+exports[1788] = 'ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME';
+exports[1789] = 'ER_MASTER_HAS_PURGED_REQUIRED_GTIDS';
+exports[1790] = 'ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID';
+exports[1791] = 'ER_UNKNOWN_EXPLAIN_FORMAT';
+exports[1792] = 'ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION';
+exports[1793] = 'ER_TOO_LONG_TABLE_PARTITION_COMMENT';
+exports[1794] = 'ER_SLAVE_CONFIGURATION';
+exports[1795] = 'ER_INNODB_FT_LIMIT';
+exports[1796] = 'ER_INNODB_NO_FT_TEMP_TABLE';
+exports[1797] = 'ER_INNODB_FT_WRONG_DOCID_COLUMN';
+exports[1798] = 'ER_INNODB_FT_WRONG_DOCID_INDEX';
+exports[1799] = 'ER_INNODB_ONLINE_LOG_TOO_BIG';
+exports[1800] = 'ER_UNKNOWN_ALTER_ALGORITHM';
+exports[1801] = 'ER_UNKNOWN_ALTER_LOCK';
+exports[1802] = 'ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS';
+exports[1803] = 'ER_MTS_RECOVERY_FAILURE';
+exports[1804] = 'ER_MTS_RESET_WORKERS';
+exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2';
+exports[1806] = 'ER_SLAVE_SILENT_RETRY_TRANSACTION';
+exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING';
+exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH';
+exports[1809] = 'ER_TABLE_IN_SYSTEM_TABLESPACE';
+exports[1810] = 'ER_IO_READ_ERROR';
+exports[1811] = 'ER_IO_WRITE_ERROR';
+exports[1812] = 'ER_TABLESPACE_MISSING';
+exports[1813] = 'ER_TABLESPACE_EXISTS';
+exports[1814] = 'ER_TABLESPACE_DISCARDED';
+exports[1815] = 'ER_INTERNAL_ERROR';
+exports[1816] = 'ER_INNODB_IMPORT_ERROR';
+exports[1817] = 'ER_INNODB_INDEX_CORRUPT';
+exports[1818] = 'ER_INVALID_YEAR_COLUMN_LENGTH';
+exports[1819] = 'ER_NOT_VALID_PASSWORD';
+exports[1820] = 'ER_MUST_CHANGE_PASSWORD';
+exports[1821] = 'ER_FK_NO_INDEX_CHILD';
+exports[1822] = 'ER_FK_NO_INDEX_PARENT';
+exports[1823] = 'ER_FK_FAIL_ADD_SYSTEM';
+exports[1824] = 'ER_FK_CANNOT_OPEN_PARENT';
+exports[1825] = 'ER_FK_INCORRECT_OPTION';
+exports[1826] = 'ER_FK_DUP_NAME';
+exports[1827] = 'ER_PASSWORD_FORMAT';
+exports[1828] = 'ER_FK_COLUMN_CANNOT_DROP';
+exports[1829] = 'ER_FK_COLUMN_CANNOT_DROP_CHILD';
+exports[1830] = 'ER_FK_COLUMN_NOT_NULL';
+exports[1831] = 'ER_DUP_INDEX';
+exports[1832] = 'ER_FK_COLUMN_CANNOT_CHANGE';
+exports[1833] = 'ER_FK_COLUMN_CANNOT_CHANGE_CHILD';
+exports[1834] = 'ER_FK_CANNOT_DELETE_PARENT';
+exports[1835] = 'ER_MALFORMED_PACKET';
+exports[1836] = 'ER_READ_ONLY_MODE';
+exports[1837] = 'ER_GTID_NEXT_TYPE_UNDEFINED_GROUP';
+exports[1838] = 'ER_VARIABLE_NOT_SETTABLE_IN_SP';
+exports[1839] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF';
+exports[1840] = 'ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY';
+exports[1841] = 'ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY';
+exports[1842] = 'ER_GTID_PURGED_WAS_CHANGED';
+exports[1843] = 'ER_GTID_EXECUTED_WAS_CHANGED';
+exports[1844] = 'ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES';
+exports[1845] = 'ER_ALTER_OPERATION_NOT_SUPPORTED';
+exports[1846] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON';
+exports[1847] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY';
+exports[1848] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION';
+exports[1849] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME';
+exports[1850] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE';
+exports[1851] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK';
+exports[1852] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE';
+exports[1853] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK';
+exports[1854] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC';
+exports[1855] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS';
+exports[1856] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS';
+exports[1857] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS';
+exports[1858] = 'ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE';
+exports[1859] = 'ER_DUP_UNKNOWN_IN_INDEX';
+exports[1860] = 'ER_IDENT_CAUSES_TOO_LONG_PATH';
+exports[1861] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL';
+exports[1862] = 'ER_MUST_CHANGE_PASSWORD_LOGIN';
+exports[1863] = 'ER_ROW_IN_WRONG_PARTITION';
+exports[1864] = 'ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX';
+exports[1865] = 'ER_INNODB_NO_FT_USES_PARSER';
+exports[1866] = 'ER_BINLOG_LOGICAL_CORRUPTION';
+exports[1867] = 'ER_WARN_PURGE_LOG_IN_USE';
+exports[1868] = 'ER_WARN_PURGE_LOG_IS_ACTIVE';
+exports[1869] = 'ER_AUTO_INCREMENT_CONFLICT';
+exports[1870] = 'WARN_ON_BLOCKHOLE_IN_RBR';
+exports[1871] = 'ER_SLAVE_MI_INIT_REPOSITORY';
+exports[1872] = 'ER_SLAVE_RLI_INIT_REPOSITORY';
+exports[1873] = 'ER_ACCESS_DENIED_CHANGE_USER_ERROR';
+exports[1874] = 'ER_INNODB_READ_ONLY';
+exports[1875] = 'ER_STOP_SLAVE_SQL_THREAD_TIMEOUT';
+exports[1876] = 'ER_STOP_SLAVE_IO_THREAD_TIMEOUT';
+exports[1877] = 'ER_TABLE_CORRUPT';
+exports[1878] = 'ER_TEMP_FILE_WRITE_FAILURE';
+exports[1879] = 'ER_INNODB_FT_AUX_NOT_HEX_ID';
+exports[1880] = 'ER_OLD_TEMPORALS_UPGRADED';
+exports[1881] = 'ER_INNODB_FORCED_RECOVERY';
+exports[1882] = 'ER_AES_INVALID_IV';
+exports[1883] = 'ER_PLUGIN_CANNOT_BE_UNINSTALLED';
+exports[1884] = 'ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP';
+exports[1885] = 'ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER';
+exports[1886] = 'ER_MISSING_KEY';
+exports[1887] = 'WARN_NAMED_PIPE_ACCESS_EVERYONE';
+exports[1888] = 'ER_FOUND_MISSING_GTIDS';
+exports[3000] = 'ER_FILE_CORRUPT';
+exports[3001] = 'ER_ERROR_ON_MASTER';
+exports[3002] = 'ER_INCONSISTENT_ERROR';
+exports[3003] = 'ER_STORAGE_ENGINE_NOT_LOADED';
+exports[3004] = 'ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER';
+exports[3005] = 'ER_WARN_LEGACY_SYNTAX_CONVERTED';
+exports[3006] = 'ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN';
+exports[3007] = 'ER_CANNOT_DISCARD_TEMPORARY_TABLE';
+exports[3008] = 'ER_FK_DEPTH_EXCEEDED';
+exports[3009] = 'ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2';
+exports[3010] = 'ER_WARN_TRIGGER_DOESNT_HAVE_CREATED';
+exports[3011] = 'ER_REFERENCED_TRG_DOES_NOT_EXIST';
+exports[3012] = 'ER_EXPLAIN_NOT_SUPPORTED';
+exports[3013] = 'ER_INVALID_FIELD_SIZE';
+exports[3014] = 'ER_MISSING_HA_CREATE_OPTION';
+exports[3015] = 'ER_ENGINE_OUT_OF_MEMORY';
+exports[3016] = 'ER_PASSWORD_EXPIRE_ANONYMOUS_USER';
+exports[3017] = 'ER_SLAVE_SQL_THREAD_MUST_STOP';
+exports[3018] = 'ER_NO_FT_MATERIALIZED_SUBQUERY';
+exports[3019] = 'ER_INNODB_UNDO_LOG_FULL';
+exports[3020] = 'ER_INVALID_ARGUMENT_FOR_LOGARITHM';
+exports[3021] = 'ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP';
+exports[3022] = 'ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO';
+exports[3023] = 'ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS';
+exports[3024] = 'ER_QUERY_TIMEOUT';
+exports[3025] = 'ER_NON_RO_SELECT_DISABLE_TIMER';
+exports[3026] = 'ER_DUP_LIST_ENTRY';
+exports[3027] = 'ER_SQL_MODE_NO_EFFECT';
+exports[3028] = 'ER_AGGREGATE_ORDER_FOR_UNION';
+exports[3029] = 'ER_AGGREGATE_ORDER_NON_AGG_QUERY';
+exports[3030] = 'ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR';
+exports[3031] = 'ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER';
+exports[3032] = 'ER_SERVER_OFFLINE_MODE';
+exports[3033] = 'ER_GIS_DIFFERENT_SRIDS';
+exports[3034] = 'ER_GIS_UNSUPPORTED_ARGUMENT';
+exports[3035] = 'ER_GIS_UNKNOWN_ERROR';
+exports[3036] = 'ER_GIS_UNKNOWN_EXCEPTION';
+exports[3037] = 'ER_GIS_INVALID_DATA';
+exports[3038] = 'ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION';
+exports[3039] = 'ER_BOOST_GEOMETRY_CENTROID_EXCEPTION';
+exports[3040] = 'ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION';
+exports[3041] = 'ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION';
+exports[3042] = 'ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION';
+exports[3043] = 'ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION';
+exports[3044] = 'ER_STD_BAD_ALLOC_ERROR';
+exports[3045] = 'ER_STD_DOMAIN_ERROR';
+exports[3046] = 'ER_STD_LENGTH_ERROR';
+exports[3047] = 'ER_STD_INVALID_ARGUMENT';
+exports[3048] = 'ER_STD_OUT_OF_RANGE_ERROR';
+exports[3049] = 'ER_STD_OVERFLOW_ERROR';
+exports[3050] = 'ER_STD_RANGE_ERROR';
+exports[3051] = 'ER_STD_UNDERFLOW_ERROR';
+exports[3052] = 'ER_STD_LOGIC_ERROR';
+exports[3053] = 'ER_STD_RUNTIME_ERROR';
+exports[3054] = 'ER_STD_UNKNOWN_EXCEPTION';
+exports[3055] = 'ER_GIS_DATA_WRONG_ENDIANESS';
+exports[3056] = 'ER_CHANGE_MASTER_PASSWORD_LENGTH';
+exports[3057] = 'ER_USER_LOCK_WRONG_NAME';
+exports[3058] = 'ER_USER_LOCK_DEADLOCK';
+exports[3059] = 'ER_REPLACE_INACCESSIBLE_ROWS';
+exports[3060] = 'ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS';
+exports[3061] = 'ER_ILLEGAL_USER_VAR';
+exports[3062] = 'ER_GTID_MODE_OFF';
+exports[3063] = 'ER_UNSUPPORTED_BY_REPLICATION_THREAD';
+exports[3064] = 'ER_INCORRECT_TYPE';
+exports[3065] = 'ER_FIELD_IN_ORDER_NOT_SELECT';
+exports[3066] = 'ER_AGGREGATE_IN_ORDER_NOT_SELECT';
+exports[3067] = 'ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN';
+exports[3068] = 'ER_NET_OK_PACKET_TOO_LARGE';
+exports[3069] = 'ER_INVALID_JSON_DATA';
+exports[3070] = 'ER_INVALID_GEOJSON_MISSING_MEMBER';
+exports[3071] = 'ER_INVALID_GEOJSON_WRONG_TYPE';
+exports[3072] = 'ER_INVALID_GEOJSON_UNSPECIFIED';
+exports[3073] = 'ER_DIMENSION_UNSUPPORTED';
+exports[3074] = 'ER_SLAVE_CHANNEL_DOES_NOT_EXIST';
+exports[3075] = 'ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT';
+exports[3076] = 'ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG';
+exports[3077] = 'ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY';
+exports[3078] = 'ER_SLAVE_CHANNEL_DELETE';
+exports[3079] = 'ER_SLAVE_MULTIPLE_CHANNELS_CMD';
+exports[3080] = 'ER_SLAVE_MAX_CHANNELS_EXCEEDED';
+exports[3081] = 'ER_SLAVE_CHANNEL_MUST_STOP';
+exports[3082] = 'ER_SLAVE_CHANNEL_NOT_RUNNING';
+exports[3083] = 'ER_SLAVE_CHANNEL_WAS_RUNNING';
+exports[3084] = 'ER_SLAVE_CHANNEL_WAS_NOT_RUNNING';
+exports[3085] = 'ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP';
+exports[3086] = 'ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER';
+exports[3087] = 'ER_WRONG_FIELD_WITH_GROUP_V2';
+exports[3088] = 'ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2';
+exports[3089] = 'ER_WARN_DEPRECATED_SYSVAR_UPDATE';
+exports[3090] = 'ER_WARN_DEPRECATED_SQLMODE';
+exports[3091] = 'ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID';
+exports[3092] = 'ER_GROUP_REPLICATION_CONFIGURATION';
+exports[3093] = 'ER_GROUP_REPLICATION_RUNNING';
+exports[3094] = 'ER_GROUP_REPLICATION_APPLIER_INIT_ERROR';
+exports[3095] = 'ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT';
+exports[3096] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR';
+exports[3097] = 'ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR';
+exports[3098] = 'ER_BEFORE_DML_VALIDATION_ERROR';
+exports[3099] = 'ER_PREVENTS_VARIABLE_WITHOUT_RBR';
+exports[3100] = 'ER_RUN_HOOK_ERROR';
+exports[3101] = 'ER_TRANSACTION_ROLLBACK_DURING_COMMIT';
+exports[3102] = 'ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED';
+exports[3103] = 'ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN';
+exports[3104] = 'ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN';
+exports[3105] = 'ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN';
+exports[3106] = 'ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN';
+exports[3107] = 'ER_GENERATED_COLUMN_NON_PRIOR';
+exports[3108] = 'ER_DEPENDENT_BY_GENERATED_COLUMN';
+exports[3109] = 'ER_GENERATED_COLUMN_REF_AUTO_INC';
+exports[3110] = 'ER_FEATURE_NOT_AVAILABLE';
+exports[3111] = 'ER_CANT_SET_GTID_MODE';
+exports[3112] = 'ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF';
+exports[3113] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION';
+exports[3114] = 'ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON';
+exports[3115] = 'ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF';
+exports[3116] = 'ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS';
+exports[3117] = 'ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS';
+exports[3118] = 'ER_ACCOUNT_HAS_BEEN_LOCKED';
+exports[3119] = 'ER_WRONG_TABLESPACE_NAME';
+exports[3120] = 'ER_TABLESPACE_IS_NOT_EMPTY';
+exports[3121] = 'ER_WRONG_FILE_NAME';
+exports[3122] = 'ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION';
+exports[3123] = 'ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR';
+exports[3124] = 'ER_WARN_BAD_MAX_EXECUTION_TIME';
+exports[3125] = 'ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME';
+exports[3126] = 'ER_WARN_CONFLICTING_HINT';
+exports[3127] = 'ER_WARN_UNKNOWN_QB_NAME';
+exports[3128] = 'ER_UNRESOLVED_HINT_NAME';
+exports[3129] = 'ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE';
+exports[3130] = 'ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED';
+exports[3131] = 'ER_LOCKING_SERVICE_WRONG_NAME';
+exports[3132] = 'ER_LOCKING_SERVICE_DEADLOCK';
+exports[3133] = 'ER_LOCKING_SERVICE_TIMEOUT';
+exports[3134] = 'ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED';
+exports[3135] = 'ER_SQL_MODE_MERGED';
+exports[3136] = 'ER_VTOKEN_PLUGIN_TOKEN_MISMATCH';
+exports[3137] = 'ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND';
+exports[3138] = 'ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID';
+exports[3139] = 'ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED';
+exports[3140] = 'ER_INVALID_JSON_TEXT';
+exports[3141] = 'ER_INVALID_JSON_TEXT_IN_PARAM';
+exports[3142] = 'ER_INVALID_JSON_BINARY_DATA';
+exports[3143] = 'ER_INVALID_JSON_PATH';
+exports[3144] = 'ER_INVALID_JSON_CHARSET';
+exports[3145] = 'ER_INVALID_JSON_CHARSET_IN_FUNCTION';
+exports[3146] = 'ER_INVALID_TYPE_FOR_JSON';
+exports[3147] = 'ER_INVALID_CAST_TO_JSON';
+exports[3148] = 'ER_INVALID_JSON_PATH_CHARSET';
+exports[3149] = 'ER_INVALID_JSON_PATH_WILDCARD';
+exports[3150] = 'ER_JSON_VALUE_TOO_BIG';
+exports[3151] = 'ER_JSON_KEY_TOO_BIG';
+exports[3152] = 'ER_JSON_USED_AS_KEY';
+exports[3153] = 'ER_JSON_VACUOUS_PATH';
+exports[3154] = 'ER_JSON_BAD_ONE_OR_ALL_ARG';
+exports[3155] = 'ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE';
+exports[3156] = 'ER_INVALID_JSON_VALUE_FOR_CAST';
+exports[3157] = 'ER_JSON_DOCUMENT_TOO_DEEP';
+exports[3158] = 'ER_JSON_DOCUMENT_NULL_KEY';
+exports[3159] = 'ER_SECURE_TRANSPORT_REQUIRED';
+exports[3160] = 'ER_NO_SECURE_TRANSPORTS_CONFIGURED';
+exports[3161] = 'ER_DISABLED_STORAGE_ENGINE';
+exports[3162] = 'ER_USER_DOES_NOT_EXIST';
+exports[3163] = 'ER_USER_ALREADY_EXISTS';
+exports[3164] = 'ER_AUDIT_API_ABORT';
+exports[3165] = 'ER_INVALID_JSON_PATH_ARRAY_CELL';
+exports[3166] = 'ER_BUFPOOL_RESIZE_INPROGRESS';
+exports[3167] = 'ER_FEATURE_DISABLED_SEE_DOC';
+exports[3168] = 'ER_SERVER_ISNT_AVAILABLE';
+exports[3169] = 'ER_SESSION_WAS_KILLED';
+exports[3170] = 'ER_CAPACITY_EXCEEDED';
+exports[3171] = 'ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER';
+exports[3172] = 'ER_TABLE_NEEDS_UPG_PART';
+exports[3173] = 'ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID';
+exports[3174] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL';
+exports[3175] = 'ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT';
+exports[3176] = 'ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE';
+exports[3177] = 'ER_LOCK_REFUSED_BY_ENGINE';
+exports[3178] = 'ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN';
+exports[3179] = 'ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE';
+exports[3180] = 'ER_MASTER_KEY_ROTATION_ERROR_BY_SE';
+exports[3181] = 'ER_MASTER_KEY_ROTATION_BINLOG_FAILED';
+exports[3182] = 'ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE';
+exports[3183] = 'ER_TABLESPACE_CANNOT_ENCRYPT';
+exports[3184] = 'ER_INVALID_ENCRYPTION_OPTION';
+exports[3185] = 'ER_CANNOT_FIND_KEY_IN_KEYRING';
+exports[3186] = 'ER_CAPACITY_EXCEEDED_IN_PARSER';
+exports[3187] = 'ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE';
+exports[3188] = 'ER_KEYRING_UDF_KEYRING_SERVICE_ERROR';
+exports[3189] = 'ER_USER_COLUMN_OLD_LENGTH';
+exports[3190] = 'ER_CANT_RESET_MASTER';
+exports[3191] = 'ER_GROUP_REPLICATION_MAX_GROUP_SIZE';
+exports[3192] = 'ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED';
+exports[3193] = 'ER_TABLE_REFERENCED';
+exports[3194] = 'ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE';
+exports[3195] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO';
+exports[3196] = 'ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID';
+exports[3197] = 'ER_XA_RETRY';
+exports[3198] = 'ER_KEYRING_AWS_UDF_AWS_KMS_ERROR';
+exports[3199] = 'ER_BINLOG_UNSAFE_XA';
+exports[3200] = 'ER_UDF_ERROR';
+exports[3201] = 'ER_KEYRING_MIGRATION_FAILURE';
+exports[3202] = 'ER_KEYRING_ACCESS_DENIED_ERROR';
+exports[3203] = 'ER_KEYRING_MIGRATION_STATUS';
+exports[3204] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLES';
+exports[3205] = 'ER_PLUGIN_FAILED_TO_OPEN_TABLE';
+exports[3206] = 'ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED';
+exports[3207] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET';
+exports[3208] = 'ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY';
+exports[3209] = 'ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED';
+exports[3210] = 'ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED';
+exports[3211] = 'ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE';
+exports[3212] = 'ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED';
+exports[3213] = 'ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS';
+exports[3214] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE';
+exports[3215] = 'ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT';
+exports[3216] = 'ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED';
+exports[3217] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE';
+exports[3218] = 'ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE';
+exports[3219] = 'ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR';
+exports[3220] = 'ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY';
+exports[3221] = 'ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY';
+exports[3222] = 'ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS';
+exports[3223] = 'ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC';
+exports[3224] = 'ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER';
+exports[3225] = 'ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER';
+exports[3226] = 'WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP';
+exports[3227] = 'ER_XA_REPLICATION_FILTERS';
+exports[3228] = 'ER_CANT_OPEN_ERROR_LOG';
+exports[3229] = 'ER_GROUPING_ON_TIMESTAMP_IN_DST';
+exports[3230] = 'ER_CANT_START_SERVER_NAMED_PIPE';
- self.setHost = false
- if (!self.hasHeader('host')) {
- var hostHeaderName = self.originalHostHeaderName || 'host'
- self.setHeader(hostHeaderName, self.uri.host)
- // Drop :port suffix from Host header if known protocol.
- if (self.uri.port) {
- if ((self.uri.port === '80' && self.uri.protocol === 'http:') ||
- (self.uri.port === '443' && self.uri.protocol === 'https:')) {
- self.setHeader(hostHeaderName, self.uri.hostname)
- }
- }
- self.setHost = true
- }
- self.jar(self._jar || options.jar)
+/***/ }),
- if (!self.uri.port) {
- if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }
- }
+/***/ 64563:
+/***/ ((__unused_webpack_module, exports) => {
- if (self.proxy && !self.tunnel) {
- self.port = self.proxy.port
- self.host = self.proxy.hostname
- } else {
- self.port = self.uri.port
- self.host = self.uri.hostname
- }
+// Manually extracted from mysql-5.5.23/include/mysql_com.h
- if (options.form) {
- self.form(options.form)
- }
+/**
+ Is raised when a multi-statement transaction
+ has been started, either explicitly, by means
+ of BEGIN or COMMIT AND CHAIN, or
+ implicitly, by the first transactional
+ statement, when autocommit=off.
+*/
+exports.SERVER_STATUS_IN_TRANS = 1;
+exports.SERVER_STATUS_AUTOCOMMIT = 2; /* Server in auto_commit mode */
+exports.SERVER_MORE_RESULTS_EXISTS = 8; /* Multi query - next query exists */
+exports.SERVER_QUERY_NO_GOOD_INDEX_USED = 16;
+exports.SERVER_QUERY_NO_INDEX_USED = 32;
+/**
+ The server was able to fulfill the clients request and opened a
+ read-only non-scrollable cursor for a query. This flag comes
+ in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands.
+*/
+exports.SERVER_STATUS_CURSOR_EXISTS = 64;
+/**
+ This flag is sent when a read-only cursor is exhausted, in reply to
+ COM_STMT_FETCH command.
+*/
+exports.SERVER_STATUS_LAST_ROW_SENT = 128;
+exports.SERVER_STATUS_DB_DROPPED = 256; /* A database was dropped */
+exports.SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512;
+/**
+ Sent to the client if after a prepared statement reprepare
+ we discovered that the new statement returns a different
+ number of result set columns.
+*/
+exports.SERVER_STATUS_METADATA_CHANGED = 1024;
+exports.SERVER_QUERY_WAS_SLOW = 2048;
- if (options.formData) {
- var formData = options.formData
- var requestForm = self.form()
- var appendFormValue = function (key, value) {
- if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {
- requestForm.append(key, value.value, value.options)
- } else {
- requestForm.append(key, value)
- }
- }
- for (var formKey in formData) {
- if (formData.hasOwnProperty(formKey)) {
- var formValue = formData[formKey]
- if (formValue instanceof Array) {
- for (var j = 0; j < formValue.length; j++) {
- appendFormValue(formKey, formValue[j])
- }
- } else {
- appendFormValue(formKey, formValue)
- }
- }
- }
- }
+/**
+ To mark ResultSet containing output parameter values.
+*/
+exports.SERVER_PS_OUT_PARAMS = 4096;
- if (options.qs) {
- self.qs(options.qs)
- }
- if (self.uri.path) {
- self.path = self.uri.path
- } else {
- self.path = self.uri.pathname + (self.uri.search || '')
- }
+/***/ }),
- if (self.path.length === 0) {
- self.path = '/'
- }
+/***/ 3061:
+/***/ ((__unused_webpack_module, exports) => {
- // Auth must happen last in case signing is dependent on other headers
- if (options.aws) {
- self.aws(options.aws)
- }
+// Certificates for Amazon RDS
+exports["Amazon RDS"] = {
+ ca: [
+ /**
+ * Amazon RDS global certificate 2010 to 2015
+ *
+ * CN = aws.amazon.com/rds/
+ * OU = RDS
+ * O = Amazon.com
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2010-04-05T22:44:31Z/2015-04-04T22:41:31Z
+ * F = 7F:09:8D:A5:7D:BB:A6:EF:7C:70:D8:CA:4E:49:11:55:7E:89:A7:D3
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIDQzCCAqygAwIBAgIJAOd1tlfiGoEoMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV\n'
+ + 'BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRMw\n'
+ + 'EQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNSRFMxHDAaBgNVBAMTE2F3cy5h\n'
+ + 'bWF6b24uY29tL3Jkcy8wHhcNMTAwNDA1MjI0NDMxWhcNMTUwNDA0MjI0NDMxWjB1\n'
+ + 'MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh\n'
+ + 'dHRsZTETMBEGA1UEChMKQW1hem9uLmNvbTEMMAoGA1UECxMDUkRTMRwwGgYDVQQD\n'
+ + 'ExNhd3MuYW1hem9uLmNvbS9yZHMvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n'
+ + 'gQDKhXGU7tizxUR5WaFoMTFcxNxa05PEjZaIOEN5ctkWrqYSRov0/nOMoZjqk8bC\n'
+ + 'med9vPFoQGD0OTakPs0jVe3wwmR735hyVwmKIPPsGlaBYj1O6llIpZeQVyupNx56\n'
+ + 'UzqtiLaDzh1KcmfqP3qP2dInzBfJQKjiRudo1FWnpPt33QIDAQABo4HaMIHXMB0G\n'
+ + 'A1UdDgQWBBT/H3x+cqSkR/ePSIinPtc4yWKe3DCBpwYDVR0jBIGfMIGcgBT/H3x+\n'
+ + 'cqSkR/ePSIinPtc4yWKe3KF5pHcwdTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh\n'
+ + 'c2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgNVBAoTCkFtYXpvbi5jb20x\n'
+ + 'DDAKBgNVBAsTA1JEUzEcMBoGA1UEAxMTYXdzLmFtYXpvbi5jb20vcmRzL4IJAOd1\n'
+ + 'tlfiGoEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAvguZy/BDT66x\n'
+ + 'GfgnJlyQwnFSeVLQm9u/FIvz4huGjbq9dqnD6h/Gm56QPFdyMEyDiZWaqY6V08lY\n'
+ + 'LTBNb4kcIc9/6pc0/ojKciP5QJRm6OiZ4vgG05nF4fYjhU7WClUx7cxq1fKjNc2J\n'
+ + 'UCmmYqgiVkAGWRETVo+byOSDZ4swb10=\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.hawk) {
- self.hawk(options.hawk)
- }
+ /**
+ * Amazon RDS global root CA 2015 to 2020
+ *
+ * CN = Amazon RDS Root CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T09:11:31Z/2020-03-05T09:11:31Z
+ * F = E8:11:88:56:E7:A7:CE:3E:5E:DC:9A:31:25:1B:93:AC:DC:43:CE:B0
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUwOTExMzFaFw0y\n'
+ + 'MDAzMDUwOTExMzFaMIGKMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEbMBkGA1UEAwwSQW1hem9uIFJE\n'
+ + 'UyBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuD8nrZ8V\n'
+ + 'u+VA8yVlUipCZIKPTDcOILYpUe8Tct0YeQQr0uyl018StdBsa3CjBgvwpDRq1HgF\n'
+ + 'Ji2N3+39+shCNspQeE6aYU+BHXhKhIIStt3r7gl/4NqYiDDMWKHxHq0nsGDFfArf\n'
+ + 'AOcjZdJagOMqb3fF46flc8k2E7THTm9Sz4L7RY1WdABMuurpICLFE3oHcGdapOb9\n'
+ + 'T53pQR+xpHW9atkcf3pf7gbO0rlKVSIoUenBlZipUlp1VZl/OD/E+TtRhDDNdI2J\n'
+ + 'P/DSMM3aEsq6ZQkfbz/Ilml+Lx3tJYXUDmp+ZjzMPLk/+3beT8EhrwtcG3VPpvwp\n'
+ + 'BIOqsqVVTvw/CwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n'
+ + 'AwEB/zAdBgNVHQ4EFgQUTgLurD72FchM7Sz1BcGPnIQISYMwHwYDVR0jBBgwFoAU\n'
+ + 'TgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQEFBQADggEBAHZcgIio8pAm\n'
+ + 'MjHD5cl6wKjXxScXKtXygWH2BoDMYBJF9yfyKO2jEFxYKbHePpnXB1R04zJSWAw5\n'
+ + '2EUuDI1pSBh9BA82/5PkuNlNeSTB3dXDD2PEPdzVWbSKvUB8ZdooV+2vngL0Zm4r\n'
+ + '47QPyd18yPHrRIbtBtHR/6CwKevLZ394zgExqhnekYKIqqEX41xsUV0Gm6x4vpjf\n'
+ + '2u6O/+YE2U+qyyxHE5Wd5oqde0oo9UUpFETJPVb6Q2cEeQib8PBAyi0i6KnF+kIV\n'
+ + 'A9dY7IHSubtCK/i8wxMVqfd5GtbA8mmpeJFwnDvm9rBEsHybl08qlax9syEwsUYr\n'
+ + '/40NawZfTUU=\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.httpSignature) {
- self.httpSignature(options.httpSignature)
- }
+ /**
+ * Amazon RDS global root CA 2019 to 2024
+ *
+ * CN = Amazon RDS Root 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-08-22T17:08:50Z/2024-08-22T17:08:50Z
+ * F = D4:0D:DB:29:E3:75:0D:FF:A6:71:C3:14:0B:BF:5F:47:8D:1C:80:96
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBjCCAu6gAwIBAgIJAMc0ZzaSUK51MA0GCSqGSIb3DQEBCwUAMIGPMQswCQYD\n'
+ + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
+ + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
+ + 'em9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkw\n'
+ + 'ODIyMTcwODUwWhcNMjQwODIyMTcwODUwWjCBjzELMAkGA1UEBhMCVVMxEDAOBgNV\n'
+ + 'BAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoMGUFtYXpv\n'
+ + 'biBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxIDAeBgNV\n'
+ + 'BAMMF0FtYXpvbiBSRFMgUm9vdCAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC\n'
+ + 'AQ8AMIIBCgKCAQEArXnF/E6/Qh+ku3hQTSKPMhQQlCpoWvnIthzX6MK3p5a0eXKZ\n'
+ + 'oWIjYcNNG6UwJjp4fUXl6glp53Jobn+tWNX88dNH2n8DVbppSwScVE2LpuL+94vY\n'
+ + '0EYE/XxN7svKea8YvlrqkUBKyxLxTjh+U/KrGOaHxz9v0l6ZNlDbuaZw3qIWdD/I\n'
+ + '6aNbGeRUVtpM6P+bWIoxVl/caQylQS6CEYUk+CpVyJSkopwJlzXT07tMoDL5WgX9\n'
+ + 'O08KVgDNz9qP/IGtAcRduRcNioH3E9v981QO1zt/Gpb2f8NqAjUUCUZzOnij6mx9\n'
+ + 'McZ+9cWX88CRzR0vQODWuZscgI08NvM69Fn2SQIDAQABo2MwYTAOBgNVHQ8BAf8E\n'
+ + 'BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUc19g2LzLA5j0Kxc0LjZa\n'
+ + 'pmD/vB8wHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJKoZIhvcN\n'
+ + 'AQELBQADggEBAHAG7WTmyjzPRIM85rVj+fWHsLIvqpw6DObIjMWokpliCeMINZFV\n'
+ + 'ynfgBKsf1ExwbvJNzYFXW6dihnguDG9VMPpi2up/ctQTN8tm9nDKOy08uNZoofMc\n'
+ + 'NUZxKCEkVKZv+IL4oHoeayt8egtv3ujJM6V14AstMQ6SwvwvA93EP/Ug2e4WAXHu\n'
+ + 'cbI1NAbUgVDqp+DRdfvZkgYKryjTWd/0+1fS8X1bBZVWzl7eirNVnHbSH2ZDpNuY\n'
+ + '0SBd8dj5F6ld3t58ydZbrTHze7JJOd8ijySAp4/kiu9UfZWuTPABzDa/DSdz9Dk/\n'
+ + 'zPW4CXXvhLmE02TA9/HeCw3KEHIwicNuEfw=\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.auth) {
- if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {
- options.auth.user = options.auth.username
- }
- if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {
- options.auth.pass = options.auth.password
- }
+ /**
+ * Amazon RDS ap-northeast-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS ap-northeast-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:06Z/2020-03-05T22:03:06Z
+ * F = 4B:2D:8A:E0:C1:A3:A9:AF:A7:BB:65:0C:5A:16:8A:39:3C:03:F2:C5
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEATCCAumgAwIBAgIBRDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMDZaFw0y\n'
+ + 'MDAzMDUyMjAzMDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
+ + 'UyBhcC1ub3J0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
+ + 'ggEBAMmM2B4PfTXCZjbZMWiDPyxvk/eeNwIRJAhfzesiGUiLozX6CRy3rwC1ZOPV\n'
+ + 'AcQf0LB+O8wY88C/cV+d4Q2nBDmnk+Vx7o2MyMh343r5rR3Na+4izd89tkQVt0WW\n'
+ + 'vO21KRH5i8EuBjinboOwAwu6IJ+HyiQiM0VjgjrmEr/YzFPL8MgHD/YUHehqjACn\n'
+ + 'C0+B7/gu7W4qJzBL2DOf7ub2qszGtwPE+qQzkCRDwE1A4AJmVE++/FLH2Zx78Egg\n'
+ + 'fV1sUxPtYgjGH76VyyO6GNKM6rAUMD/q5mnPASQVIXgKbupr618bnH+SWHFjBqZq\n'
+ + 'HvDGPMtiiWII41EmGUypyt5AbysCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
+ + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIiKM0Q6n1K4EmLxs3ZXxINbwEwR\n'
+ + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
+ + 'A4IBAQBezGbE9Rw/k2e25iGjj5n8r+M3dlye8ORfCE/dijHtxqAKasXHgKX8I9Tw\n'
+ + 'JkBiGWiuzqn7gO5MJ0nMMro1+gq29qjZnYX1pDHPgsRjUX8R+juRhgJ3JSHijRbf\n'
+ + '4qNJrnwga7pj94MhcLq9u0f6dxH6dXbyMv21T4TZMTmcFduf1KgaiVx1PEyJjC6r\n'
+ + 'M+Ru+A0eM+jJ7uCjUoZKcpX8xkj4nmSnz9NMPog3wdOSB9cAW7XIc5mHa656wr7I\n'
+ + 'WJxVcYNHTXIjCcng2zMKd1aCcl2KSFfy56sRfT7J5Wp69QSr+jq8KM55gw8uqAwi\n'
+ + 'VPrXn2899T1rcTtFYFP16WXjGuc0\n'
+ + '-----END CERTIFICATE-----\n',
- self.auth(
- options.auth.user,
- options.auth.pass,
- options.auth.sendImmediately,
- options.auth.bearer
- )
- }
+ /**
+ * Amazon RDS ap-northeast-2 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS ap-northeast-2 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-11-06T00:05:46Z/2020-03-05T00:05:46Z
+ * F = 77:D9:33:4E:CE:56:FC:42:7B:29:57:8D:67:59:ED:29:4E:18:CB:6B
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEATCCAumgAwIBAgIBTDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTExMDYwMDA1NDZaFw0y\n'
+ + 'MDAzMDUwMDA1NDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
+ + 'UyBhcC1ub3J0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
+ + 'ggEBAKSwd+RVUzTRH0FgnbwoTK8TMm/zMT4+2BvALpAUe6YXbkisg2goycWuuWLg\n'
+ + 'jOpFBB3GtyvXZnkqi7MkDWUmj1a2kf8l2oLyoaZ+Hm9x/sV+IJzOqPvj1XVUGjP6\n'
+ + 'yYYnPJmUYqvZeI7fEkIGdFkP2m4/sgsSGsFvpD9FK1bL1Kx2UDpYX0kHTtr18Zm/\n'
+ + '1oN6irqWALSmXMDydb8hE0FB2A1VFyeKE6PnoDj/Y5cPHwPPdEi6/3gkDkSaOG30\n'
+ + 'rWeQfL3pOcKqzbHaWTxMphd0DSL/quZ64Nr+Ly65Q5PRcTrtr55ekOUziuqXwk+o\n'
+ + '9QpACMwcJ7ROqOznZTqTzSFVXFECAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
+ + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFM6Nox/QWbhzWVvzoJ/y0kGpNPK+\n'
+ + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
+ + 'A4IBAQCTkWBqNvyRf3Y/W21DwFx3oT/AIWrHt0BdGZO34tavummXemTH9LZ/mqv9\n'
+ + 'aljt6ZuDtf5DEQjdsAwXMsyo03ffnP7doWm8iaF1+Mui77ot0TmTsP/deyGwukvJ\n'
+ + 'tkxX8bZjDh+EaNauWKr+CYnniNxCQLfFtXYJsfOdVBzK3xNL+Z3ucOQRhr2helWc\n'
+ + 'CDQgwfhP1+3pRVKqHvWCPC4R3fT7RZHuRmZ38kndv476GxRntejh+ePffif78bFI\n'
+ + '3rIZCPBGobrrUMycafSbyXteoGca/kA+/IqrAPlk0pWQ4aEL0yTWN2h2dnjoD7oX\n'
+ + 'byIuL/g9AGRh97+ssn7D6bDRPTbW\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.gzip && !self.hasHeader('accept-encoding')) {
- self.setHeader('accept-encoding', 'gzip, deflate')
- }
+ /**
+ * Amazon RDS ap-southeast-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS ap-southeast-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:19Z/2020-03-05T22:03:19Z
+ * F = 0E:EC:5D:BD:F9:80:EE:A9:A0:8D:81:AC:37:D9:8D:34:1C:CD:27:D1
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEATCCAumgAwIBAgIBRTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMTlaFw0y\n'
+ + 'MDAzMDUyMjAzMTlaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
+ + 'UyBhcC1zb3V0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
+ + 'ggEBANaXElmSEYt/UtxHFsARFhSUahTf1KNJzR0Dmay6hqOXQuRVbKRwPd19u5vx\n'
+ + 'DdF1sLT7D69IK3VDnUiQScaCv2Dpu9foZt+rLx+cpx1qiQd1UHrvqq8xPzQOqCdC\n'
+ + 'RFStq6yVYZ69yfpfoI67AjclMOjl2Vph3ftVnqP0IgVKZdzeC7fd+umGgR9xY0Qr\n'
+ + 'Ubhd/lWdsbNvzK3f1TPWcfIKQnpvSt85PIEDJir6/nuJUKMtmJRwTymJf0i+JZ4x\n'
+ + '7dJa341p2kHKcHMgOPW7nJQklGBA70ytjUV6/qebS3yIugr/28mwReflg3TJzVDl\n'
+ + 'EOvi6pqbqNbkMuEwGDCmEQIVqgkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
+ + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFAu93/4k5xbWOsgdCdn+/KdiRuit\n'
+ + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
+ + 'A4IBAQBlcjSyscpPjf5+MgzMuAsCxByqUt+WFspwcMCpwdaBeHOPSQrXNqX2Sk6P\n'
+ + 'kth6oCivA64trWo8tFMvPYlUA1FYVD5WpN0kCK+P5pD4KHlaDsXhuhClJzp/OP8t\n'
+ + 'pOyUr5109RHLxqoKB5J5m1XA7rgcFjnMxwBSWFe3/4uMk/+4T53YfCVXuc6QV3i7\n'
+ + 'I/2LAJwFf//pTtt6fZenYfCsahnr2nvrNRNyAxcfvGZ/4Opn/mJtR6R/AjvQZHiR\n'
+ + 'bkRNKF2GW0ueK5W4FkZVZVhhX9xh1Aj2Ollb+lbOqADaVj+AT3PoJPZ3MPQHKCXm\n'
+ + 'xwG0LOLlRr/TfD6li1AfOVTAJXv9\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.uri.auth && !self.hasHeader('authorization')) {
- var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })
- self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)
- }
+ /**
+ * Amazon RDS ap-southeast-2 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS ap-southeast-2 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:24Z/2020-03-05T22:03:24Z
+ * F = 20:D9:A8:82:23:AB:B9:E5:C5:24:10:D3:4D:0F:3D:B1:31:DF:E5:14
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEATCCAumgAwIBAgIBRjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMjRaFw0y\n'
+ + 'MDAzMDUyMjAzMjRaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
+ + 'UyBhcC1zb3V0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
+ + 'ggEBAJqBAJutz69hFOh3BtLHZTbwE8eejGGKayn9hu98YMDPzWzGXWCmW+ZYWELA\n'
+ + 'cY3cNWNF8K4FqKXFr2ssorBYim1UtYFX8yhydT2hMD5zgQ2sCGUpuidijuPA6zaq\n'
+ + 'Z3tdhVR94f0q8mpwpv2zqR9PcqaGDx2VR1x773FupRPRo7mEW1vC3IptHCQlP/zE\n'
+ + '7jQiLl28bDIH2567xg7e7E9WnZToRnhlYdTaDaJsHTzi5mwILi4cihSok7Shv/ME\n'
+ + 'hnukvxeSPUpaVtFaBhfBqq055ePq9I+Ns4KGreTKMhU0O9fkkaBaBmPaFgmeX/XO\n'
+ + 'n2AX7gMouo3mtv34iDTZ0h6YCGkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
+ + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIlQnY0KHYWn1jYumSdJYfwj/Nfw\n'
+ + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
+ + 'A4IBAQA0wVU6/l41cTzHc4azc4CDYY2Wd90DFWiH9C/mw0SgToYfCJ/5Cfi0NT/Y\n'
+ + 'PRnk3GchychCJgoPA/k9d0//IhYEAIiIDjyFVgjbTkKV3sh4RbdldKVOUB9kumz/\n'
+ + 'ZpShplsGt3z4QQiVnKfrAgqxWDjR0I0pQKkxXa6Sjkicos9LQxVtJ0XA4ieG1E7z\n'
+ + 'zJr+6t80wmzxvkInSaWP3xNJK9azVRTrgQZQlvkbpDbExl4mNTG66VD3bAp6t3Wa\n'
+ + 'B49//uDdfZmPkqqbX+hsxp160OH0rxJppwO3Bh869PkDnaPEd/Pxw7PawC+li0gi\n'
+ + 'NRV8iCEx85aFxcyOhqn0WZOasxee\n'
+ + '-----END CERTIFICATE-----\n',
- if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {
- var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })
- var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))
- self.setHeader('proxy-authorization', authHeader)
- }
+ /**
+ * Amazon RDS eu-central-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS eu-central-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:31Z/2020-03-05T22:03:31Z
+ * F = 94:B4:DF:B9:6D:7E:F7:C3:B7:BF:51:E9:A6:B7:44:A0:D0:82:11:84
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/zCCAuegAwIBAgIBRzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzFaFw0y\n'
+ + 'MDAzMDUyMjAzMzFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE\n'
+ + 'UyBldS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n'
+ + 'AQDFtP2dhSLuaPOI4ZrrPWsK4OY9ocQBp3yApH1KJYmI9wpQKZG/KCH2E6Oo7JAw\n'
+ + 'QORU519r033T+FO2Z7pFPlmz1yrxGXyHpJs8ySx3Yo5S8ncDCdZJCLmtPiq/hahg\n'
+ + '5/0ffexMFUCQaYicFZsrJ/cStdxUV+tSw2JQLD7UxS9J97LQWUPyyG+ZrjYVTVq+\n'
+ + 'zudnFmNSe4QoecXMhAFTGJFQXxP7nhSL9Ao5FGgdXy7/JWeWdQIAj8ku6cBDKPa6\n'
+ + 'Y6kP+ak+In+Lye8z9qsCD/afUozfWjPR2aA4JoIZVF8dNRShIMo8l0XfgfM2q0+n\n'
+ + 'ApZWZ+BjhIO5XuoUgHS3D2YFAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV\n'
+ + 'HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRm4GsWIA/M6q+tK8WGHWDGh2gcyTAf\n'
+ + 'BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOC\n'
+ + 'AQEAHpMmeVQNqcxgfQdbDIi5UIy+E7zZykmtAygN1XQrvga9nXTis4kOTN6g5/+g\n'
+ + 'HCx7jIXeNJzAbvg8XFqBN84Quqgpl/tQkbpco9Jh1HDs558D5NnZQxNqH5qXQ3Mm\n'
+ + 'uPgCw0pYcPOa7bhs07i+MdVwPBsX27CFDtsgAIru8HvKxY1oTZrWnyIRo93tt/pk\n'
+ + 'WuItVMVHjaQZVfTCow0aDUbte6Vlw82KjUFq+n2NMSCJDiDKsDDHT6BJc4AJHIq3\n'
+ + '/4Z52MSC9KMr0yAaaoWfW/yMEj9LliQauAgwVjArF4q78rxpfKTG9Rfd8U1BZANP\n'
+ + '7FrFMN0ThjfA1IvmOYcgskY5bQ==\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.proxy && !self.tunnel) {
- self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
- }
+ /**
+ * Amazon RDS eu-west-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS eu-west-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:35Z/2020-03-05T22:03:35Z
+ * F = 1A:95:F0:43:82:D2:5D:A6:AD:F5:13:27:0B:40:8A:72:D9:92:F3:E0
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBSDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzVaFw0y\n'
+ + 'MDAzMDUyMjAzMzVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyBldS13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx\n'
+ + 'PdbqQ0HKRj79Pmocxvjc+P6i4Ux24kgFIl+ckiir1vzkmesc3a58gjrMlCksEObt\n'
+ + 'Yihs5IhzEq1ePT0gbfS9GYFp34Uj/MtPwlrfCBWG4d2TcrsKRHr1/EXUYhWqmdrb\n'
+ + 'RhX8XqoRhVkbF/auzFSBhTzcGGvZpQ2KIaxRcQfcXlMVhj/pxxAjh8U4F350Fb0h\n'
+ + 'nX1jw4/KvEreBL0Xb2lnlGTkwVxaKGSgXEnOgIyOFdOQc61vdome0+eeZsP4jqeR\n'
+ + 'TGYJA9izJsRbe2YJxHuazD+548hsPlM3vFzKKEVURCha466rAaYAHy3rKur3HYQx\n'
+ + 'Yt+SoKcEz9PXuSGj96ejAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBTebg//h2oeXbZjQ4uuoiuLYzuiPDAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
+ + 'TikPaGeZasTPw+4RBemlsyPAjtFFQLo7ddaFdORLgdEysVf8aBqndvbA6MT/v4lj\n'
+ + 'GtEtUdF59ZcbWOrVm+fBZ2h/jYJ59dYF/xzb09nyRbdMSzB9+mkSsnOMqluq5y8o\n'
+ + 'DY/PfP2vGhEg/2ZncRC7nlQU1Dm8F4lFWEiQ2fi7O1cW852Vmbq61RIfcYsH/9Ma\n'
+ + 'kpgk10VZ75b8m3UhmpZ/2uRY+JEHImH5WpcTJ7wNiPNJsciZMznGtrgOnPzYco8L\n'
+ + 'cDleOASIZifNMQi9PKOJKvi0ITz0B/imr8KBsW0YjZVJ54HMa7W1lwugSM7aMAs+\n'
+ + 'E3Sd5lS+SHwWaOCHwhOEVA==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.json) {
- self.json(options.json)
- }
- if (options.multipart) {
- self.multipart(options.multipart)
- }
+ /**
+ * Amazon RDS sa-east-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS sa-east-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:40Z/2020-03-05T22:03:40Z
+ * F = 32:10:3D:FA:6D:42:F5:35:98:40:15:F4:4C:74:74:27:CB:CE:D4:B5
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBSTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDBaFw0y\n'
+ + 'MDAzMDUyMjAzNDBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyBzYS1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCU\n'
+ + 'X4OBnQ5xA6TLJAiFEI6l7bUWjoVJBa/VbMdCCSs2i2dOKmqUaXu2ix2zcPILj3lZ\n'
+ + 'GMk3d/2zvTK/cKhcFrewHUBamTeVHdEmynhMQamqNmkM4ptYzFcvEUw1TGxHT4pV\n'
+ + 'Q6gSN7+/AJewQvyHexHo8D0+LDN0/Wa9mRm4ixCYH2CyYYJNKaZt9+EZfNu+PPS4\n'
+ + '8iB0TWH0DgQkbWMBfCRgolLLitAZklZ4dvdlEBS7evN1/7ttBxUK6SvkeeSx3zBl\n'
+ + 'ww3BlXqc3bvTQL0A+RRysaVyFbvtp9domFaDKZCpMmDFAN/ntx215xmQdrSt+K3F\n'
+ + 'cXdGQYHx5q410CAclGnbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT6iVWnm/uakS+tEX2mzIfw+8JL0zAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
+ + 'FmDD+QuDklXn2EgShwQxV13+txPRuVdOSrutHhoCgMwFWCMtPPtBAKs6KPY7Guvw\n'
+ + 'DpJoZSehDiOfsgMirjOWjvfkeWSNvKfjWTVneX7pZD9W5WPnsDBvTbCGezm+v87z\n'
+ + 'b+ZM2ZMo98m/wkMcIEAgdSKilR2fuw8rLkAjhYFfs0A7tDgZ9noKwgHvoE4dsrI0\n'
+ + 'KZYco6DlP/brASfHTPa2puBLN9McK3v+h0JaSqqm5Ro2Bh56tZkQh8AWy/miuDuK\n'
+ + '3+hNEVdxosxlkM1TPa1DGj0EzzK0yoeerXuH2HX7LlCrrxf6/wdKnjR12PMrLQ4A\n'
+ + 'pCqkcWw894z6bV9MAvKe6A==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.time) {
- self.timing = true
+ /**
+ * Amazon RDS us-east-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS us-east-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T21:54:04Z/2020-03-05T21:54:04Z
+ * F = 34:47:8A:90:8A:83:AE:45:DC:B6:16:76:D2:35:EC:E9:75:C6:2C:63
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBQzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMTU0MDRaFw0y\n'
+ + 'MDAzMDUyMTU0MDRaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyB1cy1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI\n'
+ + 'UIuwh8NusKHk1SqPXcP7OqxY3S/M2ZyQWD3w7Bfihpyyy/fc1w0/suIpX3kbMhAV\n'
+ + '2ESwged2/2zSx4pVnjp/493r4luhSqQYzru78TuPt9bhJIJ51WXunZW2SWkisSaf\n'
+ + 'USYUzVN9ezR/bjXTumSUQaLIouJt3OHLX49s+3NAbUyOI8EdvgBQWD68H1epsC0n\n'
+ + 'CI5s+pIktyOZ59c4DCDLQcXErQ+tNbDC++oct1ANd/q8p9URonYwGCGOBy7sbCYq\n'
+ + '9eVHh1Iy2M+SNXddVOGw5EuruvHoCIQyOz5Lz4zSuZA9dRbrfztNOpezCNYu6NKM\n'
+ + 'n+hzcvdiyxv77uNm8EaxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQSQG3TmMe6Sa3KufaPBa72v4QFDzAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
+ + 'L/mOZfB3187xTmjOHMqN2G2oSKHBKiQLM9uv8+97qT+XR+TVsBT6b3yoPpMAGhHA\n'
+ + 'Pc7nxAF5gPpuzatx0OTLPcmYucFmfqT/1qA5WlgCnMNtczyNMH97lKFTNV7Njtek\n'
+ + 'jWEzAEQSyEWrkNpNlC4j6kMYyPzVXQeXUeZTgJ9FNnVZqmvfjip2N22tawMjrCn5\n'
+ + '7KN/zN65EwY2oO9XsaTwwWmBu3NrDdMbzJnbxoWcFWj4RBwanR1XjQOVNhDwmCOl\n'
+ + '/1Et13b8CPyj69PC8BOVU6cfTSx8WUVy0qvYOKHNY9Bqa5BDnIL3IVmUkeTlM1mt\n'
+ + 'enRpyBj+Bk9rh/ICdiRKmA==\n'
+ + '-----END CERTIFICATE-----\n',
- // NOTE: elapsedTime is deprecated in favor of .timings
- self.elapsedTime = self.elapsedTime || 0
- }
+ /**
+ * Amazon RDS us-west-1 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS us-west-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:45Z/2020-03-05T22:03:45Z
+ * F = EF:94:2F:E3:58:0E:09:D6:79:C2:16:97:91:FB:37:EA:D7:70:A8:4B
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBSjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDVaFw0y\n'
+ + 'MDAzMDUyMjAzNDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyB1cy13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDE\n'
+ + 'Dhw+uw/ycaiIhhyu2pXFRimq0DlB8cNtIe8hdqndH8TV/TFrljNgR8QdzOgZtZ9C\n'
+ + 'zzQ2GRpInN/qJF6slEd6wO+6TaDBQkPY+07TXNt52POFUhdVkhJXHpE2BS7Xn6J7\n'
+ + '7RFAOeG1IZmc2DDt+sR1BgXzUqHslQGfFYNS0/MBO4P+ya6W7IhruB1qfa4HiYQS\n'
+ + 'dbe4MvGWnv0UzwAqdR7OF8+8/5c58YXZIXCO9riYF2ql6KNSL5cyDPcYK5VK0+Q9\n'
+ + 'VI6vuJHSMYcF7wLePw8jtBktqAFE/wbdZiIHhZvNyiNWPPNTGUmQbaJ+TzQEHDs5\n'
+ + '8en+/W7JKnPyBOkxxENbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBS0nw/tFR9bCjgqWTPJkyy4oOD8bzAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
+ + 'CXGAY3feAak6lHdqj6+YWjy6yyUnLK37bRxZDsyDVXrPRQaXRzPTzx79jvDwEb/H\n'
+ + 'Q/bdQ7zQRWqJcbivQlwhuPJ4kWPUZgSt3JUUuqkMsDzsvj/bwIjlrEFDOdHGh0mi\n'
+ + 'eVIngFEjUXjMh+5aHPEF9BlQnB8LfVtKj18e15UDTXFa+xJPFxUR7wDzCfo4WI1m\n'
+ + 'sUMG4q1FkGAZgsoyFPZfF8IVvgCuGdR8z30VWKklFxttlK0eGLlPAyIO0CQxPQlo\n'
+ + 'saNJrHf4tLOgZIWk+LpDhNd9Et5EzvJ3aURUsKY4pISPPF5WdvM9OE59bERwUErd\n'
+ + 'nuOuQWQeeadMceZnauRzJQ==\n'
+ + '-----END CERTIFICATE-----\n',
- function setContentLength () {
- if (isTypedArray(self.body)) {
- self.body = Buffer.from(self.body)
- }
+ /**
+ * Amazon RDS us-west-2 certificate CA 2015 to 2020
+ *
+ * CN = Amazon RDS us-west-2 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2015-02-05T22:03:50Z/2020-03-05T22:03:50Z
+ * F = 94:2C:A8:B0:23:48:17:F0:CD:2F:19:7F:C1:E0:21:7C:65:79:13:3A
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBSzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNTBaFw0y\n'
+ + 'MDAzMDUyMjAzNTBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyB1cy13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM\n'
+ + 'H58SR48U6jyERC1vYTnub34smf5EQVXyzaTmspWGWGzT31NLNZGSDFaa7yef9kdO\n'
+ + 'mzJsgebR5tXq6LdwlIoWkKYQ7ycUaadtVKVYdI40QcI3cHn0qLFlg2iBXmWp/B+i\n'
+ + 'Z34VuVlCh31Uj5WmhaBoz8t/GRqh1V/aCsf3Wc6jCezH3QfuCjBpzxdOOHN6Ie2v\n'
+ + 'xX09O5qmZTvMoRBAvPkxdaPg/Mi7fxueWTbEVk78kuFbF1jHYw8U1BLILIAhcqlq\n'
+ + 'x4u8nl73t3O3l/soNUcIwUDK0/S+Kfqhwn9yQyPlhb4Wy3pfnZLJdkyHldktnQav\n'
+ + '9TB9u7KH5Lk0aAYslMLxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT8roM4lRnlFHWMPWRz0zkwFZog1jAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA\n'
+ + 'JwrxwgwmPtcdaU7O7WDdYa4hprpOMamI49NDzmE0s10oGrqmLwZygcWU0jT+fJ+Y\n'
+ + 'pJe1w0CVfKaeLYNsOBVW3X4ZPmffYfWBheZiaiEflq/P6t7/Eg81gaKYnZ/x1Dfa\n'
+ + 'sUYkzPvCkXe9wEz5zdUTOCptDt89rBR9CstL9vE7WYUgiVVmBJffWbHQLtfjv6OF\n'
+ + 'NMb0QME981kGRzc2WhgP71YS2hHd1kXtsoYP1yTu4vThSKsoN4bkiHsaC1cRkLoy\n'
+ + '0fFA4wpB3WloMEvCDaUvvH1LZlBXTNlwi9KtcwD4tDxkkBt4tQczKLGpQ/nF/W9n\n'
+ + '8YDWk3IIc1sd0bkZqoau2Q==\n'
+ + '-----END CERTIFICATE-----\n',
- if (!self.hasHeader('content-length')) {
- var length
- if (typeof self.body === 'string') {
- length = Buffer.byteLength(self.body)
- } else if (Array.isArray(self.body)) {
- length = self.body.reduce(function (a, b) { return a + b.length }, 0)
- } else {
- length = self.body.length
- }
+ /**
+ * Amazon RDS ap-south-1 certificate CA 2016 to 2020
+ *
+ * CN = Amazon RDS ap-south-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2016-05-03T21:29:22Z/2020-03-05T21:29:22Z
+ * F = F3:A3:C2:52:D9:82:20:AC:8C:62:31:2A:8C:AD:5D:7B:1C:31:F1:DD
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/TCCAuWgAwIBAgIBTTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA1MDMyMTI5MjJaFw0y\n'
+ + 'MDAzMDUyMTI5MjJaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEhMB8GA1UEAwwYQW1hem9uIFJE\n'
+ + 'UyBhcC1zb3V0aC0xIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n'
+ + '06eWGLE0TeqL9kyWOLkS8q0fXO97z+xyBV3DKSB2lg2GkgBz3B98MkmkeB0SZy3G\n'
+ + 'Ce4uCpCPbFKiFEdiUclOlhZsrBuCeaimxLM3Ig2wuenElO/7TqgaYHYUbT3d+VQW\n'
+ + 'GUbLn5GRZJZe1OAClYdOWm7A1CKpuo+cVV1vxbY2nGUQSJPpVn2sT9gnwvjdE60U\n'
+ + 'JGYU/RLCTm8zmZBvlWaNIeKDnreIc4rKn6gUnJ2cQn1ryCVleEeyc3xjYDSrjgdn\n'
+ + 'FLYGcp9mphqVT0byeQMOk0c7RHpxrCSA0V5V6/CreFV2LteK50qcDQzDSM18vWP/\n'
+ + 'p09FoN8O7QrtOeZJzH/lmwIDAQABo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0T\n'
+ + 'AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU2i83QHuEl/d0keXF+69HNJph7cMwHwYD\n'
+ + 'VR0jBBgwFoAUTgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQELBQADggEB\n'
+ + 'ACqnH2VjApoDqoSQOky52QBwsGaj+xWYHW5Gm7EvCqvQuhWMkeBuD6YJmMvNyA9G\n'
+ + 'I2lh6/o+sUk/RIsbYbxPRdhNPTOgDR9zsNRw6qxaHztq/CEC+mxDCLa3O1hHBaDV\n'
+ + 'BmB3nCZb93BvO0EQSEk7aytKq/f+sjyxqOcs385gintdHGU9uM7gTZHnU9vByJsm\n'
+ + '/TL07Miq67X0NlhIoo3jAk+xHaeKJdxdKATQp0448P5cY20q4b8aMk1twcNaMvCP\n'
+ + 'dG4M5doaoUA8OQ/0ukLLae/LBxLeTw04q1/a2SyFaVUX2Twbb1S3xVWwLA8vsyGr\n'
+ + 'igXx7B5GgP+IHb6DTjPJAi0=\n'
+ + '-----END CERTIFICATE-----\n',
- if (length) {
- self.setHeader('content-length', length)
- } else {
- self.emit('error', new Error('Argument error, options.body.'))
- }
- }
- }
- if (self.body && !isstream(self.body)) {
- setContentLength()
- }
+ /**
+ * Amazon RDS us-east-2 certificate CA 2016 to 2020
+ *
+ * CN = Amazon RDS us-east-2 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2016-08-11T19:58:45Z/2020-03-05T19:58:45Z
+ * F = 9B:78:E3:64:7F:74:BC:B2:52:18:CF:13:C3:62:B8:35:9D:3D:5F:B6
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBTjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA4MTExOTU4NDVaFw0y\n'
+ + 'MDAzMDUxOTU4NDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyB1cy1lYXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCp\n'
+ + 'WnnUX7wM0zzstccX+4iXKJa9GR0a2PpvB1paEX4QRCgfhEdQWDaSqyrWNgdVCKkt\n'
+ + '1aQkWu5j6VAC2XIG7kKoonm1ZdBVyBLqW5lXNywlaiU9yhJkwo8BR+/OqgE+PLt/\n'
+ + 'EO1mlN0PQudja/XkExCXTO29TG2j7F/O7hox6vTyHNHc0H88zS21uPuBE+jivViS\n'
+ + 'yzj/BkyoQ85hnkues3f9R6gCGdc+J51JbZnmgzUkvXjAEuKhAm9JksVOxcOKUYe5\n'
+ + 'ERhn0U9zjzpfbAITIkul97VVa5IxskFFTHIPJbvRKHJkiF6wTJww/tc9wm+fSCJ1\n'
+ + '+DbQTGZgkQ3bJrqRN29/AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBSAHQzUYYZbepwKEMvGdHp8wzHnfDAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
+ + 'MbaEzSYZ+aZeTBxf8yi0ta8K4RdwEJsEmP6IhFFQHYUtva2Cynl4Q9tZg3RMsybT\n'
+ + '9mlnSQQlbN/wqIIXbkrcgFcHoXG9Odm/bDtUwwwDaiEhXVfeQom3G77QHOWMTCGK\n'
+ + 'qadwuh5msrb17JdXZoXr4PYHDKP7j0ONfAyFNER2+uecblHfRSpVq5UeF3L6ZJb8\n'
+ + 'fSw/GtAV6an+/0r+Qm+PiI2H5XuZ4GmRJYnGMhqWhBYrY7p3jtVnKcsh39wgfUnW\n'
+ + 'AvZEZG/yhFyAZW0Essa39LiL5VSq14Y1DOj0wgnhSY/9WHxaAo1HB1T9OeZknYbD\n'
+ + 'fl/EGSZ0TEvZkENrXcPlVA==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.oauth) {
- self.oauth(options.oauth)
- } else if (self._oauth.params && self.hasHeader('authorization')) {
- self.oauth(self._oauth.params)
- }
+ /**
+ * Amazon RDS ca-central-1 certificate CA 2016 to 2020
+ *
+ * CN = Amazon RDS ca-central-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2016-09-15T00:10:11Z/2020-03-05T00:10:11Z
+ * F = D7:E0:16:AB:8A:0B:63:9F:67:1F:16:87:42:F4:0A:EE:73:A6:FC:04
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/zCCAuegAwIBAgIBTzANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA5MTUwMDEwMTFaFw0y\n'
+ + 'MDAzMDUwMDEwMTFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE\n'
+ + 'UyBjYS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n'
+ + 'AQCZYI/iQ6DrS3ny3t1EwX1wAD+3LMgh7Fd01EW5LIuaK2kYIIQpsVKhxLCit/V5\n'
+ + 'AGc/1qiJS1Qz9ODLTh0Na6bZW6EakRzuHJLe32KJtoFYPC7Z09UqzXrpA/XL+1hM\n'
+ + 'P0ZmCWsU7Nn/EmvfBp9zX3dZp6P6ATrvDuYaVFr+SA7aT3FXpBroqBS1fyzUPs+W\n'
+ + 'c6zTR6+yc4zkHX0XQxC5RH6xjgpeRkoOajA/sNo7AQF7KlWmKHbdVF44cvvAhRKZ\n'
+ + 'XaoVs/C4GjkaAEPTCbopYdhzg+KLx9eB2BQnYLRrIOQZtRfbQI2Nbj7p3VsRuOW1\n'
+ + 'tlcks2w1Gb0YC6w6SuIMFkl1AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV\n'
+ + 'HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBToYWxE1lawl6Ks6NsvpbHQ3GKEtzAf\n'
+ + 'BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOC\n'
+ + 'AQEAG/8tQ0ooi3hoQpa5EJz0/E5VYBsAz3YxA2HoIonn0jJyG16bzB4yZt4vNQMA\n'
+ + 'KsNlQ1uwDWYL1nz63axieUUFIxqxl1KmwfhsmLgZ0Hd2mnTPIl2Hw3uj5+wdgGBg\n'
+ + 'agnAZ0bajsBYgD2VGQbqjdk2Qn7Fjy3LEWIvGZx4KyZ99OJ2QxB7JOPdauURAtWA\n'
+ + 'DKYkP4LLJxtj07DSzG8kuRWb9B47uqUD+eKDIyjfjbnzGtd9HqqzYFau7EX3HVD9\n'
+ + '9Qhnjl7bTZ6YfAEZ3nH2t3Vc0z76XfGh47rd0pNRhMV+xpok75asKf/lNh5mcUrr\n'
+ + 'VKwflyMkQpSbDCmcdJ90N2xEXQ==\n'
+ + '-----END CERTIFICATE-----\n',
- var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
- var defaultModules = {'http:': http, 'https:': https}
- var httpModules = self.httpModules || {}
+ /**
+ * Amazon RDS eu-west-2 certificate CA 2016 to 2020
+ *
+ * CN = Amazon RDS eu-west-2 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2016-10-10T17:44:42Z/2020-03-05T17:44:42Z
+ * F = 47:79:51:9F:FF:07:D3:F4:27:D3:AB:64:56:7F:00:45:BB:84:C1:71
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBUDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjEwMTAxNzQ0NDJaFw0y\n'
+ + 'MDAzMDUxNzQ0NDJaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyBldS13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDO\n'
+ + 'cttLJfubB4XMMIGWNfJISkIdCMGJyOzLiMJaiWB5GYoXKhEl7YGotpy0qklwW3BQ\n'
+ + 'a0fmVdcCLX+dIuVQ9iFK+ZcK7zwm7HtdDTCHOCKeOh2IcnU4c/VIokFi6Gn8udM6\n'
+ + 'N/Zi5M5OGpVwLVALQU7Yctsn3c95el6MdVx6mJiIPVu7tCVZn88Z2koBQ2gq9P4O\n'
+ + 'Sb249SHFqOb03lYDsaqy1NDsznEOhaRBw7DPJFpvmw1lA3/Y6qrExRI06H2VYR2i\n'
+ + '7qxwDV50N58fs10n7Ye1IOxTVJsgEA7X6EkRRXqYaM39Z76R894548WHfwXWjUsi\n'
+ + 'MEX0RS0/t1GmnUQjvevDAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQBxmcuRSxERYCtNnSr5xNfySokHjAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
+ + 'UyCUQjsF3nUAABjfEZmpksTuUo07aT3KGYt+EMMFdejnBQ0+2lJJFGtT+CDAk1SD\n'
+ + 'RSgfEBon5vvKEtlnTf9a3pv8WXOAkhfxnryr9FH6NiB8obISHNQNPHn0ljT2/T+I\n'
+ + 'Y6ytfRvKHa0cu3V0NXbJm2B4KEOt4QCDiFxUIX9z6eB4Kditwu05OgQh6KcogOiP\n'
+ + 'JesWxBMXXGoDC1rIYTFO7szwDyOHlCcVXJDNsTJhc32oDWYdeIbW7o/5I+aQsrXZ\n'
+ + 'C96HykZcgWzz6sElrQxUaT3IoMw/5nmw4uWKKnZnxgI9bY4fpQwMeBZ96iHfFxvH\n'
+ + 'mqfEEuC7uUoPofXdBp2ObQ==\n'
+ + '-----END CERTIFICATE-----\n',
- self.httpModule = httpModules[protocol] || defaultModules[protocol]
+ /**
+ * Amazon RDS us-gov-west-1 CA 2017 to 2022
+ *
+ * CN = Amazon RDS us-gov-west-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2017-05-19T22:31:19Z/2022-05-18T12:00:00Z
+ * F = 77:55:8C:C4:5E:71:1F:1B:57:E3:DA:6E:5B:74:27:12:4E:E8:69:E8
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECjCCAvKgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZMxCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSQwIgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwHhcNMTcwNTE5\n'
+ + 'MjIzMTE5WhcNMjIwNTE4MTIwMDAwWjCBkzELMAkGA1UEBhMCVVMxEzARBgNVBAgM\n'
+ + 'Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBX\n'
+ + 'ZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJDAiBgNVBAMM\n'
+ + 'G0FtYXpvbiBSRFMgdXMtZ292LXdlc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
+ + 'ggEPADCCAQoCggEBAM8YZLKAzzOdNnoi7Klih26Zkj+OCpDfwx4ZYB6f8L8UoQi5\n'
+ + '8z9ZtIwMjiJ/kO08P1yl4gfc7YZcNFvhGruQZNat3YNpxwUpQcr4mszjuffbL4uz\n'
+ + '+/8FBxALdqCVOJ5Q0EVSfz3d9Bd1pUPL7ARtSpy7bn/tUPyQeI+lODYO906C0TQ3\n'
+ + 'b9bjOsgAdBKkHfjLdsknsOZYYIzYWOJyFJJa0B11XjDUNBy/3IuC0KvDl6At0V5b\n'
+ + '8M6cWcKhte2hgjwTYepV+/GTadeube1z5z6mWsN5arOAQUtYDLH6Aztq9mCJzLHm\n'
+ + 'RccBugnGl3fRLJ2VjioN8PoGoN9l9hFBy5fnFgsCAwEAAaNmMGQwDgYDVR0PAQH/\n'
+ + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEG7+br8KkvwPd5g\n'
+ + '71Rvh2stclJbMB8GA1UdIwQYMBaAFEkQz6S4NS5lOYKcDjBSuCcVpdzjMA0GCSqG\n'
+ + 'SIb3DQEBCwUAA4IBAQBMA327u5ABmhX+aPxljoIbxnydmAFWxW6wNp5+rZrvPig8\n'
+ + 'zDRqGQWWr7wWOIjfcWugSElYtf/m9KZHG/Z6+NG7nAoUrdcd1h/IQhb+lFQ2b5g9\n'
+ + 'sVzQv/H2JNkfZA8fL/Ko/Tm/f9tcqe0zrGCtT+5u0Nvz35Wl8CEUKLloS5xEb3k5\n'
+ + '7D9IhG3fsE3vHWlWrGCk1cKry3j12wdPG5cUsug0vt34u6rdhP+FsM0tHI15Kjch\n'
+ + 'RuUCvyQecy2ZFNAa3jmd5ycNdL63RWe8oayRBpQBxPPCbHfILxGZEdJbCH9aJ2D/\n'
+ + 'l8oHIDnvOLdv7/cBjyYuvmprgPtu3QEkbre5Hln/\n'
+ + '-----END CERTIFICATE-----\n',
- if (!self.httpModule) {
- return self.emit('error', new Error('Invalid protocol: ' + protocol))
- }
+ /**
+ * Amazon RDS eu-west-3 certificate CA 2017 to 2020
+ *
+ * CN = Amazon RDS eu-west-3 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2017-08-25T21:39:26Z/2020-03-05T21:39:26Z
+ * F = FD:35:A7:84:60:68:98:00:12:54:ED:34:26:8C:66:0F:72:DD:B2:F4
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIID/DCCAuSgAwIBAgIBUTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzA4MjUyMTM5MjZaFw0y\n'
+ + 'MDAzMDUyMTM5MjZaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE\n'
+ + 'UyBldS13ZXN0LTMgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+\n'
+ + 'xmlEC/3a4cJH+UPwXCE02lC7Zq5NHd0dn6peMeLN8agb6jW4VfSY0NydjRj2DJZ8\n'
+ + 'K7wV6sub5NUGT1NuFmvSmdbNR2T59KX0p2dVvxmXHHtIpQ9Y8Aq3ZfhmC5q5Bqgw\n'
+ + 'tMA1xayDi7HmoPX3R8kk9ktAZQf6lDeksCvok8idjTu9tiSpDiMwds5BjMsWfyjZ\n'
+ + 'd13PTGGNHYVdP692BSyXzSP1Vj84nJKnciW8tAqwIiadreJt5oXyrCXi8ekUMs80\n'
+ + 'cUTuGm3aA3Q7PB5ljJMPqz0eVddaiIvmTJ9O3Ez3Du/HpImyMzXjkFaf+oNXf/Hx\n'
+ + '/EW5jCRR6vEiXJcDRDS7AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB\n'
+ + 'Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBRZ9mRtS5fHk3ZKhG20Oack4cAqMTAfBgNV\n'
+ + 'HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA\n'
+ + 'F/u/9L6ExQwD73F/bhCw7PWcwwqsK1mypIdrjdIsu0JSgwWwGCXmrIspA3n3Dqxq\n'
+ + 'sMhAJD88s9Em7337t+naar2VyLO63MGwjj+vA4mtvQRKq8ScIpiEc7xN6g8HUMsd\n'
+ + 'gPG9lBGfNjuAZsrGJflrko4HyuSM7zHExMjXLH+CXcv/m3lWOZwnIvlVMa4x0Tz0\n'
+ + 'A4fklaawryngzeEjuW6zOiYCzjZtPlP8Fw0SpzppJ8VpQfrZ751RDo4yudmPqoPK\n'
+ + '5EUe36L8U+oYBXnC5TlYs9bpVv9o5wJQI5qA9oQE2eFWxF1E0AyZ4V5sgGUBStaX\n'
+ + 'BjDDWul0wSo7rt1Tq7XpnA==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.ca) {
- self.ca = options.ca
- }
+ /**
+ * Amazon RDS ap-northeast-3 certificate CA 2017 to 2020
+ *
+ * CN = Amazon RDS ap-northeast-3 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2017-12-01T00:55:42Z/2020-03-05T00:55:42Z
+ * F = C0:C7:D4:B3:91:40:A0:77:43:28:BF:AF:77:57:DF:FD:98:FB:10:3F
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEATCCAumgAwIBAgIBTjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx\n'
+ + 'EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzEyMDEwMDU1NDJaFw0y\n'
+ + 'MDAzMDUwMDU1NDJaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv\n'
+ + 'bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl\n'
+ + 'cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE\n'
+ + 'UyBhcC1ub3J0aGVhc3QtMyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\n'
+ + 'ggEBAMZtQNnm/XT19mTa10ftHLzg5UhajoI65JHv4TQNdGXdsv+CQdGYU49BJ9Eu\n'
+ + '3bYgiEtTzR2lQe9zGMvtuJobLhOWuavzp7IixoIQcHkFHN6wJ1CvqrxgvJfBq6Hy\n'
+ + 'EuCDCiU+PPDLUNA6XM6Qx3IpHd1wrJkjRB80dhmMSpxmRmx849uFafhN+P1QybsM\n'
+ + 'TI0o48VON2+vj+mNuQTyLMMP8D4odSQHjaoG+zyJfJGZeAyqQyoOUOFEyQaHC3TT\n'
+ + '3IDSNCQlpxb9LerbCoKu79WFBBq3CS5cYpg8/fsnV2CniRBFFUumBt5z4dhw9RJU\n'
+ + 'qlUXXO1ZyzpGd+c5v6FtrfXtnIUCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG\n'
+ + 'A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFETv7ELNplYy/xTeIOInl6nzeiHg\n'
+ + 'MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA\n'
+ + 'A4IBAQCpKxOQcd0tEKb3OtsOY8q/MPwTyustGk2Rt7t9G68idADp8IytB7M0SDRo\n'
+ + 'wWZqynEq7orQVKdVOanhEWksNDzGp0+FPAf/KpVvdYCd7ru3+iI+V4ZEp2JFdjuZ\n'
+ + 'Zz0PIjS6AgsZqE5Ri1J+NmfmjGZCPhsHnGZiBaenX6K5VRwwwmLN6xtoqrrfR5zL\n'
+ + 'QfBeeZNJG6KiM3R/DxJ5rAa6Fz+acrhJ60L7HprhB7SFtj1RCijau3+ZwiGmUOMr\n'
+ + 'yKlMv+VgmzSw7o4Hbxy1WVrA6zQsTHHSGf+vkQn2PHvnFMUEu/ZLbTDYFNmTLK91\n'
+ + 'K6o4nMsEvhBKgo4z7H1EqqxXhvN2\n'
+ + '-----END CERTIFICATE-----\n',
- if (!self.agent) {
- if (options.agentOptions) {
- self.agentOptions = options.agentOptions
- }
+ /**
+ * Amazon RDS GovCloud Root CA 2017 to 2022
+ *
+ * CN = Amazon RDS GovCloud Root CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2017-05-19T22:29:11Z/2022-05-18T22:29:11Z
+ * F = A3:61:F9:C9:A2:5B:91:FE:73:A6:52:E3:59:14:8E:CE:35:12:0F:FD
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDjCCAvagAwIBAgIJAMM61RQn3/kdMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD\n'
+ + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
+ + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
+ + 'em9uIFJEUzEkMCIGA1UEAwwbQW1hem9uIFJEUyBHb3ZDbG91ZCBSb290IENBMB4X\n'
+ + 'DTE3MDUxOTIyMjkxMVoXDTIyMDUxODIyMjkxMVowgZMxCzAJBgNVBAYTAlVTMRAw\n'
+ + 'DgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQKDBlB\n'
+ + 'bWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSQw\n'
+ + 'IgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwggEiMA0GCSqGSIb3\n'
+ + 'DQEBAQUAA4IBDwAwggEKAoIBAQDGS9bh1FGiJPT+GRb3C5aKypJVDC1H2gbh6n3u\n'
+ + 'j8cUiyMXfmm+ak402zdLpSYMaxiQ7oL/B3wEmumIpRDAsQrSp3B/qEeY7ipQGOfh\n'
+ + 'q2TXjXGIUjiJ/FaoGqkymHRLG+XkNNBtb7MRItsjlMVNELXECwSiMa3nJL2/YyHW\n'
+ + 'nTr1+11/weeZEKgVbCUrOugFkMXnfZIBSn40j6EnRlO2u/NFU5ksK5ak2+j8raZ7\n'
+ + 'xW7VXp9S1Tgf1IsWHjGZZZguwCkkh1tHOlHC9gVA3p63WecjrIzcrR/V27atul4m\n'
+ + 'tn56s5NwFvYPUIx1dbC8IajLUrepVm6XOwdQCfd02DmOyjWJAgMBAAGjYzBhMA4G\n'
+ + 'A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRJEM+kuDUu\n'
+ + 'ZTmCnA4wUrgnFaXc4zAfBgNVHSMEGDAWgBRJEM+kuDUuZTmCnA4wUrgnFaXc4zAN\n'
+ + 'BgkqhkiG9w0BAQsFAAOCAQEAcfA7uirXsNZyI2j4AJFVtOTKOZlQwqbyNducnmlg\n'
+ + '/5nug9fAkwM4AgvF5bBOD1Hw6khdsccMwIj+1S7wpL+EYb/nSc8G0qe1p/9lZ/mZ\n'
+ + 'ff5g4JOa26lLuCrZDqAk4TzYnt6sQKfa5ZXVUUn0BK3okhiXS0i+NloMyaBCL7vk\n'
+ + 'kDwkHwEqflRKfZ9/oFTcCfoiHPA7AdBtaPVr0/Kj9L7k+ouz122huqG5KqX0Zpo8\n'
+ + 'S0IGvcd2FZjNSNPttNAK7YuBVsZ0m2nIH1SLp//00v7yAHIgytQwwB17PBcp4NXD\n'
+ + 'pCfTa27ng9mMMC2YLqWQpW4TkqjDin2ZC+5X/mbrjzTvVg==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.agentClass) {
- self.agentClass = options.agentClass
- } else if (options.forever) {
- var v = version()
- // use ForeverAgent in node 0.10- only
- if (v.major === 0 && v.minor <= 10) {
- self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
- } else {
- self.agentClass = self.httpModule.Agent
- self.agentOptions = self.agentOptions || {}
- self.agentOptions.keepAlive = true
- }
- } else {
- self.agentClass = self.httpModule.Agent
- }
- }
+ /**
+ * Amazon RDS ap-east-1 certificate CA 2019 to 2022
+ *
+ * CN = Amazon RDS ap-east-1 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-02-17T02:47:00Z/2022-06-01T12:00:00Z
+ * F = BC:F8:70:75:1F:93:3F:A7:82:86:67:63:A8:86:1F:A4:E8:07:CE:06
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSUwIwYDVQQDDBxBbWF6b24gUkRTIGFwLWVhc3QtMSBSb290IENBMB4XDTE5MDIx\n'
+ + 'NzAyNDcwMFoXDTIyMDYwMTEyMDAwMFowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQI\n'
+ + 'DApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMSIwIAYDVQQKDBlBbWF6b24g\n'
+ + 'V2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSAwHgYDVQQD\n'
+ + 'DBdBbWF6b24gUkRTIGFwLWVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBAOcJAUofyJuBuPr5ISHi/Ha5ed8h3eGdzn4MBp6rytPOg9NVGRQs\n'
+ + 'O93fNGCIKsUT6gPuk+1f1ncMTV8Y0Fdf4aqGWme+Khm3ZOP3V1IiGnVq0U2xiOmn\n'
+ + 'SQ4Q7LoeQC4lC6zpoCHVJyDjZ4pAknQQfsXb77Togdt/tK5ahev0D+Q3gCwAoBoO\n'
+ + 'DHKJ6t820qPi63AeGbJrsfNjLKiXlFPDUj4BGir4dUzjEeH7/hx37na1XG/3EcxP\n'
+ + '399cT5k7sY/CR9kctMlUyEEUNQOmhi/ly1Lgtihm3QfjL6K9aGLFNwX35Bkh9aL2\n'
+ + 'F058u+n8DP/dPeKUAcJKiQZUmzuen5n57x8CAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFlqgF4FQlb9yP6c+Q3E\n'
+ + 'O3tXv+zOMB8GA1UdIwQYMBaAFK9T6sY/PBZVbnHcNcQXf58P4OuPMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQDeXiS3v1z4jWAo1UvVyKDeHjtrtEH1Rida1eOXauFuEQa5tuOk\n'
+ + 'E53Os4haZCW4mOlKjigWs4LN+uLIAe1aFXGo92nGIqyJISHJ1L+bopx/JmIbHMCZ\n'
+ + '0lTNJfR12yBma5VQy7vzeFku/SisKwX0Lov1oHD4MVhJoHbUJYkmAjxorcIHORvh\n'
+ + 'I3Vj5XrgDWtLDPL8/Id/roul/L+WX5ir+PGScKBfQIIN2lWdZoqdsx8YWqhm/ikL\n'
+ + 'C6qNieSwcvWL7C03ri0DefTQMY54r5wP33QU5hJ71JoaZI3YTeT0Nf+NRL4hM++w\n'
+ + 'Q0veeNzBQXg1f/JxfeA39IDIX1kiCf71tGlT\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.pool === false) {
- self.agent = false
- } else {
- self.agent = self.agent || self.getNewAgent()
- }
+ /**
+ * Amazon RDS ap-northeast-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-northeast-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-18T16:56:20Z/2024-08-22T17:08:50Z
+ * F = 47:A3:F9:20:64:5C:9F:9D:48:8C:7D:E6:0B:86:D6:05:13:00:16:A1
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDDCCAvSgAwIBAgICcEUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNjU2\n'
+ + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
+ + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
+ + 'AAOCAQ8AMIIBCgKCAQEAndtkldmHtk4TVQAyqhAvtEHSMb6pLhyKrIFved1WO3S7\n'
+ + '+I+bWwv9b2W/ljJxLq9kdT43bhvzonNtI4a1LAohS6bqyirmk8sFfsWT3akb+4Sx\n'
+ + '1sjc8Ovc9eqIWJCrUiSvv7+cS7ZTA9AgM1PxvHcsqrcUXiK3Jd/Dax9jdZE1e15s\n'
+ + 'BEhb2OEPE+tClFZ+soj8h8Pl2Clo5OAppEzYI4LmFKtp1X/BOf62k4jviXuCSst3\n'
+ + 'UnRJzE/CXtjmN6oZySVWSe0rQYuyqRl6//9nK40cfGKyxVnimB8XrrcxUN743Vud\n'
+ + 'QQVU0Esm8OVTX013mXWQXJHP2c0aKkog8LOga0vobQIDAQABo2YwZDAOBgNVHQ8B\n'
+ + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQULmoOS1mFSjj+\n'
+ + 'snUPx4DgS3SkLFYwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
+ + 'KoZIhvcNAQELBQADggEBAAkVL2P1M2/G9GM3DANVAqYOwmX0Xk58YBHQu6iiQg4j\n'
+ + 'b4Ky/qsZIsgT7YBsZA4AOcPKQFgGTWhe9pvhmXqoN3RYltN8Vn7TbUm/ZVDoMsrM\n'
+ + 'gwv0+TKxW1/u7s8cXYfHPiTzVSJuOogHx99kBW6b2f99GbP7O1Sv3sLq4j6lVvBX\n'
+ + 'Fiacf5LAWC925nvlTzLlBgIc3O9xDtFeAGtZcEtxZJ4fnGXiqEnN4539+nqzIyYq\n'
+ + 'nvlgCzyvcfRAxwltrJHuuRu6Maw5AGcd2Y0saMhqOVq9KYKFKuD/927BTrbd2JVf\n'
+ + '2sGWyuPZPCk3gq+5pCjbD0c6DkhcMGI6WwxvM5V/zSM=\n'
+ + '-----END CERTIFICATE-----\n',
- self.on('pipe', function (src) {
- if (self.ntick && self._started) {
- self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))
- }
- self.src = src
- if (isReadStream(src)) {
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', mime.lookup(src.path))
- }
- } else {
- if (src.headers) {
- for (var i in src.headers) {
- if (!self.hasHeader(i)) {
- self.setHeader(i, src.headers[i])
- }
- }
- }
- if (self._json && !self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- if (src.method && !self.explicitMethod) {
- self.method = src.method
- }
- }
+ /**
+ * Amazon RDS ap-northeast-2 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-northeast-2 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-10T17:46:21Z/2024-08-22T17:08:50Z
+ * F = 8E:1C:70:C1:64:BD:FC:F9:93:9B:A2:67:CA:CF:52:F0:E1:F7:B4:F0
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDDCCAvSgAwIBAgICOFAwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAxNzQ2\n'
+ + 'MjFaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
+ + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
+ + 'AAOCAQ8AMIIBCgKCAQEAzU72e6XbaJbi4HjJoRNjKxzUEuChKQIt7k3CWzNnmjc5\n'
+ + '8I1MjCpa2W1iw1BYVysXSNSsLOtUsfvBZxi/1uyMn5ZCaf9aeoA9UsSkFSZBjOCN\n'
+ + 'DpKPCmfV1zcEOvJz26+1m8WDg+8Oa60QV0ou2AU1tYcw98fOQjcAES0JXXB80P2s\n'
+ + '3UfkNcnDz+l4k7j4SllhFPhH6BQ4lD2NiFAP4HwoG6FeJUn45EPjzrydxjq6v5Fc\n'
+ + 'cQ8rGuHADVXotDbEhaYhNjIrsPL+puhjWfhJjheEw8c4whRZNp6gJ/b6WEes/ZhZ\n'
+ + 'h32DwsDsZw0BfRDUMgUn8TdecNexHUw8vQWeC181hwIDAQABo2YwZDAOBgNVHQ8B\n'
+ + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwW9bWgkWkr0U\n'
+ + 'lrOsq2kvIdrECDgwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
+ + 'KoZIhvcNAQELBQADggEBAEugF0Gj7HVhX0ehPZoGRYRt3PBuI2YjfrrJRTZ9X5wc\n'
+ + '9T8oHmw07mHmNy1qqWvooNJg09bDGfB0k5goC2emDiIiGfc/kvMLI7u+eQOoMKj6\n'
+ + 'mkfCncyRN3ty08Po45vTLBFZGUvtQmjM6yKewc4sXiASSBmQUpsMbiHRCL72M5qV\n'
+ + 'obcJOjGcIdDTmV1BHdWT+XcjynsGjUqOvQWWhhLPrn4jWe6Xuxll75qlrpn3IrIx\n'
+ + 'CRBv/5r7qbcQJPOgwQsyK4kv9Ly8g7YT1/vYBlR3cRsYQjccw5ceWUj2DrMVWhJ4\n'
+ + 'prf+E3Aa4vYmLLOUUvKnDQ1k3RGNu56V0tonsQbfsaM=\n'
+ + '-----END CERTIFICATE-----\n',
- // self.on('pipe', function () {
- // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
- // })
- })
+ /**
+ * Amazon RDS ap-northeast-3 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-northeast-3 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-17T20:05:29Z/2024-08-22T17:08:50Z
+ * F = D1:08:B1:40:6D:6C:80:8E:F4:C1:2C:8A:1F:66:17:01:54:CD:1A:4E
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDDCCAvSgAwIBAgICOYIwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTcyMDA1\n'
+ + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
+ + 'em9uIFJEUyBhcC1ub3J0aGVhc3QtMyAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
+ + 'AAOCAQ8AMIIBCgKCAQEA4dMak8W+XW8y/2F6nRiytFiA4XLwePadqWebGtlIgyCS\n'
+ + 'kbug8Jv5w7nlMkuxOxoUeD4WhI6A9EkAn3r0REM/2f0aYnd2KPxeqS2MrtdxxHw1\n'
+ + 'xoOxk2x0piNSlOz6yog1idsKR5Wurf94fvM9FdTrMYPPrDabbGqiBMsZZmoHLvA3\n'
+ + 'Z+57HEV2tU0Ei3vWeGIqnNjIekS+E06KhASxrkNU5vi611UsnYZlSi0VtJsH4UGV\n'
+ + 'LhnHl53aZL0YFO5mn/fzuNG/51qgk/6EFMMhaWInXX49Dia9FnnuWXwVwi6uX1Wn\n'
+ + '7kjoHi5VtmC8ZlGEHroxX2DxEr6bhJTEpcLMnoQMqwIDAQABo2YwZDAOBgNVHQ8B\n'
+ + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUsUI5Cb3SWB8+\n'
+ + 'gv1YLN/ABPMdxSAwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
+ + 'KoZIhvcNAQELBQADggEBAJAF3E9PM1uzVL8YNdzb6fwJrxxqI2shvaMVmC1mXS+w\n'
+ + 'G0zh4v2hBZOf91l1EO0rwFD7+fxoI6hzQfMxIczh875T6vUXePKVOCOKI5wCrDad\n'
+ + 'zQbVqbFbdhsBjF4aUilOdtw2qjjs9JwPuB0VXN4/jY7m21oKEOcnpe36+7OiSPjN\n'
+ + 'xngYewCXKrSRqoj3mw+0w/+exYj3Wsush7uFssX18av78G+ehKPIVDXptOCP/N7W\n'
+ + '8iKVNeQ2QGTnu2fzWsGUSvMGyM7yqT+h1ILaT//yQS8er511aHMLc142bD4D9VSy\n'
+ + 'DgactwPDTShK/PXqhvNey9v/sKXm4XatZvwcc8KYlW4=\n'
+ + '-----END CERTIFICATE-----\n',
- defer(function () {
- if (self._aborted) {
- return
- }
+ /**
+ * Amazon RDS ap-south-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-south-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-04T17:13:04Z/2024-08-22T17:08:50Z
+ * F = D6:AD:45:A9:54:36:E4:BA:9C:B7:9B:06:8C:0C:CD:CC:1E:81:B5:00
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECDCCAvCgAwIBAgICVIYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDQxNzEz\n'
+ + 'MDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h\n'
+ + 'em9uIFJEUyBhcC1zb3V0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
+ + 'DwAwggEKAoIBAQDUYOz1hGL42yUCrcsMSOoU8AeD/3KgZ4q7gP+vAz1WnY9K/kim\n'
+ + 'eWN/2Qqzlo3+mxSFQFyD4MyV3+CnCPnBl9Sh1G/F6kThNiJ7dEWSWBQGAB6HMDbC\n'
+ + 'BaAsmUc1UIz8sLTL3fO+S9wYhA63Wun0Fbm/Rn2yk/4WnJAaMZcEtYf6e0KNa0LM\n'
+ + 'p/kN/70/8cD3iz3dDR8zOZFpHoCtf0ek80QqTich0A9n3JLxR6g6tpwoYviVg89e\n'
+ + 'qCjQ4axxOkWWeusLeTJCcY6CkVyFvDAKvcUl1ytM5AiaUkXblE7zDFXRM4qMMRdt\n'
+ + 'lPm8d3pFxh0fRYk8bIKnpmtOpz3RIctDrZZxAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
+ + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBT99wKJftD3jb4sHoHG\n'
+ + 'i3uGlH6W6TAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
+ + '9w0BAQsFAAOCAQEAZ17hhr3dII3hUfuHQ1hPWGrpJOX/G9dLzkprEIcCidkmRYl+\n'
+ + 'hu1Pe3caRMh/17+qsoEErmnVq5jNY9X1GZL04IZH8YbHc7iRHw3HcWAdhN8633+K\n'
+ + 'jYEB2LbJ3vluCGnCejq9djDb6alOugdLMJzxOkHDhMZ6/gYbECOot+ph1tQuZXzD\n'
+ + 'tZ7prRsrcuPBChHlPjmGy8M9z8u+kF196iNSUGC4lM8vLkHM7ycc1/ZOwRq9aaTe\n'
+ + 'iOghbQQyAEe03MWCyDGtSmDfr0qEk+CHN+6hPiaL8qKt4s+V9P7DeK4iW08ny8Ox\n'
+ + 'AVS7u0OK/5+jKMAMrKwpYrBydOjTUTHScocyNw==\n'
+ + '-----END CERTIFICATE-----\n',
- var end = function () {
- if (self._form) {
- if (!self._auth.hasAuth) {
- self._form.pipe(self)
- } else if (self._auth.hasAuth && self._auth.sentAuth) {
- self._form.pipe(self)
- }
- }
- if (self._multipart && self._multipart.chunked) {
- self._multipart.body.pipe(self)
- }
- if (self.body) {
- if (isstream(self.body)) {
- self.body.pipe(self)
- } else {
- setContentLength()
- if (Array.isArray(self.body)) {
- self.body.forEach(function (part) {
- self.write(part)
- })
- } else {
- self.write(self.body)
- }
- self.end()
- }
- } else if (self.requestBodyStream) {
- console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
- self.requestBodyStream.pipe(self)
- } else if (!self.src) {
- if (self._auth.hasAuth && !self._auth.sentAuth) {
- self.end()
- return
- }
- if (self.method !== 'GET' && typeof self.method !== 'undefined') {
- self.setHeader('content-length', 0)
- }
- self.end()
- }
- }
+ /**
+ * Amazon RDS ap-southeast-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-southeast-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-13T20:11:42Z/2024-08-22T17:08:50Z
+ * F = 0D:20:FB:91:DE:BE:D2:CF:F3:F8:F8:43:AF:68:C6:03:76:F3:DD:B8
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDDCCAvSgAwIBAgICY4kwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTMyMDEx\n'
+ + 'NDJaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
+ + 'em9uIFJEUyBhcC1zb3V0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
+ + 'AAOCAQ8AMIIBCgKCAQEAr5u9OuLL/OF/fBNUX2kINJLzFl4DnmrhnLuSeSnBPgbb\n'
+ + 'qddjf5EFFJBfv7IYiIWEFPDbDG5hoBwgMup5bZDbas+ZTJTotnnxVJTQ6wlhTmns\n'
+ + 'eHECcg2pqGIKGrxZfbQhlj08/4nNAPvyYCTS0bEcmQ1emuDPyvJBYDDLDU6AbCB5\n'
+ + '6Z7YKFQPTiCBblvvNzchjLWF9IpkqiTsPHiEt21sAdABxj9ityStV3ja/W9BfgxH\n'
+ + 'wzABSTAQT6FbDwmQMo7dcFOPRX+hewQSic2Rn1XYjmNYzgEHisdUsH7eeXREAcTw\n'
+ + '61TRvaLH8AiOWBnTEJXPAe6wYfrcSd1pD0MXpoB62wIDAQABo2YwZDAOBgNVHQ8B\n'
+ + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUytwMiomQOgX5\n'
+ + 'Ichd+2lDWRUhkikwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
+ + 'KoZIhvcNAQELBQADggEBACf6lRDpfCD7BFRqiWM45hqIzffIaysmVfr+Jr+fBTjP\n'
+ + 'uYe/ba1omSrNGG23bOcT9LJ8hkQJ9d+FxUwYyICQNWOy6ejicm4z0C3VhphbTPqj\n'
+ + 'yjpt9nG56IAcV8BcRJh4o/2IfLNzC/dVuYJV8wj7XzwlvjysenwdrJCoLadkTr1h\n'
+ + 'eIdG6Le07sB9IxrGJL9e04afk37h7c8ESGSE4E+oS4JQEi3ATq8ne1B9DQ9SasXi\n'
+ + 'IRmhNAaISDzOPdyLXi9N9V9Lwe/DHcja7hgLGYx3UqfjhLhOKwp8HtoZORixAmOI\n'
+ + 'HfILgNmwyugAbuZoCazSKKBhQ0wgO0WZ66ZKTMG8Oho=\n'
+ + '-----END CERTIFICATE-----\n',
- if (self._form && !self.hasHeader('content-length')) {
- // Before ending the request, we had to compute the length of the whole form, asyncly
- self.setHeader(self._form.getHeaders(), true)
- self._form.getLength(function (err, length) {
- if (!err && !isNaN(length)) {
- self.setHeader('content-length', length)
- }
- end()
- })
- } else {
- end()
- }
+ /**
+ * Amazon RDS ap-southeast-2 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ap-southeast-2 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-16T19:53:47Z/2024-08-22T17:08:50Z
+ * F = D5:D4:51:83:D9:A3:AC:47:B0:0A:5A:77:D8:A0:79:A9:6A:3F:6D:96
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEDDCCAvSgAwIBAgICEkYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxOTUz\n'
+ + 'NDdaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h\n'
+ + 'em9uIFJEUyBhcC1zb3V0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF\n'
+ + 'AAOCAQ8AMIIBCgKCAQEAufodI2Flker8q7PXZG0P0vmFSlhQDw907A6eJuF/WeMo\n'
+ + 'GHnll3b4S6nC3oRS3nGeRMHbyU2KKXDwXNb3Mheu+ox+n5eb/BJ17eoj9HbQR1cd\n'
+ + 'gEkIciiAltf8gpMMQH4anP7TD+HNFlZnP7ii3geEJB2GGXSxgSWvUzH4etL67Zmn\n'
+ + 'TpGDWQMB0T8lK2ziLCMF4XAC/8xDELN/buHCNuhDpxpPebhct0T+f6Arzsiswt2j\n'
+ + '7OeNeLLZwIZvVwAKF7zUFjC6m7/VmTQC8nidVY559D6l0UhhU0Co/txgq3HVsMOH\n'
+ + 'PbxmQUwJEKAzQXoIi+4uZzHFZrvov/nDTNJUhC6DqwIDAQABo2YwZDAOBgNVHQ8B\n'
+ + 'Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwaZpaCme+EiV\n'
+ + 'M5gcjeHZSTgOn4owHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ\n'
+ + 'KoZIhvcNAQELBQADggEBAAR6a2meCZuXO2TF9bGqKGtZmaah4pH2ETcEVUjkvXVz\n'
+ + 'sl+ZKbYjrun+VkcMGGKLUjS812e7eDF726ptoku9/PZZIxlJB0isC/0OyixI8N4M\n'
+ + 'NsEyvp52XN9QundTjkl362bomPnHAApeU0mRbMDRR2JdT70u6yAzGLGsUwMkoNnw\n'
+ + '1VR4XKhXHYGWo7KMvFrZ1KcjWhubxLHxZWXRulPVtGmyWg/MvE6KF+2XMLhojhUL\n'
+ + '+9jB3Fpn53s6KMx5tVq1x8PukHmowcZuAF8k+W4gk8Y68wIwynrdZrKRyRv6CVtR\n'
+ + 'FZ8DeJgoNZT3y/GT254VqMxxfuy2Ccb/RInd16tEvVk=\n'
+ + '-----END CERTIFICATE-----\n',
- self.ntick = true
- })
-}
+ /**
+ * Amazon RDS ca-central-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS ca-central-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-10T20:52:25Z/2024-08-22T17:08:50Z
+ * F = A1:03:46:F2:BB:29:BF:4F:EC:04:7E:82:9A:A6:C0:11:4D:AB:82:25
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECjCCAvKgAwIBAgICEzUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAyMDUy\n'
+ + 'MjVaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h\n'
+ + 'em9uIFJEUyBjYS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
+ + 'ggEPADCCAQoCggEBAOxHqdcPSA2uBjsCP4DLSlqSoPuQ/X1kkJLusVRKiQE2zayB\n'
+ + 'viuCBt4VB9Qsh2rW3iYGM+usDjltGnI1iUWA5KHcvHszSMkWAOYWLiMNKTlg6LCp\n'
+ + 'XnE89tvj5dIH6U8WlDvXLdjB/h30gW9JEX7S8supsBSci2GxEzb5mRdKaDuuF/0O\n'
+ + 'qvz4YE04pua3iZ9QwmMFuTAOYzD1M72aOpj+7Ac+YLMM61qOtU+AU6MndnQkKoQi\n'
+ + 'qmUN2A9IFaqHFzRlSdXwKCKUA4otzmz+/N3vFwjb5F4DSsbsrMfjeHMo6o/nb6Nh\n'
+ + 'YDb0VJxxPee6TxSuN7CQJ2FxMlFUezcoXqwqXD0CAwEAAaNmMGQwDgYDVR0PAQH/\n'
+ + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFDGGpon9WfIpsggE\n'
+ + 'CxHq8hZ7E2ESMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG\n'
+ + 'SIb3DQEBCwUAA4IBAQAvpeQYEGZvoTVLgV9rd2+StPYykMsmFjWQcyn3dBTZRXC2\n'
+ + 'lKq7QhQczMAOhEaaN29ZprjQzsA2X/UauKzLR2Uyqc2qOeO9/YOl0H3qauo8C/W9\n'
+ + 'r8xqPbOCDLEXlOQ19fidXyyEPHEq5WFp8j+fTh+s8WOx2M7IuC0ANEetIZURYhSp\n'
+ + 'xl9XOPRCJxOhj7JdelhpweX0BJDNHeUFi0ClnFOws8oKQ7sQEv66d5ddxqqZ3NVv\n'
+ + 'RbCvCtEutQMOUMIuaygDlMn1anSM8N7Wndx8G6+Uy67AnhjGx7jw/0YPPxopEj6x\n'
+ + 'JXP8j0sJbcT9K/9/fPVLNT25RvQ/93T2+IQL4Ca2\n'
+ + '-----END CERTIFICATE-----\n',
-Request.prototype.getNewAgent = function () {
- var self = this
- var Agent = self.agentClass
- var options = {}
- if (self.agentOptions) {
- for (var i in self.agentOptions) {
- options[i] = self.agentOptions[i]
- }
- }
- if (self.ca) {
- options.ca = self.ca
- }
- if (self.ciphers) {
- options.ciphers = self.ciphers
- }
- if (self.secureProtocol) {
- options.secureProtocol = self.secureProtocol
- }
- if (self.secureOptions) {
- options.secureOptions = self.secureOptions
- }
- if (typeof self.rejectUnauthorized !== 'undefined') {
- options.rejectUnauthorized = self.rejectUnauthorized
- }
+ /**
+ * Amazon RDS eu-central-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS eu-central-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-11T19:36:20Z/2024-08-22T17:08:50Z
+ * F = 53:46:18:4A:42:65:A2:8C:5F:5B:0A:AD:E2:2C:80:E5:E6:8A:6D:2F
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECjCCAvKgAwIBAgICV2YwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExOTM2\n'
+ + 'MjBaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h\n'
+ + 'em9uIFJEUyBldS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\n'
+ + 'ggEPADCCAQoCggEBAMEx54X2pHVv86APA0RWqxxRNmdkhAyp2R1cFWumKQRofoFv\n'
+ + 'n+SPXdkpIINpMuEIGJANozdiEz7SPsrAf8WHyD93j/ZxrdQftRcIGH41xasetKGl\n'
+ + 'I67uans8d+pgJgBKGb/Z+B5m+UsIuEVekpvgpwKtmmaLFC/NCGuSsJoFsRqoa6Gh\n'
+ + 'm34W6yJoY87UatddCqLY4IIXaBFsgK9Q/wYzYLbnWM6ZZvhJ52VMtdhcdzeTHNW0\n'
+ + '5LGuXJOF7Ahb4JkEhoo6TS2c0NxB4l4MBfBPgti+O7WjR3FfZHpt18A6Zkq6A2u6\n'
+ + 'D/oTSL6c9/3sAaFTFgMyL3wHb2YlW0BPiljZIqECAwEAAaNmMGQwDgYDVR0PAQH/\n'
+ + 'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFOcAToAc6skWffJa\n'
+ + 'TnreaswAfrbcMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG\n'
+ + 'SIb3DQEBCwUAA4IBAQA1d0Whc1QtspK496mFWfFEQNegLh0a9GWYlJm+Htcj5Nxt\n'
+ + 'DAIGXb+8xrtOZFHmYP7VLCT5Zd2C+XytqseK/+s07iAr0/EPF+O2qcyQWMN5KhgE\n'
+ + 'cXw2SwuP9FPV3i+YAm11PBVeenrmzuk9NrdHQ7TxU4v7VGhcsd2C++0EisrmquWH\n'
+ + 'mgIfmVDGxphwoES52cY6t3fbnXmTkvENvR+h3rj+fUiSz0aSo+XZUGHPgvuEKM/W\n'
+ + 'CBD9Smc9CBoBgvy7BgHRgRUmwtABZHFUIEjHI5rIr7ZvYn+6A0O6sogRfvVYtWFc\n'
+ + 'qpyrW1YX8mD0VlJ8fGKM3G+aCOsiiPKDV/Uafrm+\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.cert && self.key) {
- options.key = self.key
- options.cert = self.cert
- }
+ /**
+ * Amazon RDS eu-north-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS eu-north-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-12T18:19:44Z/2024-08-22T17:08:50Z
+ * F = D0:CA:9C:6E:47:4C:4F:DB:85:28:03:4A:60:AC:14:E0:E6:DF:D4:42
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECDCCAvCgAwIBAgICGAcwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIxODE5\n'
+ + 'NDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h\n'
+ + 'em9uIFJEUyBldS1ub3J0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
+ + 'DwAwggEKAoIBAQCiIYnhe4UNBbdBb/nQxl5giM0XoVHWNrYV5nB0YukA98+TPn9v\n'
+ + 'Aoj1RGYmtryjhrf01Kuv8SWO+Eom95L3zquoTFcE2gmxCfk7bp6qJJ3eHOJB+QUO\n'
+ + 'XsNRh76fwDzEF1yTeZWH49oeL2xO13EAx4PbZuZpZBttBM5zAxgZkqu4uWQczFEs\n'
+ + 'JXfla7z2fvWmGcTagX10O5C18XaFroV0ubvSyIi75ue9ykg/nlFAeB7O0Wxae88e\n'
+ + 'uhiBEFAuLYdqWnsg3459NfV8Yi1GnaitTym6VI3tHKIFiUvkSiy0DAlAGV2iiyJE\n'
+ + 'q+DsVEO4/hSINJEtII4TMtysOsYPpINqeEzRAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
+ + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRR0UpnbQyjnHChgmOc\n'
+ + 'hnlc0PogzTAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
+ + '9w0BAQsFAAOCAQEAKJD4xVzSf4zSGTBJrmamo86jl1NHQxXUApAZuBZEc8tqC6TI\n'
+ + 'T5CeoSr9CMuVC8grYyBjXblC4OsM5NMvmsrXl/u5C9dEwtBFjo8mm53rOOIm1fxl\n'
+ + 'I1oYB/9mtO9ANWjkykuLzWeBlqDT/i7ckaKwalhLODsRDO73vRhYNjsIUGloNsKe\n'
+ + 'pxw3dzHwAZx4upSdEVG4RGCZ1D0LJ4Gw40OfD69hfkDfRVVxKGrbEzqxXRvovmDc\n'
+ + 'tKLdYZO/6REoca36v4BlgIs1CbUXJGLSXUwtg7YXGLSVBJ/U0+22iGJmBSNcoyUN\n'
+ + 'cjPFD9JQEhDDIYYKSGzIYpvslvGc4T5ISXFiuQ==\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.pfx) {
- options.pfx = self.pfx
- }
+ /**
+ * Amazon RDS eu-west-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS eu-west-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-11T17:31:48Z/2024-08-22T17:08:50Z
+ * F = 2D:1A:A6:3E:0D:EB:D6:26:03:3E:A1:8A:0A:DF:14:80:78:EC:B6:63
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICYpgwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExNzMx\n'
+ + 'NDhaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyBldS13ZXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBAMk3YdSZ64iAYp6MyyKtYJtNzv7zFSnnNf6vv0FB4VnfITTMmOyZ\n'
+ + 'LXqKAT2ahZ00hXi34ewqJElgU6eUZT/QlzdIu359TEZyLVPwURflL6SWgdG01Q5X\n'
+ + 'O++7fSGcBRyIeuQWs9FJNIIqK8daF6qw0Rl5TXfu7P9dBc3zkgDXZm2DHmxGDD69\n'
+ + '7liQUiXzoE1q2Z9cA8+jirDioJxN9av8hQt12pskLQumhlArsMIhjhHRgF03HOh5\n'
+ + 'tvi+RCfihVOxELyIRTRpTNiIwAqfZxxTWFTgfn+gijTmd0/1DseAe82aYic8JbuS\n'
+ + 'EMbrDduAWsqrnJ4GPzxHKLXX0JasCUcWyMECAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPLtsq1NrwJXO13C9eHt\n'
+ + 'sLY11AGwMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQAnWBKj5xV1A1mYd0kIgDdkjCwQkiKF5bjIbGkT3YEFFbXoJlSP\n'
+ + '0lZZ/hDaOHI8wbLT44SzOvPEEmWF9EE7SJzkvSdQrUAWR9FwDLaU427ALI3ngNHy\n'
+ + 'lGJ2hse1fvSRNbmg8Sc9GBv8oqNIBPVuw+AJzHTacZ1OkyLZrz1c1QvwvwN2a+Jd\n'
+ + 'vH0V0YIhv66llKcYDMUQJAQi4+8nbRxXWv6Gq3pvrFoorzsnkr42V3JpbhnYiK+9\n'
+ + 'nRKd4uWl62KRZjGkfMbmsqZpj2fdSWMY1UGyN1k+kDmCSWYdrTRDP0xjtIocwg+A\n'
+ + 'J116n4hV/5mbA0BaPiS2krtv17YAeHABZcvz\n'
+ + '-----END CERTIFICATE-----\n',
- if (self.passphrase) {
- options.passphrase = self.passphrase
- }
+ /**
+ * Amazon RDS eu-west-2 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS eu-west-2 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-12T21:32:32Z/2024-08-22T17:08:50Z
+ * F = 60:65:44:F4:74:6E:2E:29:50:19:38:7C:4B:BE:18:B9:5B:D4:CD:23
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICZIEwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIyMTMy\n'
+ + 'MzJaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyBldS13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBALGiwqjiF7xIjT0Sx7zB3764K2T2a1DHnAxEOr+/EIftWKxWzT3u\n'
+ + 'PFwS2eEZcnKqSdRQ+vRzonLBeNLO4z8aLjQnNbkizZMBuXGm4BqRm1Kgq3nlLDQn\n'
+ + '7YqdijOq54SpShvR/8zsO4sgMDMmHIYAJJOJqBdaus2smRt0NobIKc0liy7759KB\n'
+ + '6kmQ47Gg+kfIwxrQA5zlvPLeQImxSoPi9LdbRoKvu7Iot7SOa+jGhVBh3VdqndJX\n'
+ + '7tm/saj4NE375csmMETFLAOXjat7zViMRwVorX4V6AzEg1vkzxXpA9N7qywWIT5Y\n'
+ + 'fYaq5M8i6vvLg0CzrH9fHORtnkdjdu1y+0MCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFOhOx1yt3Z7mvGB9jBv\n'
+ + '2ymdZwiOMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQBehqY36UGDvPVU9+vtaYGr38dBbp+LzkjZzHwKT1XJSSUc2wqM\n'
+ + 'hnCIQKilonrTIvP1vmkQi8qHPvDRtBZKqvz/AErW/ZwQdZzqYNFd+BmOXaeZWV0Q\n'
+ + 'oHtDzXmcwtP8aUQpxN0e1xkWb1E80qoy+0uuRqb/50b/R4Q5qqSfJhkn6z8nwB10\n'
+ + '7RjLtJPrK8igxdpr3tGUzfAOyiPrIDncY7UJaL84GFp7WWAkH0WG3H8Y8DRcRXOU\n'
+ + 'mqDxDLUP3rNuow3jnGxiUY+gGX5OqaZg4f4P6QzOSmeQYs6nLpH0PiN00+oS1BbD\n'
+ + 'bpWdZEttILPI+vAYkU4QuBKKDjJL6HbSd+cn\n'
+ + '-----END CERTIFICATE-----\n',
- var poolKey = ''
+ /**
+ * Amazon RDS eu-west-3 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS eu-west-3 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-18T17:03:15Z/2024-08-22T17:08:50Z
+ * F = 6F:79:56:B0:74:9C:C6:3E:3B:50:26:C8:51:55:08:F0:BB:7E:32:04
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICJDQwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNzAz\n'
+ + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyBldS13ZXN0LTMgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBAL9bL7KE0n02DLVtlZ2PL+g/BuHpMYFq2JnE2RgompGurDIZdjmh\n'
+ + '1pxfL3nT+QIVMubuAOy8InRfkRxfpxyjKYdfLJTPJG+jDVL+wDcPpACFVqoV7Prg\n'
+ + 'pVYEV0lc5aoYw4bSeYFhdzgim6F8iyjoPnObjll9mo4XsHzSoqJLCd0QC+VG9Fw2\n'
+ + 'q+GDRZrLRmVM2oNGDRbGpGIFg77aRxRapFZa8SnUgs2AqzuzKiprVH5i0S0M6dWr\n'
+ + 'i+kk5epmTtkiDHceX+dP/0R1NcnkCPoQ9TglyXyPdUdTPPRfKCq12dftqll+u4mV\n'
+ + 'ARdN6WFjovxax8EAP2OAUTi1afY+1JFMj+sCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLfhrbrO5exkCVgxW0x3\n'
+ + 'Y2mAi8lNMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQAigQ5VBNGyw+OZFXwxeJEAUYaXVoP/qrhTOJ6mCE2DXUVEoJeV\n'
+ + 'SxScy/TlFA9tJXqmit8JH8VQ/xDL4ubBfeMFAIAo4WzNWDVoeVMqphVEcDWBHsI1\n'
+ + 'AETWzfsapRS9yQekOMmxg63d/nV8xewIl8aNVTHdHYXMqhhik47VrmaVEok1UQb3\n'
+ + 'O971RadLXIEbVd9tjY5bMEHm89JsZDnDEw1hQXBb67Elu64OOxoKaHBgUH8AZn/2\n'
+ + 'zFsL1ynNUjOhCSAA15pgd1vjwc0YsBbAEBPcHBWYBEyME6NLNarjOzBl4FMtATSF\n'
+ + 'wWCKRGkvqN8oxYhwR2jf2rR5Mu4DWkK5Q8Ep\n'
+ + '-----END CERTIFICATE-----\n',
- // different types of agents are in different pools
- if (Agent !== self.httpModule.Agent) {
- poolKey += Agent.name
- }
+ /**
+ * Amazon RDS me-south-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS me-south-1 Root CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-05-10T21:48:27Z/2024-05-08T21:48:27Z
+ * F = 8A:69:D7:00:FB:5D:62:9C:B0:D1:75:6F:B7:B6:38:AA:76:C4:BD:1F
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEEjCCAvqgAwIBAgIJANew34ehz5l8MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD\n'
+ + 'VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi\n'
+ + 'MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h\n'
+ + 'em9uIFJEUzEmMCQGA1UEAwwdQW1hem9uIFJEUyBtZS1zb3V0aC0xIFJvb3QgQ0Ew\n'
+ + 'HhcNMTkwNTEwMjE0ODI3WhcNMjQwNTA4MjE0ODI3WjCBlTELMAkGA1UEBhMCVVMx\n'
+ + 'EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoM\n'
+ + 'GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx\n'
+ + 'JjAkBgNVBAMMHUFtYXpvbiBSRFMgbWUtc291dGgtMSBSb290IENBMIIBIjANBgkq\n'
+ + 'hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp7BYV88MukcY+rq0r79+C8UzkT30fEfT\n'
+ + 'aPXbx1d6M7uheGN4FMaoYmL+JE1NZPaMRIPTHhFtLSdPccInvenRDIatcXX+jgOk\n'
+ + 'UA6lnHQ98pwN0pfDUyz/Vph4jBR9LcVkBbe0zdoKKp+HGbMPRU0N2yNrog9gM5O8\n'
+ + 'gkU/3O2csJ/OFQNnj4c2NQloGMUpEmedwJMOyQQfcUyt9CvZDfIPNnheUS29jGSw\n'
+ + 'ERpJe/AENu8Pxyc72jaXQuD+FEi2Ck6lBkSlWYQFhTottAeGvVFNCzKszCntrtqd\n'
+ + 'rdYUwurYsLTXDHv9nW2hfDUQa0mhXf9gNDOBIVAZugR9NqNRNyYLHQIDAQABo2Mw\n'
+ + 'YTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU54cf\n'
+ + 'DjgwBx4ycBH8+/r8WXdaiqYwHwYDVR0jBBgwFoAU54cfDjgwBx4ycBH8+/r8WXda\n'
+ + 'iqYwDQYJKoZIhvcNAQELBQADggEBAIIMTSPx/dR7jlcxggr+O6OyY49Rlap2laKA\n'
+ + 'eC/XI4ySP3vQkIFlP822U9Kh8a9s46eR0uiwV4AGLabcu0iKYfXjPkIprVCqeXV7\n'
+ + 'ny9oDtrbflyj7NcGdZLvuzSwgl9SYTJp7PVCZtZutsPYlbJrBPHwFABvAkMvRtDB\n'
+ + 'hitIg4AESDGPoCl94sYHpfDfjpUDMSrAMDUyO6DyBdZH5ryRMAs3lGtsmkkNUrso\n'
+ + 'aTW6R05681Z0mvkRdb+cdXtKOSuDZPoe2wJJIaz3IlNQNSrB5TImMYgmt6iAsFhv\n'
+ + '3vfTSTKrZDNTJn4ybG6pq1zWExoXsktZPylJly6R3RBwV6nwqBM=\n'
+ + '-----END CERTIFICATE-----\n',
- // ca option is only relevant if proxy or destination are https
- var proxy = self.proxy
- if (typeof proxy === 'string') {
- proxy = url.parse(proxy)
- }
- var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
+ /**
+ * Amazon RDS sa-east-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS sa-east-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-05T18:46:29Z/2024-08-22T17:08:50Z
+ * F = 8C:34:0F:AA:FB:10:80:9C:05:CE:D7:BF:0B:12:4D:07:42:39:74:7A
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICQ2QwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDUxODQ2\n'
+ + 'MjlaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyBzYS1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBAMMvR+ReRnOzqJzoaPipNTt1Z2VA968jlN1+SYKUrYM3No+Vpz0H\n'
+ + 'M6Tn0oYB66ByVsXiGc28ulsqX1HbHsxqDPwvQTKvO7SrmDokoAkjJgLocOLUAeld\n'
+ + '5AwvUjxGRP6yY90NV7X786MpnYb2Il9DIIaV9HjCmPt+rjy2CZjS0UjPjCKNfB8J\n'
+ + 'bFjgW6GGscjeyGb/zFwcom5p4j0rLydbNaOr9wOyQrtt3ZQWLYGY9Zees/b8pmcc\n'
+ + 'Jt+7jstZ2UMV32OO/kIsJ4rMUn2r/uxccPwAc1IDeRSSxOrnFKhW3Cu69iB3bHp7\n'
+ + 'JbawY12g7zshE4I14sHjv3QoXASoXjx4xgMCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFI1Fc/Ql2jx+oJPgBVYq\n'
+ + 'ccgP0pQ8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQB4VVVabVp70myuYuZ3vltQIWqSUMhkaTzehMgGcHjMf9iLoZ/I\n'
+ + '93KiFUSGnek5cRePyS9wcpp0fcBT3FvkjpUdCjVtdttJgZFhBxgTd8y26ImdDDMR\n'
+ + '4+BUuhI5msvjL08f+Vkkpu1GQcGmyFVPFOy/UY8iefu+QyUuiBUnUuEDd49Hw0Fn\n'
+ + '/kIPII6Vj82a2mWV/Q8e+rgN8dIRksRjKI03DEoP8lhPlsOkhdwU6Uz9Vu6NOB2Q\n'
+ + 'Ls1kbcxAc7cFSyRVJEhh12Sz9d0q/CQSTFsVJKOjSNQBQfVnLz1GwO/IieUEAr4C\n'
+ + 'jkTntH0r1LX5b/GwN4R887LvjAEdTbg1his7\n'
+ + '-----END CERTIFICATE-----\n',
- if (isHttps) {
- if (options.ca) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.ca
- }
+ /**
+ * Amazon RDS us-east-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS us-east-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-19T18:16:53Z/2024-08-22T17:08:50Z
+ * F = F0:ED:82:3E:D1:44:47:BA:B5:57:FD:F3:E4:92:74:66:98:8C:1C:78
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICJVUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTkxODE2\n'
+ + 'NTNaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyB1cy1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBAM3i/k2u6cqbMdcISGRvh+m+L0yaSIoOXjtpNEoIftAipTUYoMhL\n'
+ + 'InXGlQBVA4shkekxp1N7HXe1Y/iMaPEyb3n+16pf3vdjKl7kaSkIhjdUz3oVUEYt\n'
+ + 'i8Z/XeJJ9H2aEGuiZh3kHixQcZczn8cg3dA9aeeyLSEnTkl/npzLf//669Ammyhs\n'
+ + 'XcAo58yvT0D4E0D/EEHf2N7HRX7j/TlyWvw/39SW0usiCrHPKDLxByLojxLdHzso\n'
+ + 'QIp/S04m+eWn6rmD+uUiRteN1hI5ncQiA3wo4G37mHnUEKo6TtTUh+sd/ku6a8HK\n'
+ + 'glMBcgqudDI90s1OpuIAWmuWpY//8xEG2YECAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPqhoWZcrVY9mU7tuemR\n'
+ + 'RBnQIj1jMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQB6zOLZ+YINEs72heHIWlPZ8c6WY8MDU+Be5w1M+BK2kpcVhCUK\n'
+ + 'PJO4nMXpgamEX8DIiaO7emsunwJzMSvavSPRnxXXTKIc0i/g1EbiDjnYX9d85DkC\n'
+ + 'E1LaAUCmCZBVi9fIe0H2r9whIh4uLWZA41oMnJx/MOmo3XyMfQoWcqaSFlMqfZM4\n'
+ + '0rNoB/tdHLNuV4eIdaw2mlHxdWDtF4oH+HFm+2cVBUVC1jXKrFv/euRVtsTT+A6i\n'
+ + 'h2XBHKxQ1Y4HgAn0jACP2QSPEmuoQEIa57bEKEcZsBR8SDY6ZdTd2HLRIApcCOSF\n'
+ + 'MRM8CKLeF658I0XgF8D5EsYoKPsA+74Z+jDH\n'
+ + '-----END CERTIFICATE-----\n',
- if (typeof options.rejectUnauthorized !== 'undefined') {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.rejectUnauthorized
- }
+ /**
+ * Amazon RDS us-east-2 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS us-east-2 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-13T17:06:41Z/2024-08-22T17:08:50Z
+ * F = E9:FE:27:2A:A0:0F:CE:DF:AD:51:03:A6:94:F7:1F:6F:BD:1E:28:D3
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECDCCAvCgAwIBAgIDAIVCMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n'
+ + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n'
+ + 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n'
+ + 'UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTEzMTcw\n'
+ + 'NjQxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh\n'
+ + 'c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg\n'
+ + 'U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt\n'
+ + 'YXpvbiBSRFMgdXMtZWFzdC0yIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
+ + 'DwAwggEKAoIBAQDE+T2xYjUbxOp+pv+gRA3FO24+1zCWgXTDF1DHrh1lsPg5k7ht\n'
+ + '2KPYzNc+Vg4E+jgPiW0BQnA6jStX5EqVh8BU60zELlxMNvpg4KumniMCZ3krtMUC\n'
+ + 'au1NF9rM7HBh+O+DYMBLK5eSIVt6lZosOb7bCi3V6wMLA8YqWSWqabkxwN4w0vXI\n'
+ + '8lu5uXXFRemHnlNf+yA/4YtN4uaAyd0ami9+klwdkZfkrDOaiy59haOeBGL8EB/c\n'
+ + 'dbJJlguHH5CpCscs3RKtOOjEonXnKXldxarFdkMzi+aIIjQ8GyUOSAXHtQHb3gZ4\n'
+ + 'nS6Ey0CMlwkB8vUObZU9fnjKJcL5QCQqOfwvAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
+ + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBQUPuRHohPxx4VjykmH\n'
+ + '6usGrLL1ETAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
+ + '9w0BAQsFAAOCAQEAUdR9Vb3y33Yj6X6KGtuthZ08SwjImVQPtknzpajNE5jOJAh8\n'
+ + 'quvQnU9nlnMO85fVDU1Dz3lLHGJ/YG1pt1Cqq2QQ200JcWCvBRgdvH6MjHoDQpqZ\n'
+ + 'HvQ3vLgOGqCLNQKFuet9BdpsHzsctKvCVaeBqbGpeCtt3Hh/26tgx0rorPLw90A2\n'
+ + 'V8QSkZJjlcKkLa58N5CMM8Xz8KLWg3MZeT4DmlUXVCukqK2RGuP2L+aME8dOxqNv\n'
+ + 'OnOz1zrL5mR2iJoDpk8+VE/eBDmJX40IJk6jBjWoxAO/RXq+vBozuF5YHN1ujE92\n'
+ + 'tO8HItgTp37XT8bJBAiAnt5mxw+NLSqtxk2QdQ==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.cert) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
- }
+ /**
+ * Amazon RDS us-west-1 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS us-west-1 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-06T17:40:21Z/2024-08-22T17:08:50Z
+ * F = 1C:9F:DF:84:E6:13:32:F3:91:12:2D:0D:A5:9A:16:5D:AC:DC:E8:93
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIECDCCAvCgAwIBAgIDAIkHMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV\n'
+ + 'UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE\n'
+ + 'CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE\n'
+ + 'UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTA2MTc0\n'
+ + 'MDIxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh\n'
+ + 'c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg\n'
+ + 'U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt\n'
+ + 'YXpvbiBSRFMgdXMtd2VzdC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n'
+ + 'DwAwggEKAoIBAQDD2yzbbAl77OofTghDMEf624OvU0eS9O+lsdO0QlbfUfWa1Kd6\n'
+ + '0WkgjkLZGfSRxEHMCnrv4UPBSK/Qwn6FTjkDLgemhqBtAnplN4VsoDL+BkRX4Wwq\n'
+ + '/dSQJE2b+0hm9w9UMVGFDEq1TMotGGTD2B71eh9HEKzKhGzqiNeGsiX4VV+LJzdH\n'
+ + 'uM23eGisNqmd4iJV0zcAZ+Gbh2zK6fqTOCvXtm7Idccv8vZZnyk1FiWl3NR4WAgK\n'
+ + 'AkvWTIoFU3Mt7dIXKKClVmvssG8WHCkd3Xcb4FHy/G756UZcq67gMMTX/9fOFM/v\n'
+ + 'l5C0+CHl33Yig1vIDZd+fXV1KZD84dEJfEvHAgMBAAGjZjBkMA4GA1UdDwEB/wQE\n'
+ + 'AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBR+ap20kO/6A7pPxo3+\n'
+ + 'T3CfqZpQWjAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG\n'
+ + '9w0BAQsFAAOCAQEAHCJky2tPjPttlDM/RIqExupBkNrnSYnOK4kr9xJ3sl8UF2DA\n'
+ + 'PAnYsjXp3rfcjN/k/FVOhxwzi3cXJF/2Tjj39Bm/OEfYTOJDNYtBwB0VVH4ffa/6\n'
+ + 'tZl87jaIkrxJcreeeHqYMnIxeN0b/kliyA+a5L2Yb0VPjt9INq34QDc1v74FNZ17\n'
+ + '4z8nr1nzg4xsOWu0Dbjo966lm4nOYIGBRGOKEkHZRZ4mEiMgr3YLkv8gSmeitx57\n'
+ + 'Z6dVemNtUic/LVo5Iqw4n3TBS0iF2C1Q1xT/s3h+0SXZlfOWttzSluDvoMv5PvCd\n'
+ + 'pFjNn+aXLAALoihL1MJSsxydtsLjOBro5eK0Vw==\n'
+ + '-----END CERTIFICATE-----\n',
- if (options.pfx) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.pfx.toString('ascii')
- }
+ /**
+ * Amazon RDS us-west-2 certificate CA 2019 to 2024
+ *
+ * CN = Amazon RDS us-west-2 2019 CA
+ * OU = Amazon RDS
+ * O = Amazon Web Services, Inc.
+ * L = Seattle
+ * ST = Washington
+ * C = US
+ * P = 2019-09-16T18:21:15Z/2024-08-22T17:08:50Z
+ * F = C8:DE:1D:13:AD:35:9B:3D:EA:18:2A:DC:B4:79:6D:22:47:75:3C:4A
+ */
+ '-----BEGIN CERTIFICATE-----\n'
+ + 'MIIEBzCCAu+gAwIBAgICUYkwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT\n'
+ + 'MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK\n'
+ + 'DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT\n'
+ + 'MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxODIx\n'
+ + 'MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz\n'
+ + 'aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT\n'
+ + 'ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h\n'
+ + 'em9uIFJEUyB1cy13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n'
+ + 'ADCCAQoCggEBANCEZBZyu6yJQFZBJmSUZfSZd3Ui2gitczMKC4FLr0QzkbxY+cLa\n'
+ + 'uVONIOrPt4Rwi+3h/UdnUg917xao3S53XDf1TDMFEYp4U8EFPXqCn/GXBIWlU86P\n'
+ + 'PvBN+gzw3nS+aco7WXb+woTouvFVkk8FGU7J532llW8o/9ydQyDIMtdIkKTuMfho\n'
+ + 'OiNHSaNc+QXQ32TgvM9A/6q7ksUoNXGCP8hDOkSZ/YOLiI5TcdLh/aWj00ziL5bj\n'
+ + 'pvytiMZkilnc9dLY9QhRNr0vGqL0xjmWdoEXz9/OwjmCihHqJq+20MJPsvFm7D6a\n'
+ + '2NKybR9U+ddrjb8/iyLOjURUZnj5O+2+OPcCAwEAAaNmMGQwDgYDVR0PAQH/BAQD\n'
+ + 'AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEBxMBdv81xuzqcK5TVu\n'
+ + 'pHj+Aor8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3\n'
+ + 'DQEBCwUAA4IBAQBZkfiVqGoJjBI37aTlLOSjLcjI75L5wBrwO39q+B4cwcmpj58P\n'
+ + '3sivv+jhYfAGEbQnGRzjuFoyPzWnZ1DesRExX+wrmHsLLQbF2kVjLZhEJMHF9eB7\n'
+ + 'GZlTPdTzHErcnuXkwA/OqyXMpj9aghcQFuhCNguEfnROY9sAoK2PTfnTz9NJHL+Q\n'
+ + 'UpDLEJEUfc0GZMVWYhahc0x38ZnSY2SKacIPECQrTI0KpqZv/P+ijCEcMD9xmYEb\n'
+ + 'jL4en+XKS1uJpw5fIU5Sj0MxhdGstH6S84iAE5J3GM3XHklGSFwwqPYvuTXvANH6\n'
+ + 'uboynxRgSae59jIlAK6Jrr6GWMwQRbgcaAlW\n'
+ + '-----END CERTIFICATE-----\n'
+ ]
+};
- if (options.ciphers) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.ciphers
- }
- if (options.secureProtocol) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.secureProtocol
- }
+/***/ }),
- if (options.secureOptions) {
- if (poolKey) {
- poolKey += ':'
- }
- poolKey += options.secureOptions
- }
- }
+/***/ 81699:
+/***/ ((__unused_webpack_module, exports) => {
- if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {
- // not doing anything special. Use the globalAgent
- return self.httpModule.globalAgent
- }
+/**
+ * MySQL type constants
+ *
+ * Extracted from version 5.7.29
+ *
+ * !! Generated by generate-type-constants.js, do not modify by hand !!
+ */
- // we're using a stored agent. Make sure it's protocol-specific
- poolKey = self.uri.protocol + poolKey
+exports.DECIMAL = 0;
+exports.TINY = 1;
+exports.SHORT = 2;
+exports.LONG = 3;
+exports.FLOAT = 4;
+exports.DOUBLE = 5;
+exports.NULL = 6;
+exports.TIMESTAMP = 7;
+exports.LONGLONG = 8;
+exports.INT24 = 9;
+exports.DATE = 10;
+exports.TIME = 11;
+exports.DATETIME = 12;
+exports.YEAR = 13;
+exports.NEWDATE = 14;
+exports.VARCHAR = 15;
+exports.BIT = 16;
+exports.TIMESTAMP2 = 17;
+exports.DATETIME2 = 18;
+exports.TIME2 = 19;
+exports.JSON = 245;
+exports.NEWDECIMAL = 246;
+exports.ENUM = 247;
+exports.SET = 248;
+exports.TINY_BLOB = 249;
+exports.MEDIUM_BLOB = 250;
+exports.LONG_BLOB = 251;
+exports.BLOB = 252;
+exports.VAR_STRING = 253;
+exports.STRING = 254;
+exports.GEOMETRY = 255;
- // generate a new agent for this setting if none yet exists
- if (!self.pool[poolKey]) {
- self.pool[poolKey] = new Agent(options)
- // properly set maxSockets on new agents
- if (self.pool.maxSockets) {
- self.pool[poolKey].maxSockets = self.pool.maxSockets
- }
- }
+// Lookup-by-number table
+exports[0] = 'DECIMAL';
+exports[1] = 'TINY';
+exports[2] = 'SHORT';
+exports[3] = 'LONG';
+exports[4] = 'FLOAT';
+exports[5] = 'DOUBLE';
+exports[6] = 'NULL';
+exports[7] = 'TIMESTAMP';
+exports[8] = 'LONGLONG';
+exports[9] = 'INT24';
+exports[10] = 'DATE';
+exports[11] = 'TIME';
+exports[12] = 'DATETIME';
+exports[13] = 'YEAR';
+exports[14] = 'NEWDATE';
+exports[15] = 'VARCHAR';
+exports[16] = 'BIT';
+exports[17] = 'TIMESTAMP2';
+exports[18] = 'DATETIME2';
+exports[19] = 'TIME2';
+exports[245] = 'JSON';
+exports[246] = 'NEWDECIMAL';
+exports[247] = 'ENUM';
+exports[248] = 'SET';
+exports[249] = 'TINY_BLOB';
+exports[250] = 'MEDIUM_BLOB';
+exports[251] = 'LONG_BLOB';
+exports[252] = 'BLOB';
+exports[253] = 'VAR_STRING';
+exports[254] = 'STRING';
+exports[255] = 'GEOMETRY';
- return self.pool[poolKey]
-}
-Request.prototype.start = function () {
- // start() is called once we are ready to send the outgoing HTTP request.
- // this is usually called on the first write(), end() or on nextTick()
- var self = this
+/***/ }),
- if (self.timing) {
- // All timings will be relative to this request's startTime. In order to do this,
- // we need to capture the wall-clock start time (via Date), immediately followed
- // by the high-resolution timer (via now()). While these two won't be set
- // at the _exact_ same time, they should be close enough to be able to calculate
- // high-resolution, monotonically non-decreasing timestamps relative to startTime.
- var startTime = new Date().getTime()
- var startTimeNow = now()
- }
+/***/ 1117:
+/***/ ((module) => {
- if (self._aborted) {
- return
- }
+module.exports = AuthSwitchRequestPacket;
+function AuthSwitchRequestPacket(options) {
+ options = options || {};
- self._started = true
- self.method = self.method || 'GET'
- self.href = self.uri.href
+ this.status = 0xfe;
+ this.authMethodName = options.authMethodName;
+ this.authMethodData = options.authMethodData;
+}
- if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {
- self.setHeader('content-length', self.src.stat.size)
- }
- if (self._aws) {
- self.aws(self._aws, true)
- }
+AuthSwitchRequestPacket.prototype.parse = function parse(parser) {
+ this.status = parser.parseUnsignedNumber(1);
+ this.authMethodName = parser.parseNullTerminatedString();
+ this.authMethodData = parser.parsePacketTerminatedBuffer();
+};
- // We have a method named auth, which is completely different from the http.request
- // auth option. If we don't remove it, we're gonna have a bad time.
- var reqOptions = copy(self)
- delete reqOptions.auth
+AuthSwitchRequestPacket.prototype.write = function write(writer) {
+ writer.writeUnsignedNumber(1, this.status);
+ writer.writeNullTerminatedString(this.authMethodName);
+ writer.writeBuffer(this.authMethodData);
+};
- debug('make request', self.uri.href)
- // node v6.8.0 now supports a `timeout` value in `http.request()`, but we
- // should delete it for now since we handle timeouts manually for better
- // consistency with node versions before v6.8.0
- delete reqOptions.timeout
+/***/ }),
- try {
- self.req = self.httpModule.request(reqOptions)
- } catch (err) {
- self.emit('error', err)
- return
- }
+/***/ 83112:
+/***/ ((module) => {
- if (self.timing) {
- self.startTime = startTime
- self.startTimeNow = startTimeNow
+module.exports = AuthSwitchResponsePacket;
+function AuthSwitchResponsePacket(options) {
+ options = options || {};
- // Timing values will all be relative to startTime (by comparing to startTimeNow
- // so we have an accurate clock)
- self.timings = {}
- }
+ this.data = options.data;
+}
- var timeout
- if (self.timeout && !self.timeoutTimer) {
- if (self.timeout < 0) {
- timeout = 0
- } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {
- timeout = self.timeout
- }
- }
+AuthSwitchResponsePacket.prototype.parse = function parse(parser) {
+ this.data = parser.parsePacketTerminatedBuffer();
+};
- self.req.on('response', self.onRequestResponse.bind(self))
- self.req.on('error', self.onRequestError.bind(self))
- self.req.on('drain', function () {
- self.emit('drain')
- })
+AuthSwitchResponsePacket.prototype.write = function write(writer) {
+ writer.writeBuffer(this.data);
+};
- self.req.on('socket', function (socket) {
- // `._connecting` was the old property which was made public in node v6.1.0
- var isConnecting = socket._connecting || socket.connecting
- if (self.timing) {
- self.timings.socket = now() - self.startTimeNow
- if (isConnecting) {
- var onLookupTiming = function () {
- self.timings.lookup = now() - self.startTimeNow
- }
+/***/ }),
- var onConnectTiming = function () {
- self.timings.connect = now() - self.startTimeNow
- }
+/***/ 72948:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- socket.once('lookup', onLookupTiming)
- socket.once('connect', onConnectTiming)
+var Buffer = __nccwpck_require__(21867).Buffer;
- // clean up timing event listeners if needed on error
- self.req.once('error', function () {
- socket.removeListener('lookup', onLookupTiming)
- socket.removeListener('connect', onConnectTiming)
- })
- }
- }
+module.exports = ClientAuthenticationPacket;
+function ClientAuthenticationPacket(options) {
+ options = options || {};
- var setReqTimeout = function () {
- // This timeout sets the amount of time to wait *between* bytes sent
- // from the server once connected.
- //
- // In particular, it's useful for erroring if the server fails to send
- // data halfway through streaming a response.
- self.req.setTimeout(timeout, function () {
- if (self.req) {
- self.abort()
- var e = new Error('ESOCKETTIMEDOUT')
- e.code = 'ESOCKETTIMEDOUT'
- e.connect = false
- self.emit('error', e)
- }
- })
+ this.clientFlags = options.clientFlags;
+ this.maxPacketSize = options.maxPacketSize;
+ this.charsetNumber = options.charsetNumber;
+ this.filler = undefined;
+ this.user = options.user;
+ this.scrambleBuff = options.scrambleBuff;
+ this.database = options.database;
+ this.protocol41 = options.protocol41;
+}
+
+ClientAuthenticationPacket.prototype.parse = function(parser) {
+ if (this.protocol41) {
+ this.clientFlags = parser.parseUnsignedNumber(4);
+ this.maxPacketSize = parser.parseUnsignedNumber(4);
+ this.charsetNumber = parser.parseUnsignedNumber(1);
+ this.filler = parser.parseFiller(23);
+ this.user = parser.parseNullTerminatedString();
+ this.scrambleBuff = parser.parseLengthCodedBuffer();
+ this.database = parser.parseNullTerminatedString();
+ } else {
+ this.clientFlags = parser.parseUnsignedNumber(2);
+ this.maxPacketSize = parser.parseUnsignedNumber(3);
+ this.user = parser.parseNullTerminatedString();
+ this.scrambleBuff = parser.parseBuffer(8);
+ this.database = parser.parseLengthCodedBuffer();
+ }
+};
+
+ClientAuthenticationPacket.prototype.write = function(writer) {
+ if (this.protocol41) {
+ writer.writeUnsignedNumber(4, this.clientFlags);
+ writer.writeUnsignedNumber(4, this.maxPacketSize);
+ writer.writeUnsignedNumber(1, this.charsetNumber);
+ writer.writeFiller(23);
+ writer.writeNullTerminatedString(this.user);
+ writer.writeLengthCodedBuffer(this.scrambleBuff);
+ writer.writeNullTerminatedString(this.database);
+ } else {
+ writer.writeUnsignedNumber(2, this.clientFlags);
+ writer.writeUnsignedNumber(3, this.maxPacketSize);
+ writer.writeNullTerminatedString(this.user);
+ writer.writeBuffer(this.scrambleBuff);
+ if (this.database && this.database.length) {
+ writer.writeFiller(1);
+ writer.writeBuffer(Buffer.from(this.database));
}
- if (timeout !== undefined) {
- // Only start the connection timer if we're actually connecting a new
- // socket, otherwise if we're already connected (because this is a
- // keep-alive connection) do not bother. This is important since we won't
- // get a 'connect' event for an already connected socket.
- if (isConnecting) {
- var onReqSockConnect = function () {
- socket.removeListener('connect', onReqSockConnect)
- self.clearTimeout()
- setReqTimeout()
- }
+ }
+};
- socket.on('connect', onReqSockConnect)
- self.req.on('error', function (err) { // eslint-disable-line handle-callback-err
- socket.removeListener('connect', onReqSockConnect)
- })
+/***/ }),
- // Set a timeout in memory - this block will throw if the server takes more
- // than `timeout` to write the HTTP status and headers (corresponding to
- // the on('response') event on the client). NB: this measures wall-clock
- // time, not the time between bytes sent by the server.
- self.timeoutTimer = setTimeout(function () {
- socket.removeListener('connect', onReqSockConnect)
- self.abort()
- var e = new Error('ETIMEDOUT')
- e.code = 'ETIMEDOUT'
- e.connect = true
- self.emit('error', e)
- }, timeout)
- } else {
- // We're already connected
- setReqTimeout()
- }
- }
- self.emit('socket', socket)
- })
+/***/ 77942:
+/***/ ((module) => {
- self.emit('request', self.req)
-}
+module.exports = ComChangeUserPacket;
+function ComChangeUserPacket(options) {
+ options = options || {};
-Request.prototype.onRequestError = function (error) {
- var self = this
- if (self._aborted) {
- return
- }
- if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&
- self.agent.addRequestNoreuse) {
- self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
- self.start()
- self.req.end()
- return
- }
- self.clearTimeout()
- self.emit('error', error)
+ this.command = 0x11;
+ this.user = options.user;
+ this.scrambleBuff = options.scrambleBuff;
+ this.database = options.database;
+ this.charsetNumber = options.charsetNumber;
}
-Request.prototype.onRequestResponse = function (response) {
- var self = this
+ComChangeUserPacket.prototype.parse = function(parser) {
+ this.command = parser.parseUnsignedNumber(1);
+ this.user = parser.parseNullTerminatedString();
+ this.scrambleBuff = parser.parseLengthCodedBuffer();
+ this.database = parser.parseNullTerminatedString();
+ this.charsetNumber = parser.parseUnsignedNumber(1);
+};
- if (self.timing) {
- self.timings.response = now() - self.startTimeNow
- }
+ComChangeUserPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, this.command);
+ writer.writeNullTerminatedString(this.user);
+ writer.writeLengthCodedBuffer(this.scrambleBuff);
+ writer.writeNullTerminatedString(this.database);
+ writer.writeUnsignedNumber(2, this.charsetNumber);
+};
- debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)
- response.on('end', function () {
- if (self.timing) {
- self.timings.end = now() - self.startTimeNow
- response.timingStart = self.startTime
- // fill in the blanks for any periods that didn't trigger, such as
- // no lookup or connect due to keep alive
- if (!self.timings.socket) {
- self.timings.socket = 0
- }
- if (!self.timings.lookup) {
- self.timings.lookup = self.timings.socket
- }
- if (!self.timings.connect) {
- self.timings.connect = self.timings.lookup
- }
- if (!self.timings.response) {
- self.timings.response = self.timings.connect
- }
+/***/ }),
- debug('elapsed time', self.timings.end)
+/***/ 54368:
+/***/ ((module) => {
- // elapsedTime includes all redirects
- self.elapsedTime += Math.round(self.timings.end)
+module.exports = ComPingPacket;
+function ComPingPacket() {
+ this.command = 0x0e;
+}
- // NOTE: elapsedTime is deprecated in favor of .timings
- response.elapsedTime = self.elapsedTime
+ComPingPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, this.command);
+};
- // timings is just for the final fetch
- response.timings = self.timings
+ComPingPacket.prototype.parse = function(parser) {
+ this.command = parser.parseUnsignedNumber(1);
+};
- // pre-calculate phase timings as well
- response.timingPhases = {
- wait: self.timings.socket,
- dns: self.timings.lookup - self.timings.socket,
- tcp: self.timings.connect - self.timings.lookup,
- firstByte: self.timings.response - self.timings.connect,
- download: self.timings.end - self.timings.response,
- total: self.timings.end
- }
- }
- debug('response end', self.uri.href, response.statusCode, response.headers)
- })
- if (self._aborted) {
- debug('aborted', self.uri.href)
- response.resume()
- return
- }
+/***/ }),
- self.response = response
- response.request = self
- response.toJSON = responseToJSON
+/***/ 9380:
+/***/ ((module) => {
- // XXX This is different on 0.10, because SSL is strict by default
- if (self.httpModule === https &&
- self.strictSSL && (!response.hasOwnProperty('socket') ||
- !response.socket.authorized)) {
- debug('strict ssl error', self.uri.href)
- var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'
- self.emit('error', new Error('SSL Error: ' + sslErr))
- return
- }
+module.exports = ComQueryPacket;
+function ComQueryPacket(sql) {
+ this.command = 0x03;
+ this.sql = sql;
+}
- // Save the original host before any redirect (if it changes, we need to
- // remove any authorization headers). Also remember the case of the header
- // name because lots of broken servers expect Host instead of host and we
- // want the caller to be able to specify this.
- self.originalHost = self.getHeader('host')
- if (!self.originalHostHeaderName) {
- self.originalHostHeaderName = self.hasHeader('host')
- }
- if (self.setHost) {
- self.removeHeader('host')
- }
- self.clearTimeout()
+ComQueryPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, this.command);
+ writer.writeString(this.sql);
+};
- var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar
- var addCookie = function (cookie) {
- // set the cookie if it's domain in the href's domain.
- try {
- targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})
- } catch (e) {
- self.emit('error', e)
- }
- }
+ComQueryPacket.prototype.parse = function(parser) {
+ this.command = parser.parseUnsignedNumber(1);
+ this.sql = parser.parsePacketTerminatedString();
+};
- response.caseless = caseless(response.headers)
- if (response.caseless.has('set-cookie') && (!self._disableCookies)) {
- var headerName = response.caseless.has('set-cookie')
- if (Array.isArray(response.headers[headerName])) {
- response.headers[headerName].forEach(addCookie)
- } else {
- addCookie(response.headers[headerName])
- }
- }
+/***/ }),
- if (self._redirect.onResponse(response)) {
- return // Ignore the rest of the response
- } else {
- // Be a good stream and emit end when the response is finished.
- // Hack to emit end on close because of a core bug that never fires end
- response.on('close', function () {
- if (!self._ended) {
- self.response.emit('end')
- }
- })
+/***/ 93904:
+/***/ ((module) => {
- response.once('end', function () {
- self._ended = true
- })
+module.exports = ComQuitPacket;
+function ComQuitPacket() {
+ this.command = 0x01;
+}
- var noBody = function (code) {
- return (
- self.method === 'HEAD' ||
- // Informational
- (code >= 100 && code < 200) ||
- // No Content
- code === 204 ||
- // Not Modified
- code === 304
- )
- }
+ComQuitPacket.prototype.parse = function parse(parser) {
+ this.command = parser.parseUnsignedNumber(1);
+};
- var responseContent
- if (self.gzip && !noBody(response.statusCode)) {
- var contentEncoding = response.headers['content-encoding'] || 'identity'
- contentEncoding = contentEncoding.trim().toLowerCase()
+ComQuitPacket.prototype.write = function write(writer) {
+ writer.writeUnsignedNumber(1, this.command);
+};
- // Be more lenient with decoding compressed responses, since (very rarely)
- // servers send slightly invalid gzip responses that are still accepted
- // by common browsers.
- // Always using Z_SYNC_FLUSH is what cURL does.
- var zlibOptions = {
- flush: zlib.Z_SYNC_FLUSH,
- finishFlush: zlib.Z_SYNC_FLUSH
- }
- if (contentEncoding === 'gzip') {
- responseContent = zlib.createGunzip(zlibOptions)
- response.pipe(responseContent)
- } else if (contentEncoding === 'deflate') {
- responseContent = zlib.createInflate(zlibOptions)
- response.pipe(responseContent)
- } else {
- // Since previous versions didn't check for Content-Encoding header,
- // ignore any invalid values to preserve backwards-compatibility
- if (contentEncoding !== 'identity') {
- debug('ignoring unrecognized Content-Encoding ' + contentEncoding)
- }
- responseContent = response
- }
- } else {
- responseContent = response
- }
+/***/ }),
- if (self.encoding) {
- if (self.dests.length !== 0) {
- console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
- } else {
- responseContent.setEncoding(self.encoding)
- }
- }
+/***/ 52943:
+/***/ ((module) => {
- if (self._paused) {
- responseContent.pause()
- }
+module.exports = ComStatisticsPacket;
+function ComStatisticsPacket() {
+ this.command = 0x09;
+}
- self.responseContent = responseContent
+ComStatisticsPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, this.command);
+};
- self.emit('response', response)
+ComStatisticsPacket.prototype.parse = function(parser) {
+ this.command = parser.parseUnsignedNumber(1);
+};
- self.dests.forEach(function (dest) {
- self.pipeDest(dest)
- })
- responseContent.on('data', function (chunk) {
- if (self.timing && !self.responseStarted) {
- self.responseStartTime = (new Date()).getTime()
+/***/ }),
- // NOTE: responseStartTime is deprecated in favor of .timings
- response.responseStartTime = self.responseStartTime
- }
- self._destdata = true
- self.emit('data', chunk)
- })
- responseContent.once('end', function (chunk) {
- self.emit('end', chunk)
- })
- responseContent.on('error', function (error) {
- self.emit('error', error)
- })
- responseContent.on('close', function () { self.emit('close') })
+/***/ 87761:
+/***/ ((module) => {
- if (self.callback) {
- self.readResponseBody(response)
- } else { // if no callback
- self.on('end', function () {
- if (self._aborted) {
- debug('aborted', self.uri.href)
- return
- }
- self.emit('complete', response)
- })
- }
- }
- debug('finish init function', self.uri.href)
+module.exports = EmptyPacket;
+function EmptyPacket() {
}
-Request.prototype.readResponseBody = function (response) {
- var self = this
- debug("reading response's body")
- var buffers = []
- var bufferLength = 0
- var strings = []
-
- self.on('data', function (chunk) {
- if (!Buffer.isBuffer(chunk)) {
- strings.push(chunk)
- } else if (chunk.length) {
- bufferLength += chunk.length
- buffers.push(chunk)
- }
- })
- self.on('end', function () {
- debug('end event', self.uri.href)
- if (self._aborted) {
- debug('aborted', self.uri.href)
- // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.
- // This can lead to leaky behavior if the user retains a reference to the request object.
- buffers = []
- bufferLength = 0
- return
- }
-
- if (bufferLength) {
- debug('has body', self.uri.href, bufferLength)
- response.body = Buffer.concat(buffers, bufferLength)
- if (self.encoding !== null) {
- response.body = response.body.toString(self.encoding)
- }
- // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.
- // This can lead to leaky behavior if the user retains a reference to the request object.
- buffers = []
- bufferLength = 0
- } else if (strings.length) {
- // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
- // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
- if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
- strings[0] = strings[0].substring(1)
- }
- response.body = strings.join('')
- }
+EmptyPacket.prototype.parse = function parse() {
+};
- if (self._json) {
- try {
- response.body = JSON.parse(response.body, self._jsonReviver)
- } catch (e) {
- debug('invalid JSON received', self.uri.href)
- }
- }
- debug('emitting complete', self.uri.href)
- if (typeof response.body === 'undefined' && !self._json) {
- response.body = self.encoding === null ? Buffer.alloc(0) : ''
- }
- self.emit('complete', response, response.body)
- })
-}
+EmptyPacket.prototype.write = function write() {
+};
-Request.prototype.abort = function () {
- var self = this
- self._aborted = true
- if (self.req) {
- self.req.abort()
- } else if (self.response) {
- self.response.destroy()
- }
+/***/ }),
- self.clearTimeout()
- self.emit('abort')
-}
+/***/ 4693:
+/***/ ((module) => {
-Request.prototype.pipeDest = function (dest) {
- var self = this
- var response = self.response
- // Called after the response is received
- if (dest.headers && !dest.headersSent) {
- if (response.caseless.has('content-type')) {
- var ctname = response.caseless.has('content-type')
- if (dest.setHeader) {
- dest.setHeader(ctname, response.headers[ctname])
- } else {
- dest.headers[ctname] = response.headers[ctname]
- }
- }
+module.exports = EofPacket;
+function EofPacket(options) {
+ options = options || {};
- if (response.caseless.has('content-length')) {
- var clname = response.caseless.has('content-length')
- if (dest.setHeader) {
- dest.setHeader(clname, response.headers[clname])
- } else {
- dest.headers[clname] = response.headers[clname]
- }
- }
- }
- if (dest.setHeader && !dest.headersSent) {
- for (var i in response.headers) {
- // If the response content is being decoded, the Content-Encoding header
- // of the response doesn't represent the piped content, so don't pass it.
- if (!self.gzip || i !== 'content-encoding') {
- dest.setHeader(i, response.headers[i])
- }
- }
- dest.statusCode = response.statusCode
- }
- if (self.pipefilter) {
- self.pipefilter(response, dest)
- }
+ this.fieldCount = undefined;
+ this.warningCount = options.warningCount;
+ this.serverStatus = options.serverStatus;
+ this.protocol41 = options.protocol41;
}
-Request.prototype.qs = function (q, clobber) {
- var self = this
- var base
- if (!clobber && self.uri.query) {
- base = self._qs.parse(self.uri.query)
- } else {
- base = {}
+EofPacket.prototype.parse = function(parser) {
+ this.fieldCount = parser.parseUnsignedNumber(1);
+ if (this.protocol41) {
+ this.warningCount = parser.parseUnsignedNumber(2);
+ this.serverStatus = parser.parseUnsignedNumber(2);
}
+};
- for (var i in q) {
- base[i] = q[i]
+EofPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, 0xfe);
+ if (this.protocol41) {
+ writer.writeUnsignedNumber(2, this.warningCount);
+ writer.writeUnsignedNumber(2, this.serverStatus);
}
+};
- var qs = self._qs.stringify(base)
- if (qs === '') {
- return self
- }
+/***/ }),
- self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)
- self.url = self.uri
- self.path = self.uri.path
+/***/ 11627:
+/***/ ((module) => {
- if (self.uri.host === 'unix') {
- self.enableUnixSocket()
- }
+module.exports = ErrorPacket;
+function ErrorPacket(options) {
+ options = options || {};
- return self
-}
-Request.prototype.form = function (form) {
- var self = this
- if (form) {
- if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
- self.setHeader('content-type', 'application/x-www-form-urlencoded')
- }
- self.body = (typeof form === 'string')
- ? self._qs.rfc3986(form.toString('utf8'))
- : self._qs.stringify(form).toString('utf8')
- return self
- }
- // create form-data object
- self._form = new FormData()
- self._form.on('error', function (err) {
- err.message = 'form-data: ' + err.message
- self.emit('error', err)
- self.abort()
- })
- return self._form
+ this.fieldCount = options.fieldCount;
+ this.errno = options.errno;
+ this.sqlStateMarker = options.sqlStateMarker;
+ this.sqlState = options.sqlState;
+ this.message = options.message;
}
-Request.prototype.multipart = function (multipart) {
- var self = this
- self._multipart.onRequest(multipart)
+ErrorPacket.prototype.parse = function(parser) {
+ this.fieldCount = parser.parseUnsignedNumber(1);
+ this.errno = parser.parseUnsignedNumber(2);
- if (!self._multipart.chunked) {
- self.body = self._multipart.body
+ // sqlStateMarker ('#' = 0x23) indicates error packet format
+ if (parser.peak() === 0x23) {
+ this.sqlStateMarker = parser.parseString(1);
+ this.sqlState = parser.parseString(5);
}
- return self
-}
-Request.prototype.json = function (val) {
- var self = this
+ this.message = parser.parsePacketTerminatedString();
+};
- if (!self.hasHeader('accept')) {
- self.setHeader('accept', 'application/json')
- }
+ErrorPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, 0xff);
+ writer.writeUnsignedNumber(2, this.errno);
- if (typeof self.jsonReplacer === 'function') {
- self._jsonReplacer = self.jsonReplacer
+ if (this.sqlStateMarker) {
+ writer.writeString(this.sqlStateMarker);
+ writer.writeString(this.sqlState);
}
- self._json = true
- if (typeof val === 'boolean') {
- if (self.body !== undefined) {
- if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
- self.body = safeStringify(self.body, self._jsonReplacer)
- } else {
- self.body = self._qs.rfc3986(self.body)
- }
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- }
- } else {
- self.body = safeStringify(val, self._jsonReplacer)
- if (!self.hasHeader('content-type')) {
- self.setHeader('content-type', 'application/json')
- }
- }
+ writer.writeString(this.message);
+};
- if (typeof self.jsonReviver === 'function') {
- self._jsonReviver = self.jsonReviver
- }
- return self
-}
-Request.prototype.getHeader = function (name, headers) {
- var self = this
- var result, re, match
- if (!headers) {
- headers = self.headers
- }
- Object.keys(headers).forEach(function (key) {
- if (key.length !== name.length) {
- return
- }
- re = new RegExp(name, 'i')
- match = key.match(re)
- if (match) {
- result = headers[key]
- }
- })
- return result
-}
-Request.prototype.enableUnixSocket = function () {
- // Get the socket & request paths from the URL
- var unixParts = this.uri.path.split(':')
- var host = unixParts[0]
- var path = unixParts[1]
- // Apply unix properties to request
- this.socketPath = host
- this.uri.pathname = path
- this.uri.path = path
- this.uri.host = host
- this.uri.hostname = host
- this.uri.isUnix = true
-}
+/***/ }),
-Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
- var self = this
+/***/ 3873:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- self._auth.onRequest(user, pass, sendImmediately, bearer)
+var Types = __nccwpck_require__(81699);
- return self
+module.exports = Field;
+function Field(options) {
+ options = options || {};
+
+ this.parser = options.parser;
+ this.packet = options.packet;
+ this.db = options.packet.db;
+ this.table = options.packet.table;
+ this.name = options.packet.name;
+ this.type = Types[options.packet.type];
+ this.length = options.packet.length;
}
-Request.prototype.aws = function (opts, now) {
- var self = this
- if (!now) {
- self._aws = opts
- return self
- }
+Field.prototype.string = function () {
+ return this.parser.parseLengthCodedString();
+};
- if (opts.sign_version === 4 || opts.sign_version === '4') {
- // use aws4
- var options = {
- host: self.uri.host,
- path: self.uri.path,
- method: self.method,
- headers: self.headers,
- body: self.body
- }
- if (opts.service) {
- options.service = opts.service
- }
- var signRes = aws4.sign(options, {
- accessKeyId: opts.key,
- secretAccessKey: opts.secret,
- sessionToken: opts.session
- })
- self.setHeader('authorization', signRes.headers.Authorization)
- self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])
- if (signRes.headers['X-Amz-Security-Token']) {
- self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])
- }
- } else {
- // default: use aws-sign2
- var date = new Date()
- self.setHeader('date', date.toUTCString())
- var auth = {
- key: opts.key,
- secret: opts.secret,
- verb: self.method.toUpperCase(),
- date: date,
- contentType: self.getHeader('content-type') || '',
- md5: self.getHeader('content-md5') || '',
- amazonHeaders: aws2.canonicalizeHeaders(self.headers)
- }
- var path = self.uri.path
- if (opts.bucket && path) {
- auth.resource = '/' + opts.bucket + path
- } else if (opts.bucket && !path) {
- auth.resource = '/' + opts.bucket
- } else if (!opts.bucket && path) {
- auth.resource = path
- } else if (!opts.bucket && !path) {
- auth.resource = '/'
- }
- auth.resource = aws2.canonicalizeResource(auth.resource)
- self.setHeader('authorization', aws2.authorization(auth))
- }
+Field.prototype.buffer = function () {
+ return this.parser.parseLengthCodedBuffer();
+};
- return self
-}
-Request.prototype.httpSignature = function (opts) {
- var self = this
- httpSignature.signRequest({
- getHeader: function (header) {
- return self.getHeader(header, self.headers)
- },
- setHeader: function (header, value) {
- self.setHeader(header, value)
- },
- method: self.method,
- path: self.path
- }, opts)
- debug('httpSignature authorization', self.getHeader('authorization'))
+Field.prototype.geometry = function () {
+ return this.parser.parseGeometryValue();
+};
- return self
-}
-Request.prototype.hawk = function (opts) {
- var self = this
- self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))
-}
-Request.prototype.oauth = function (_oauth) {
- var self = this
- self._oauth.onRequest(_oauth)
+/***/ }),
- return self
-}
+/***/ 78325:
+/***/ ((module) => {
-Request.prototype.jar = function (jar) {
- var self = this
- var cookies
+module.exports = FieldPacket;
+function FieldPacket(options) {
+ options = options || {};
- if (self._redirect.redirectsFollowed === 0) {
- self.originalCookieHeader = self.getHeader('cookie')
- }
+ this.catalog = options.catalog;
+ this.db = options.db;
+ this.table = options.table;
+ this.orgTable = options.orgTable;
+ this.name = options.name;
+ this.orgName = options.orgName;
+ this.charsetNr = options.charsetNr;
+ this.length = options.length;
+ this.type = options.type;
+ this.flags = options.flags;
+ this.decimals = options.decimals;
+ this.default = options.default;
+ this.zeroFill = options.zeroFill;
+ this.protocol41 = options.protocol41;
+}
- if (!jar) {
- // disable cookies
- cookies = false
- self._disableCookies = true
- } else {
- var targetCookieJar = jar.getCookieString ? jar : globalCookieJar
- var urihref = self.uri.href
- // fetch cookie in the Specified host
- if (targetCookieJar) {
- cookies = targetCookieJar.getCookieString(urihref)
- }
- }
+FieldPacket.prototype.parse = function(parser) {
+ if (this.protocol41) {
+ this.catalog = parser.parseLengthCodedString();
+ this.db = parser.parseLengthCodedString();
+ this.table = parser.parseLengthCodedString();
+ this.orgTable = parser.parseLengthCodedString();
+ this.name = parser.parseLengthCodedString();
+ this.orgName = parser.parseLengthCodedString();
- // if need cookie and cookie is not empty
- if (cookies && cookies.length) {
- if (self.originalCookieHeader) {
- // Don't overwrite existing Cookie header
- self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)
- } else {
- self.setHeader('cookie', cookies)
+ if (parser.parseLengthCodedNumber() !== 0x0c) {
+ var err = new TypeError('Received invalid field length');
+ err.code = 'PARSER_INVALID_FIELD_LENGTH';
+ throw err;
}
- }
- self._jar = jar
- return self
-}
-// Stream API
-Request.prototype.pipe = function (dest, opts) {
- var self = this
+ this.charsetNr = parser.parseUnsignedNumber(2);
+ this.length = parser.parseUnsignedNumber(4);
+ this.type = parser.parseUnsignedNumber(1);
+ this.flags = parser.parseUnsignedNumber(2);
+ this.decimals = parser.parseUnsignedNumber(1);
- if (self.response) {
- if (self._destdata) {
- self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))
- } else if (self._ended) {
- self.emit('error', new Error('You cannot pipe after the response has been ended.'))
- } else {
- stream.Stream.prototype.pipe.call(self, dest, opts)
- self.pipeDest(dest)
- return dest
+ var filler = parser.parseBuffer(2);
+ if (filler[0] !== 0x0 || filler[1] !== 0x0) {
+ var err = new TypeError('Received invalid filler');
+ err.code = 'PARSER_INVALID_FILLER';
+ throw err;
}
- } else {
- self.dests.push(dest)
- stream.Stream.prototype.pipe.call(self, dest, opts)
- return dest
- }
-}
-Request.prototype.write = function () {
- var self = this
- if (self._aborted) { return }
- if (!self._started) {
- self.start()
- }
- if (self.req) {
- return self.req.write.apply(self.req, arguments)
- }
-}
-Request.prototype.end = function (chunk) {
- var self = this
- if (self._aborted) { return }
+ // parsed flags
+ this.zeroFill = (this.flags & 0x0040 ? true : false);
- if (chunk) {
- self.write(chunk)
- }
- if (!self._started) {
- self.start()
- }
- if (self.req) {
- self.req.end()
- }
-}
-Request.prototype.pause = function () {
- var self = this
- if (!self.responseContent) {
- self._paused = true
- } else {
- self.responseContent.pause.apply(self.responseContent, arguments)
- }
-}
-Request.prototype.resume = function () {
- var self = this
- if (!self.responseContent) {
- self._paused = false
+ if (parser.reachedPacketEnd()) {
+ return;
+ }
+
+ this.default = parser.parseLengthCodedString();
} else {
- self.responseContent.resume.apply(self.responseContent, arguments)
- }
-}
-Request.prototype.destroy = function () {
- var self = this
- this.clearTimeout()
- if (!self._ended) {
- self.end()
- } else if (self.response) {
- self.response.destroy()
+ this.table = parser.parseLengthCodedString();
+ this.name = parser.parseLengthCodedString();
+ this.length = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1));
+ this.type = parser.parseUnsignedNumber(parser.parseUnsignedNumber(1));
}
-}
+};
-Request.prototype.clearTimeout = function () {
- if (this.timeoutTimer) {
- clearTimeout(this.timeoutTimer)
- this.timeoutTimer = null
- }
-}
+FieldPacket.prototype.write = function(writer) {
+ if (this.protocol41) {
+ writer.writeLengthCodedString(this.catalog);
+ writer.writeLengthCodedString(this.db);
+ writer.writeLengthCodedString(this.table);
+ writer.writeLengthCodedString(this.orgTable);
+ writer.writeLengthCodedString(this.name);
+ writer.writeLengthCodedString(this.orgName);
-Request.defaultProxyHeaderWhiteList =
- Tunnel.defaultProxyHeaderWhiteList.slice()
+ writer.writeLengthCodedNumber(0x0c);
+ writer.writeUnsignedNumber(2, this.charsetNr || 0);
+ writer.writeUnsignedNumber(4, this.length || 0);
+ writer.writeUnsignedNumber(1, this.type || 0);
+ writer.writeUnsignedNumber(2, this.flags || 0);
+ writer.writeUnsignedNumber(1, this.decimals || 0);
+ writer.writeFiller(2);
-Request.defaultProxyHeaderExclusiveList =
- Tunnel.defaultProxyHeaderExclusiveList.slice()
+ if (this.default !== undefined) {
+ writer.writeLengthCodedString(this.default);
+ }
+ } else {
+ writer.writeLengthCodedString(this.table);
+ writer.writeLengthCodedString(this.name);
+ writer.writeUnsignedNumber(1, 0x01);
+ writer.writeUnsignedNumber(1, this.length);
+ writer.writeUnsignedNumber(1, 0x01);
+ writer.writeUnsignedNumber(1, this.type);
+ }
+};
-// Exports
-Request.prototype.toJSON = requestToJSON
-module.exports = Request
+/***/ }),
+/***/ 38230:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
-/***/ }),
+var Buffer = __nccwpck_require__(21867).Buffer;
+var Client = __nccwpck_require__(5427);
-/***/ 21867:
-/***/ ((module, exports, __nccwpck_require__) => {
+module.exports = HandshakeInitializationPacket;
+function HandshakeInitializationPacket(options) {
+ options = options || {};
-/* eslint-disable node/no-deprecated-api */
-var buffer = __nccwpck_require__(64293)
-var Buffer = buffer.Buffer
+ this.protocolVersion = options.protocolVersion;
+ this.serverVersion = options.serverVersion;
+ this.threadId = options.threadId;
+ this.scrambleBuff1 = options.scrambleBuff1;
+ this.filler1 = options.filler1;
+ this.serverCapabilities1 = options.serverCapabilities1;
+ this.serverLanguage = options.serverLanguage;
+ this.serverStatus = options.serverStatus;
+ this.serverCapabilities2 = options.serverCapabilities2;
+ this.scrambleLength = options.scrambleLength;
+ this.filler2 = options.filler2;
+ this.scrambleBuff2 = options.scrambleBuff2;
+ this.filler3 = options.filler3;
+ this.pluginData = options.pluginData;
+ this.protocol41 = options.protocol41;
-// alternative to using Object.keys for old browsers
-function copyProps (src, dst) {
- for (var key in src) {
- dst[key] = src[key]
+ if (this.protocol41) {
+ // force set the bit in serverCapabilities1
+ this.serverCapabilities1 |= Client.CLIENT_PROTOCOL_41;
}
}
-if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module.exports = buffer
-} else {
- // Copy properties from require('buffer')
- copyProps(buffer, exports)
- exports.Buffer = SafeBuffer
-}
-function SafeBuffer (arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length)
-}
+HandshakeInitializationPacket.prototype.parse = function(parser) {
+ this.protocolVersion = parser.parseUnsignedNumber(1);
+ this.serverVersion = parser.parseNullTerminatedString();
+ this.threadId = parser.parseUnsignedNumber(4);
+ this.scrambleBuff1 = parser.parseBuffer(8);
+ this.filler1 = parser.parseFiller(1);
+ this.serverCapabilities1 = parser.parseUnsignedNumber(2);
+ this.serverLanguage = parser.parseUnsignedNumber(1);
+ this.serverStatus = parser.parseUnsignedNumber(2);
-// Copy static methods from Buffer
-copyProps(Buffer, SafeBuffer)
+ this.protocol41 = (this.serverCapabilities1 & (1 << 9)) > 0;
-SafeBuffer.from = function (arg, encodingOrOffset, length) {
- if (typeof arg === 'number') {
- throw new TypeError('Argument must not be a number')
+ if (this.protocol41) {
+ this.serverCapabilities2 = parser.parseUnsignedNumber(2);
+ this.scrambleLength = parser.parseUnsignedNumber(1);
+ this.filler2 = parser.parseFiller(10);
+ // scrambleBuff2 should be 0x00 terminated, but sphinx does not do this
+ // so we assume scrambleBuff2 to be 12 byte and treat the next byte as a
+ // filler byte.
+ this.scrambleBuff2 = parser.parseBuffer(12);
+ this.filler3 = parser.parseFiller(1);
+ } else {
+ this.filler2 = parser.parseFiller(13);
}
- return Buffer(arg, encodingOrOffset, length)
-}
-SafeBuffer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
+ if (parser.reachedPacketEnd()) {
+ return;
}
- var buf = Buffer(size)
- if (fill !== undefined) {
- if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- } else {
- buf.fill(0)
+
+ // According to the docs this should be 0x00 terminated, but MariaDB does
+ // not do this, so we assume this string to be packet terminated.
+ this.pluginData = parser.parsePacketTerminatedString();
+
+ // However, if there is a trailing '\0', strip it
+ var lastChar = this.pluginData.length - 1;
+ if (this.pluginData[lastChar] === '\0') {
+ this.pluginData = this.pluginData.substr(0, lastChar);
}
- return buf
-}
+};
-SafeBuffer.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
+HandshakeInitializationPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, this.protocolVersion);
+ writer.writeNullTerminatedString(this.serverVersion);
+ writer.writeUnsignedNumber(4, this.threadId);
+ writer.writeBuffer(this.scrambleBuff1);
+ writer.writeFiller(1);
+ writer.writeUnsignedNumber(2, this.serverCapabilities1);
+ writer.writeUnsignedNumber(1, this.serverLanguage);
+ writer.writeUnsignedNumber(2, this.serverStatus);
+ if (this.protocol41) {
+ writer.writeUnsignedNumber(2, this.serverCapabilities2);
+ writer.writeUnsignedNumber(1, this.scrambleLength);
+ writer.writeFiller(10);
}
- return Buffer(size)
-}
+ writer.writeNullTerminatedBuffer(this.scrambleBuff2);
-SafeBuffer.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number')
+ if (this.pluginData !== undefined) {
+ writer.writeNullTerminatedString(this.pluginData);
}
- return buffer.SlowBuffer(size)
-}
+};
+HandshakeInitializationPacket.prototype.scrambleBuff = function() {
+ var buffer = null;
-/***/ }),
+ if (typeof this.scrambleBuff2 === 'undefined') {
+ buffer = Buffer.from(this.scrambleBuff1);
+ } else {
+ buffer = Buffer.allocUnsafe(this.scrambleBuff1.length + this.scrambleBuff2.length);
+ this.scrambleBuff1.copy(buffer, 0);
+ this.scrambleBuff2.copy(buffer, this.scrambleBuff1.length);
+ }
-/***/ 15118:
-/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
+ return buffer;
+};
-"use strict";
-/* eslint-disable node/no-deprecated-api */
+/***/ }),
+/***/ 89171:
+/***/ ((module) => {
-var buffer = __nccwpck_require__(64293)
-var Buffer = buffer.Buffer
+module.exports = LocalDataFilePacket;
-var safer = {}
+/**
+ * Create a new LocalDataFilePacket
+ * @constructor
+ * @param {Buffer} data The data contents of the packet
+ * @public
+ */
+function LocalDataFilePacket(data) {
+ this.data = data;
+}
-var key
+LocalDataFilePacket.prototype.write = function(writer) {
+ writer.writeBuffer(this.data);
+};
-for (key in buffer) {
- if (!buffer.hasOwnProperty(key)) continue
- if (key === 'SlowBuffer' || key === 'Buffer') continue
- safer[key] = buffer[key]
-}
-var Safer = safer.Buffer = {}
-for (key in Buffer) {
- if (!Buffer.hasOwnProperty(key)) continue
- if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
- Safer[key] = Buffer[key]
-}
+/***/ }),
-safer.Buffer.prototype = Buffer.prototype
+/***/ 91444:
+/***/ ((module) => {
-if (!Safer.from || Safer.from === Uint8Array.from) {
- Safer.from = function (value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
- }
- if (value && typeof value.length === 'undefined') {
- throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
- }
- return Buffer(value, encodingOrOffset, length)
- }
-}
+module.exports = LocalInfileRequestPacket;
+function LocalInfileRequestPacket(options) {
+ options = options || {};
-if (!Safer.alloc) {
- Safer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
- }
- if (size < 0 || size >= 2 * (1 << 30)) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- var buf = Buffer(size)
- if (!fill || fill.length === 0) {
- buf.fill(0)
- } else if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- return buf
- }
+ this.filename = options.filename;
}
-if (!safer.kStringMaxLength) {
- try {
- safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
- } catch (e) {
- // we can't determine kStringMaxLength in environments where process.binding
- // is unsupported, so let's not set it
+LocalInfileRequestPacket.prototype.parse = function parse(parser) {
+ if (parser.parseLengthCodedNumber() !== null) {
+ var err = new TypeError('Received invalid field length');
+ err.code = 'PARSER_INVALID_FIELD_LENGTH';
+ throw err;
}
-}
-if (!safer.constants) {
- safer.constants = {
- MAX_LENGTH: safer.kMaxLength
- }
- if (safer.kStringMaxLength) {
- safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
- }
-}
+ this.filename = parser.parsePacketTerminatedString();
+};
-module.exports = safer
+LocalInfileRequestPacket.prototype.write = function write(writer) {
+ writer.writeLengthCodedNumber(null);
+ writer.writeString(this.filename);
+};
/***/ }),
-/***/ 72043:
-/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
-
-;(function (sax) { // wrapper for non-node envs
- sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
- sax.SAXParser = SAXParser
- sax.SAXStream = SAXStream
- sax.createStream = createStream
-
- // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
- // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
- // since that's the earliest that a buffer overrun could occur. This way, checks are
- // as rare as required, but as often as necessary to ensure never crossing this bound.
- // Furthermore, buffers are only tested at most once per write(), so passing a very
- // large string into write() might have undesirable effects, but this is manageable by
- // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
- // edge case, result in creating at most one complete copy of the string passed in.
- // Set to Infinity to have unlimited buffers.
- sax.MAX_BUFFER_LENGTH = 64 * 1024
-
- var buffers = [
- 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
- 'procInstName', 'procInstBody', 'entity', 'attribName',
- 'attribValue', 'cdata', 'script'
- ]
+/***/ 69900:
+/***/ ((module) => {
- sax.EVENTS = [
- 'text',
- 'processinginstruction',
- 'sgmldeclaration',
- 'doctype',
- 'comment',
- 'opentagstart',
- 'attribute',
- 'opentag',
- 'closetag',
- 'opencdata',
- 'cdata',
- 'closecdata',
- 'error',
- 'end',
- 'ready',
- 'script',
- 'opennamespace',
- 'closenamespace'
- ]
- function SAXParser (strict, opt) {
- if (!(this instanceof SAXParser)) {
- return new SAXParser(strict, opt)
- }
+// Language-neutral expression to match ER_UPDATE_INFO
+var ER_UPDATE_INFO_REGEXP = /^[^:0-9]+: [0-9]+[^:0-9]+: ([0-9]+)[^:0-9]+: [0-9]+[^:0-9]*$/;
- var parser = this
- clearBuffers(parser)
- parser.q = parser.c = ''
- parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
- parser.opt = opt || {}
- parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
- parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
- parser.tags = []
- parser.closed = parser.closedRoot = parser.sawRoot = false
- parser.tag = parser.error = null
- parser.strict = !!strict
- parser.noscript = !!(strict || parser.opt.noscript)
- parser.state = S.BEGIN
- parser.strictEntities = parser.opt.strictEntities
- parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
- parser.attribList = []
+module.exports = OkPacket;
+function OkPacket(options) {
+ options = options || {};
- // namespaces form a prototype chain.
- // it always points at the current tag,
- // which protos to its parent tag.
- if (parser.opt.xmlns) {
- parser.ns = Object.create(rootNS)
- }
+ this.fieldCount = undefined;
+ this.affectedRows = undefined;
+ this.insertId = undefined;
+ this.serverStatus = undefined;
+ this.warningCount = undefined;
+ this.message = undefined;
+ this.protocol41 = options.protocol41;
+}
- // mostly just for error reporting
- parser.trackPosition = parser.opt.position !== false
- if (parser.trackPosition) {
- parser.position = parser.line = parser.column = 0
- }
- emit(parser, 'onready')
+OkPacket.prototype.parse = function(parser) {
+ this.fieldCount = parser.parseUnsignedNumber(1);
+ this.affectedRows = parser.parseLengthCodedNumber();
+ this.insertId = parser.parseLengthCodedNumber();
+ if (this.protocol41) {
+ this.serverStatus = parser.parseUnsignedNumber(2);
+ this.warningCount = parser.parseUnsignedNumber(2);
}
+ this.message = parser.parsePacketTerminatedString();
+ this.changedRows = 0;
- if (!Object.create) {
- Object.create = function (o) {
- function F () {}
- F.prototype = o
- var newf = new F()
- return newf
- }
+ var m = ER_UPDATE_INFO_REGEXP.exec(this.message);
+ if (m !== null) {
+ this.changedRows = parseInt(m[1], 10);
}
+};
- if (!Object.keys) {
- Object.keys = function (o) {
- var a = []
- for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
- return a
- }
+OkPacket.prototype.write = function(writer) {
+ writer.writeUnsignedNumber(1, 0x00);
+ writer.writeLengthCodedNumber(this.affectedRows || 0);
+ writer.writeLengthCodedNumber(this.insertId || 0);
+ if (this.protocol41) {
+ writer.writeUnsignedNumber(2, this.serverStatus || 0);
+ writer.writeUnsignedNumber(2, this.warningCount || 0);
}
+ writer.writeString(this.message);
+};
- function checkBufferLength (parser) {
- var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
- var maxActual = 0
- for (var i = 0, l = buffers.length; i < l; i++) {
- var len = parser[buffers[i]].length
- if (len > maxAllowed) {
- // Text/cdata nodes can get big, and since they're buffered,
- // we can get here under normal conditions.
- // Avoid issues by emitting the text node now,
- // so at least it won't get any bigger.
- switch (buffers[i]) {
- case 'textNode':
- closeText(parser)
- break
- case 'cdata':
- emitNode(parser, 'oncdata', parser.cdata)
- parser.cdata = ''
- break
+/***/ }),
- case 'script':
- emitNode(parser, 'onscript', parser.script)
- parser.script = ''
- break
+/***/ 61949:
+/***/ ((module) => {
- default:
- error(parser, 'Max buffer length exceeded: ' + buffers[i])
- }
- }
- maxActual = Math.max(maxActual, len)
- }
- // schedule the next check for the earliest possible buffer overrun.
- var m = sax.MAX_BUFFER_LENGTH - maxActual
- parser.bufferCheckPosition = m + parser.position
- }
+module.exports = OldPasswordPacket;
+function OldPasswordPacket(options) {
+ options = options || {};
- function clearBuffers (parser) {
- for (var i = 0, l = buffers.length; i < l; i++) {
- parser[buffers[i]] = ''
- }
- }
+ this.scrambleBuff = options.scrambleBuff;
+}
- function flushBuffers (parser) {
- closeText(parser)
- if (parser.cdata !== '') {
- emitNode(parser, 'oncdata', parser.cdata)
- parser.cdata = ''
- }
- if (parser.script !== '') {
- emitNode(parser, 'onscript', parser.script)
- parser.script = ''
- }
- }
+OldPasswordPacket.prototype.parse = function(parser) {
+ this.scrambleBuff = parser.parsePacketTerminatedBuffer();
+};
- SAXParser.prototype = {
- end: function () { end(this) },
- write: write,
- resume: function () { this.error = null; return this },
- close: function () { return this.write(null) },
- flush: function () { flushBuffers(this) }
- }
+OldPasswordPacket.prototype.write = function(writer) {
+ writer.writeBuffer(this.scrambleBuff);
+};
- var Stream
- try {
- Stream = __nccwpck_require__(92413).Stream
- } catch (ex) {
- Stream = function () {}
- }
- var streamWraps = sax.EVENTS.filter(function (ev) {
- return ev !== 'error' && ev !== 'end'
- })
+/***/ }),
- function createStream (strict, opt) {
- return new SAXStream(strict, opt)
- }
+/***/ 29828:
+/***/ ((module) => {
- function SAXStream (strict, opt) {
- if (!(this instanceof SAXStream)) {
- return new SAXStream(strict, opt)
- }
+module.exports = ResultSetHeaderPacket;
+function ResultSetHeaderPacket(options) {
+ options = options || {};
- Stream.apply(this)
+ this.fieldCount = options.fieldCount;
+}
- this._parser = new SAXParser(strict, opt)
- this.writable = true
- this.readable = true
+ResultSetHeaderPacket.prototype.parse = function(parser) {
+ this.fieldCount = parser.parseLengthCodedNumber();
+};
- var me = this
+ResultSetHeaderPacket.prototype.write = function(writer) {
+ writer.writeLengthCodedNumber(this.fieldCount);
+};
- this._parser.onend = function () {
- me.emit('end')
- }
- this._parser.onerror = function (er) {
- me.emit('error', er)
+/***/ }),
- // if didn't throw, then means error was handled.
- // go ahead and clear error, so we can write again.
- me._parser.error = null
- }
+/***/ 96172:
+/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
- this._decoder = null
+var Types = __nccwpck_require__(81699);
+var Charsets = __nccwpck_require__(30124);
+var Field = __nccwpck_require__(3873);
+var IEEE_754_BINARY_64_PRECISION = Math.pow(2, 53);
- streamWraps.forEach(function (ev) {
- Object.defineProperty(me, 'on' + ev, {
- get: function () {
- return me._parser['on' + ev]
- },
- set: function (h) {
- if (!h) {
- me.removeAllListeners(ev)
- me._parser['on' + ev] = h
- return h
- }
- me.on(ev, h)
- },
- enumerable: true,
- configurable: false
- })
- })
- }
+module.exports = RowDataPacket;
+function RowDataPacket() {
+}
- SAXStream.prototype = Object.create(Stream.prototype, {
- constructor: {
- value: SAXStream
- }
- })
+Object.defineProperty(RowDataPacket.prototype, 'parse', {
+ configurable : true,
+ enumerable : false,
+ value : parse
+});
- SAXStream.prototype.write = function (data) {
- if (typeof Buffer === 'function' &&
- typeof Buffer.isBuffer === 'function' &&
- Buffer.isBuffer(data)) {
- if (!this._decoder) {
- var SD = __nccwpck_require__(24304).StringDecoder
- this._decoder = new SD('utf8')
- }
- data = this._decoder.write(data)
- }
+Object.defineProperty(RowDataPacket.prototype, '_typeCast', {
+ configurable : true,
+ enumerable : false,
+ value : typeCast
+});
- this._parser.write(data.toString())
- this.emit('data', data)
- return true
- }
+function parse(parser, fieldPackets, typeCast, nestTables, connection) {
+ var self = this;
+ var next = function () {
+ return self._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings);
+ };
- SAXStream.prototype.end = function (chunk) {
- if (chunk && chunk.length) {
- this.write(chunk)
- }
- this._parser.end()
- return true
- }
+ for (var i = 0; i < fieldPackets.length; i++) {
+ var fieldPacket = fieldPackets[i];
+ var value;
- SAXStream.prototype.on = function (ev, handler) {
- var me = this
- if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
- me._parser['on' + ev] = function () {
- var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
- args.splice(0, 0, ev)
- me.emit.apply(me, args)
- }
+ if (typeof typeCast === 'function') {
+ value = typeCast.apply(connection, [ new Field({ packet: fieldPacket, parser: parser }), next ]);
+ } else {
+ value = (typeCast)
+ ? this._typeCast(fieldPacket, parser, connection.config.timezone, connection.config.supportBigNumbers, connection.config.bigNumberStrings, connection.config.dateStrings)
+ : ( (fieldPacket.charsetNr === Charsets.BINARY)
+ ? parser.parseLengthCodedBuffer()
+ : parser.parseLengthCodedString() );
}
- return Stream.prototype.on.call(me, ev, handler)
+ if (typeof nestTables === 'string' && nestTables.length) {
+ this[fieldPacket.table + nestTables + fieldPacket.name] = value;
+ } else if (nestTables) {
+ this[fieldPacket.table] = this[fieldPacket.table] || {};
+ this[fieldPacket.table][fieldPacket.name] = value;
+ } else {
+ this[fieldPacket.name] = value;
+ }
}
+}
- // this really needs to be replaced with character classes.
- // XML allows all manner of ridiculous numbers and digits.
- var CDATA = '[CDATA['
- var DOCTYPE = 'DOCTYPE'
- var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
- var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
- var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
-
- // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
- // This implementation works on strings, a single character at a time
- // as such, it cannot ever support astral-plane characters (10000-EFFFF)
- // without a significant breaking change to either this parser, or the
- // JavaScript language. Implementation of an emoji-capable xml parser
- // is left as an exercise for the reader.
- var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
-
- var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
-
- var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
- var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+function typeCast(field, parser, timeZone, supportBigNumbers, bigNumberStrings, dateStrings) {
+ var numberString;
- function isWhitespace (c) {
- return c === ' ' || c === '\n' || c === '\r' || c === '\t'
- }
+ switch (field.type) {
+ case Types.TIMESTAMP:
+ case Types.TIMESTAMP2:
+ case Types.DATE:
+ case Types.DATETIME:
+ case Types.DATETIME2:
+ case Types.NEWDATE:
+ var dateString = parser.parseLengthCodedString();
- function isQuote (c) {
- return c === '"' || c === '\''
- }
+ if (typeMatch(field.type, dateStrings)) {
+ return dateString;
+ }
- function isAttribEnd (c) {
- return c === '>' || isWhitespace(c)
- }
+ if (dateString === null) {
+ return null;
+ }
- function isMatch (regex, c) {
- return regex.test(c)
- }
+ var originalString = dateString;
+ if (field.type === Types.DATE) {
+ dateString += ' 00:00:00';
+ }
- function notMatch (regex, c) {
- return !isMatch(regex, c)
- }
+ if (timeZone !== 'local') {
+ dateString += ' ' + timeZone;
+ }
- var S = 0
- sax.STATE = {
- BEGIN: S++, // leading byte order mark or whitespace
- BEGIN_WHITESPACE: S++, // leading whitespace
- TEXT: S++, // general stuff
- TEXT_ENTITY: S++, // & and such.
- OPEN_WAKA: S++, // <
- SGML_DECL: S++, //
- SCRIPT: S++, //