ueberdb2 5.0.14 → 5.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +850 -1335
- package/dist/lib/CacheAndBufferLayer.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var require$$0$6=require('util'),require$$1$5=require('console'),require$$0$o=require('process'),require$$0$9=require('dns'),require$$0$
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var require$$0$6=require('util'),require$$1$5=require('console'),require$$0$o=require('process'),require$$0$9=require('dns'),require$$0$8=require('net'),require$$0$7=require('events'),require$$0$a=require('crypto'),require$$0$b=require('stream'),require$$1$1=require('tls'),require$$0$c=require('os'),require$$1$2=require('path'),require$$0$d=require('fs'),require$$2$2=require('https'),require$$0$e=require('zlib'),require$$0$f=require('url'),require$$0$g=require('vm'),http=require('http'),require$$0$i=require('assert'),require$$0$h=require('tty'),node_path=require('node:path'),child_process=require('child_process'),require$$0$j=require('node:events'),require$$0$k=require('buffer'),require$$1$3=require('querystring'),require$$14=require('stream/web'),require$$0$l=require('node:stream'),require$$1$4=require('node:util'),require$$0$m=require('worker_threads'),require$$2$3=require('perf_hooks'),require$$5$2=require('util/types'),require$$4$1=require('async_hooks'),require$$1$6=require('string_decoder'),require$$0$n=require('diagnostics_channel'),require$$1$7=require('timers'),require$$0$p=require('fs/promises'),require$$0$q=require('timers/promises'),require$$5$3=require('constants'),os=require('node:os'),process$2=require('node:process'),http$1=require('node:http'),https=require('node:https'),zlib=require('node:zlib'),fs=require('node:fs'),require$$0$r=require('dgram'),require$$2$4=require('node:url'),rustyStoreKv=require('rusty-store-kv');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var child_process__namespace=/*#__PURE__*/_interopNamespaceDefault(child_process);var os__namespace=/*#__PURE__*/_interopNamespaceDefault(os);var process__namespace=/*#__PURE__*/_interopNamespaceDefault(process$2);var http__namespace=/*#__PURE__*/_interopNamespaceDefault(http$1);var https__namespace=/*#__PURE__*/_interopNamespaceDefault(https);var zlib__namespace=/*#__PURE__*/_interopNamespaceDefault(zlib);// @ts-nocheck
|
|
2
2
|
/**
|
|
3
3
|
* 2011 Peter 'Pita' Martischka
|
|
4
4
|
*
|
|
@@ -468,7 +468,13 @@ const Database$1 = class Database {
|
|
|
468
468
|
ptr.obj = ptr.obj[ptr.prop];
|
|
469
469
|
ptr.prop = sub[i];
|
|
470
470
|
}
|
|
471
|
-
|
|
471
|
+
// Delete the property if value is undefined. JSON.stringify() ignores such properties.
|
|
472
|
+
if (value == null) {
|
|
473
|
+
delete ptr.obj[ptr.prop];
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
ptr.obj[ptr.prop] = value;
|
|
477
|
+
}
|
|
472
478
|
}
|
|
473
479
|
catch (err) {
|
|
474
480
|
// this._setLocked() will not be called but it should still count as a write failure.
|
|
@@ -480,7 +486,7 @@ const Database$1 = class Database {
|
|
|
480
486
|
p = this._setLocked(key, base.fullValue);
|
|
481
487
|
}
|
|
482
488
|
finally {
|
|
483
|
-
this._unlock(key);
|
|
489
|
+
await this._unlock(key);
|
|
484
490
|
}
|
|
485
491
|
}
|
|
486
492
|
finally {
|
|
@@ -1117,8 +1123,8 @@ function requireUtils$c () {
|
|
|
1117
1123
|
hasRequiredUtils$c = 1;
|
|
1118
1124
|
|
|
1119
1125
|
const util = require$$0$6;
|
|
1120
|
-
const net = require$$0$
|
|
1121
|
-
const { EventEmitter } = require$$0$
|
|
1126
|
+
const net = require$$0$8;
|
|
1127
|
+
const { EventEmitter } = require$$0$7;
|
|
1122
1128
|
|
|
1123
1129
|
const errors = requireErrors$c();
|
|
1124
1130
|
const promiseUtils = requirePromiseUtils();
|
|
@@ -2330,7 +2336,7 @@ function requireAddressResolution () {
|
|
|
2330
2336
|
addressResolution.AddressTranslator = AddressTranslator;
|
|
2331
2337
|
addressResolution.EC2MultiRegionTranslator = EC2MultiRegionTranslator;
|
|
2332
2338
|
return addressResolution;
|
|
2333
|
-
}var types$
|
|
2339
|
+
}var types$2 = {};var umd = {exports: {}};var hasRequiredUmd;
|
|
2334
2340
|
|
|
2335
2341
|
function requireUmd () {
|
|
2336
2342
|
if (hasRequiredUmd) return umd.exports;
|
|
@@ -3329,7 +3335,7 @@ function requireUmd () {
|
|
|
3329
3335
|
// guard against signed division overflow: the largest
|
|
3330
3336
|
// negative number / -1 would be 1 larger than the largest
|
|
3331
3337
|
// positive number, due to two's complement.
|
|
3332
|
-
if (!this.unsigned && this.high === -
|
|
3338
|
+
if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) {
|
|
3333
3339
|
// be consistent with non-wasm code path
|
|
3334
3340
|
return this;
|
|
3335
3341
|
}
|
|
@@ -5363,7 +5369,7 @@ function requireInteger () {
|
|
|
5363
5369
|
} else if (diff.isZero()) {
|
|
5364
5370
|
return 0;
|
|
5365
5371
|
} else {
|
|
5366
|
-
return
|
|
5372
|
+
return 1;
|
|
5367
5373
|
}
|
|
5368
5374
|
};
|
|
5369
5375
|
|
|
@@ -5868,7 +5874,7 @@ function requireBigDecimal () {
|
|
|
5868
5874
|
if (diff.isZero()) {
|
|
5869
5875
|
return 0;
|
|
5870
5876
|
}
|
|
5871
|
-
return
|
|
5877
|
+
return 1;
|
|
5872
5878
|
};
|
|
5873
5879
|
|
|
5874
5880
|
/**
|
|
@@ -7363,7 +7369,7 @@ function requireLocalTime () {
|
|
|
7363
7369
|
throw new Error('Not a valid date');
|
|
7364
7370
|
}
|
|
7365
7371
|
//Use the local representation, only the milliseconds portion
|
|
7366
|
-
const millis = (date.getTime() + date.getTimezoneOffset() * -
|
|
7372
|
+
const millis = (date.getTime() + date.getTimezoneOffset() * -6e4) % millisInDay;
|
|
7367
7373
|
return LocalTime.fromMilliseconds(millis, nanoseconds);
|
|
7368
7374
|
};
|
|
7369
7375
|
|
|
@@ -8178,7 +8184,7 @@ function requireTuple () {
|
|
|
8178
8184
|
var hasRequiredTypes$2;
|
|
8179
8185
|
|
|
8180
8186
|
function requireTypes$2 () {
|
|
8181
|
-
if (hasRequiredTypes$2) return types$
|
|
8187
|
+
if (hasRequiredTypes$2) return types$2;
|
|
8182
8188
|
hasRequiredTypes$2 = 1;
|
|
8183
8189
|
const util = require$$0$6;
|
|
8184
8190
|
|
|
@@ -8761,39 +8767,39 @@ function requireTypes$2 () {
|
|
|
8761
8767
|
}
|
|
8762
8768
|
util.inherits(TimeoutError, errors.DriverError);
|
|
8763
8769
|
|
|
8764
|
-
types$
|
|
8765
|
-
types$
|
|
8766
|
-
types$
|
|
8767
|
-
types$
|
|
8768
|
-
types$
|
|
8769
|
-
types$
|
|
8770
|
-
types$
|
|
8771
|
-
types$
|
|
8772
|
-
types$
|
|
8773
|
-
types$
|
|
8774
|
-
types$
|
|
8775
|
-
types$
|
|
8776
|
-
types$
|
|
8777
|
-
types$
|
|
8778
|
-
types$
|
|
8779
|
-
types$
|
|
8780
|
-
types$
|
|
8781
|
-
types$
|
|
8782
|
-
types$
|
|
8783
|
-
types$
|
|
8784
|
-
types$
|
|
8785
|
-
types$
|
|
8786
|
-
types$
|
|
8787
|
-
types$
|
|
8770
|
+
types$2.opcodes = opcodes;
|
|
8771
|
+
types$2.consistencies = consistencies;
|
|
8772
|
+
types$2.consistencyToString = consistencyToString;
|
|
8773
|
+
types$2.dataTypes = dataTypes;
|
|
8774
|
+
types$2.getDataTypeNameByCode = getDataTypeNameByCode;
|
|
8775
|
+
types$2.distance = distance;
|
|
8776
|
+
types$2.frameFlags = frameFlags;
|
|
8777
|
+
types$2.protocolEvents = protocolEvents;
|
|
8778
|
+
types$2.protocolVersion = protocolVersion;
|
|
8779
|
+
types$2.responseErrorCodes = responseErrorCodes;
|
|
8780
|
+
types$2.resultKind = resultKind;
|
|
8781
|
+
types$2.timeuuid = timeuuid;
|
|
8782
|
+
types$2.uuid = uuid;
|
|
8783
|
+
types$2.BigDecimal = requireBigDecimal();
|
|
8784
|
+
types$2.Duration = requireDuration();
|
|
8785
|
+
types$2.FrameHeader = FrameHeader;
|
|
8786
|
+
types$2.InetAddress = requireInetAddress();
|
|
8787
|
+
types$2.Integer = requireInteger();
|
|
8788
|
+
types$2.LocalDate = requireLocalDate();
|
|
8789
|
+
types$2.LocalTime = requireLocalTime();
|
|
8790
|
+
types$2.Long = Long;
|
|
8791
|
+
types$2.ResultSet = requireResultSet$1();
|
|
8792
|
+
types$2.ResultStream = requireResultStream();
|
|
8793
|
+
types$2.Row = requireRow();
|
|
8788
8794
|
//export DriverError for backward-compatibility
|
|
8789
|
-
types$
|
|
8790
|
-
types$
|
|
8791
|
-
types$
|
|
8792
|
-
types$
|
|
8793
|
-
types$
|
|
8794
|
-
types$
|
|
8795
|
-
types$
|
|
8796
|
-
return types$
|
|
8795
|
+
types$2.DriverError = errors.DriverError;
|
|
8796
|
+
types$2.TimeoutError = TimeoutError;
|
|
8797
|
+
types$2.TimeUuid = TimeUuid;
|
|
8798
|
+
types$2.Tuple = requireTuple();
|
|
8799
|
+
types$2.Uuid = Uuid;
|
|
8800
|
+
types$2.unset = unset;
|
|
8801
|
+
types$2.generateTimestamp = generateTimestamp;
|
|
8802
|
+
return types$2;
|
|
8797
8803
|
}/*
|
|
8798
8804
|
* Copyright DataStax, Inc.
|
|
8799
8805
|
*
|
|
@@ -10647,7 +10653,7 @@ function requireRequestLogger () {
|
|
|
10647
10653
|
if (hasRequiredRequestLogger) return requestLogger;
|
|
10648
10654
|
hasRequiredRequestLogger = 1;
|
|
10649
10655
|
|
|
10650
|
-
const events = require$$0$
|
|
10656
|
+
const events = require$$0$7;
|
|
10651
10657
|
const RequestTracker = requireRequestTracker();
|
|
10652
10658
|
const errors = requireErrors$c();
|
|
10653
10659
|
const { format } = require$$0$6;
|
|
@@ -11113,7 +11119,7 @@ function requireDefaultMetrics () {
|
|
|
11113
11119
|
hasRequiredDefaultMetrics = 1;
|
|
11114
11120
|
|
|
11115
11121
|
const ClientMetrics = requireClientMetrics();
|
|
11116
|
-
const EventEmitter = require$$0$
|
|
11122
|
+
const EventEmitter = require$$0$7;
|
|
11117
11123
|
|
|
11118
11124
|
/**
|
|
11119
11125
|
* A default implementation of [ClientMetrics]{@link module:metrics~ClientMetrics} that exposes the driver events as
|
|
@@ -12882,7 +12888,7 @@ var hasRequiredWriters;
|
|
|
12882
12888
|
function requireWriters () {
|
|
12883
12889
|
if (hasRequiredWriters) return writers;
|
|
12884
12890
|
hasRequiredWriters = 1;
|
|
12885
|
-
const events = require$$0$
|
|
12891
|
+
const events = require$$0$7;
|
|
12886
12892
|
|
|
12887
12893
|
const types = requireTypes$2();
|
|
12888
12894
|
const utils = requireUtils$c();
|
|
@@ -13802,77 +13808,11 @@ function requireExecutionOptions () {
|
|
|
13802
13808
|
|
|
13803
13809
|
executionOptions = { ExecutionOptions, DefaultExecutionOptions, proxyExecuteKey };
|
|
13804
13810
|
return executionOptions;
|
|
13805
|
-
}var
|
|
13806
|
-
var
|
|
13807
|
-
var description$6 = "DataStax Node.js Driver for Apache Cassandra";
|
|
13808
|
-
var author$5 = "DataStax";
|
|
13809
|
-
var keywords$7 = [
|
|
13810
|
-
"cassandra",
|
|
13811
|
-
"cql",
|
|
13812
|
-
"cql3",
|
|
13813
|
-
"connection",
|
|
13814
|
-
"gremlin",
|
|
13815
|
-
"datastax",
|
|
13816
|
-
"nosql",
|
|
13817
|
-
"driver",
|
|
13818
|
-
"database",
|
|
13819
|
-
"dse",
|
|
13820
|
-
"graph",
|
|
13821
|
-
"graphdb"
|
|
13822
|
-
];
|
|
13823
|
-
var license$8 = "Apache-2.0";
|
|
13824
|
-
var types$8 = "./index.d.ts";
|
|
13825
|
-
var dependencies$7 = {
|
|
13826
|
-
"@types/long": "~5.0.0",
|
|
13827
|
-
"@types/node": ">=8",
|
|
13828
|
-
"adm-zip": "~0.5.10",
|
|
13829
|
-
long: "~5.2.3"
|
|
13830
|
-
};
|
|
13831
|
-
var devDependencies$7 = {
|
|
13832
|
-
chai: "~4.3.8",
|
|
13833
|
-
kerberos: "~2.0.3",
|
|
13834
|
-
mocha: "~10.2.0",
|
|
13835
|
-
"mocha-jenkins-reporter": "~0.4.8",
|
|
13836
|
-
proxyquire: "~2.1.3",
|
|
13837
|
-
sinon: "~15.2.0",
|
|
13838
|
-
temp: ">= 0.8.3"
|
|
13839
|
-
};
|
|
13840
|
-
var repository$7 = {
|
|
13841
|
-
type: "git",
|
|
13842
|
-
url: "https://github.com/datastax/nodejs-driver.git"
|
|
13843
|
-
};
|
|
13844
|
-
var bugs$5 = {
|
|
13845
|
-
url: "https://groups.google.com/a/lists.datastax.com/forum/#!forum/nodejs-driver-user"
|
|
13846
|
-
};
|
|
13847
|
-
var scripts$7 = {
|
|
13848
|
-
test: "./node_modules/.bin/mocha test/unit -R spec -t 5000 --recursive",
|
|
13849
|
-
unit: "./node_modules/.bin/mocha test/unit -R spec -t 5000 --recursive",
|
|
13850
|
-
integration_short: "./node_modules/.bin/mocha test/integration/short -R spec -t 5000 --recursive",
|
|
13851
|
-
integration_long: "./node_modules/.bin/mocha test/integration/long -R spec -t 5000 --recursive",
|
|
13852
|
-
ci_jenkins: "./node_modules/.bin/mocha test/unit test/integration/short --recursive -R mocha-jenkins-reporter --exit",
|
|
13853
|
-
ci_appveyor: "./node_modules/.bin/mocha test/unit test/integration/short --recursive -R mocha-appveyor-reporter --exit",
|
|
13854
|
-
ci_unit_appveyor: "./node_modules/.bin/mocha test/unit --recursive -R mocha-appveyor-reporter --exit",
|
|
13855
|
-
server_api: "./node_modules/.bin/mocha test/integration/short -g '@SERVER_API' --recursive --exit",
|
|
13856
|
-
eslint: "eslint lib test"
|
|
13857
|
-
};
|
|
13858
|
-
var engines$7 = {
|
|
13859
|
-
node: ">=16"
|
|
13860
|
-
};
|
|
13811
|
+
}var version$9 = "4.7.2";
|
|
13812
|
+
var description = "DataStax Node.js Driver for Apache Cassandra";
|
|
13861
13813
|
var require$$17 = {
|
|
13862
|
-
name: name$9,
|
|
13863
13814
|
version: version$9,
|
|
13864
|
-
description: description
|
|
13865
|
-
author: author$5,
|
|
13866
|
-
keywords: keywords$7,
|
|
13867
|
-
license: license$8,
|
|
13868
|
-
types: types$8,
|
|
13869
|
-
dependencies: dependencies$7,
|
|
13870
|
-
devDependencies: devDependencies$7,
|
|
13871
|
-
repository: repository$7,
|
|
13872
|
-
bugs: bugs$5,
|
|
13873
|
-
scripts: scripts$7,
|
|
13874
|
-
engines: engines$7
|
|
13875
|
-
};/*
|
|
13815
|
+
description: description};/*
|
|
13876
13816
|
* Copyright DataStax, Inc.
|
|
13877
13817
|
*
|
|
13878
13818
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -13907,16 +13847,12 @@ function requireRequests () {
|
|
|
13907
13847
|
*/
|
|
13908
13848
|
const queryFlag = {
|
|
13909
13849
|
values: 0x01,
|
|
13910
|
-
skipMetadata: 0x02,
|
|
13911
13850
|
pageSize: 0x04,
|
|
13912
13851
|
withPagingState: 0x08,
|
|
13913
13852
|
withSerialConsistency: 0x10,
|
|
13914
13853
|
withDefaultTimestamp: 0x20,
|
|
13915
13854
|
withNameForValues: 0x40,
|
|
13916
|
-
withKeyspace: 0x80
|
|
13917
|
-
withPageSizeBytes: 0x40000000,
|
|
13918
|
-
withContinuousPaging: 0x80000000
|
|
13919
|
-
};
|
|
13855
|
+
withKeyspace: 0x80};
|
|
13920
13856
|
|
|
13921
13857
|
/**
|
|
13922
13858
|
* Options for the execution of a batch request from protocol v3 and above
|
|
@@ -13925,7 +13861,6 @@ function requireRequests () {
|
|
|
13925
13861
|
const batchFlag = {
|
|
13926
13862
|
withSerialConsistency: 0x10,
|
|
13927
13863
|
withDefaultTimestamp: 0x20,
|
|
13928
|
-
withNameForValues: 0x40,
|
|
13929
13864
|
withKeyspace: 0x80
|
|
13930
13865
|
};
|
|
13931
13866
|
|
|
@@ -18571,7 +18506,6 @@ function requireReaders () {
|
|
|
18571
18506
|
const resultFlag = {
|
|
18572
18507
|
globalTablesSpec: 0x0001,
|
|
18573
18508
|
hasMorePages: 0x0002,
|
|
18574
|
-
noMetadata: 0x0004,
|
|
18575
18509
|
metadataChanged: 0x0008,
|
|
18576
18510
|
continuousPaging: 0x40000000,
|
|
18577
18511
|
lastContinuousPage: 0x80000000,
|
|
@@ -20073,10 +20007,10 @@ function requireConnection$6 () {
|
|
|
20073
20007
|
if (hasRequiredConnection$6) return connection$6;
|
|
20074
20008
|
hasRequiredConnection$6 = 1;
|
|
20075
20009
|
|
|
20076
|
-
const events = require$$0$
|
|
20010
|
+
const events = require$$0$7;
|
|
20077
20011
|
const util = require$$0$6;
|
|
20078
20012
|
const tls = require$$1$1;
|
|
20079
|
-
const net = require$$0$
|
|
20013
|
+
const net = require$$0$8;
|
|
20080
20014
|
|
|
20081
20015
|
const Encoder = requireEncoder$1();
|
|
20082
20016
|
const { WriteQueue } = requireWriters();
|
|
@@ -20869,7 +20803,7 @@ function requireHostConnectionPool () {
|
|
|
20869
20803
|
if (hasRequiredHostConnectionPool) return hostConnectionPool;
|
|
20870
20804
|
hasRequiredHostConnectionPool = 1;
|
|
20871
20805
|
const util = require$$0$6;
|
|
20872
|
-
const events = require$$0$
|
|
20806
|
+
const events = require$$0$7;
|
|
20873
20807
|
|
|
20874
20808
|
const Connection = requireConnection$6();
|
|
20875
20809
|
const utils = requireUtils$c();
|
|
@@ -21702,7 +21636,7 @@ function requireHost () {
|
|
|
21702
21636
|
if (hasRequiredHost) return host;
|
|
21703
21637
|
hasRequiredHost = 1;
|
|
21704
21638
|
|
|
21705
|
-
const events = require$$0$
|
|
21639
|
+
const events = require$$0$7;
|
|
21706
21640
|
|
|
21707
21641
|
const utils = requireUtils$c();
|
|
21708
21642
|
const types = requireTypes$2();
|
|
@@ -22956,7 +22890,7 @@ function requireDataCollection () {
|
|
|
22956
22890
|
if (hasRequiredDataCollection) return dataCollection;
|
|
22957
22891
|
hasRequiredDataCollection = 1;
|
|
22958
22892
|
const util = require$$0$6;
|
|
22959
|
-
const events = require$$0$
|
|
22893
|
+
const events = require$$0$7;
|
|
22960
22894
|
/**
|
|
22961
22895
|
* Creates a new instance of DataCollection
|
|
22962
22896
|
* @param {String} name Name of the data object.
|
|
@@ -23619,7 +23553,7 @@ function requireSchemaParser () {
|
|
|
23619
23553
|
if (hasRequiredSchemaParser) return schemaParser;
|
|
23620
23554
|
hasRequiredSchemaParser = 1;
|
|
23621
23555
|
const util = require$$0$6;
|
|
23622
|
-
const events = require$$0$
|
|
23556
|
+
const events = require$$0$7;
|
|
23623
23557
|
const types = requireTypes$2();
|
|
23624
23558
|
const utils = requireUtils$c();
|
|
23625
23559
|
const errors = requireErrors$c();
|
|
@@ -24802,7 +24736,7 @@ function requireMetadata () {
|
|
|
24802
24736
|
if (hasRequiredMetadata) return metadata;
|
|
24803
24737
|
hasRequiredMetadata = 1;
|
|
24804
24738
|
|
|
24805
|
-
const events = require$$0$
|
|
24739
|
+
const events = require$$0$7;
|
|
24806
24740
|
const util = require$$0$6;
|
|
24807
24741
|
|
|
24808
24742
|
/**
|
|
@@ -26002,9 +25936,9 @@ var hasRequiredControlConnection;
|
|
|
26002
25936
|
function requireControlConnection () {
|
|
26003
25937
|
if (hasRequiredControlConnection) return controlConnection;
|
|
26004
25938
|
hasRequiredControlConnection = 1;
|
|
26005
|
-
const events = require$$0$
|
|
25939
|
+
const events = require$$0$7;
|
|
26006
25940
|
const util = require$$0$6;
|
|
26007
|
-
const net = require$$0$
|
|
25941
|
+
const net = require$$0$8;
|
|
26008
25942
|
const dns = require$$0$9;
|
|
26009
25943
|
|
|
26010
25944
|
const errors = requireErrors$c();
|
|
@@ -26023,8 +25957,6 @@ function requireControlConnection () {
|
|
|
26023
25957
|
const newNodeDelay = 1000;
|
|
26024
25958
|
const metadataQueryAbortTimeout = 2000;
|
|
26025
25959
|
const schemaChangeTypes = {
|
|
26026
|
-
created: 'CREATED',
|
|
26027
|
-
updated: 'UPDATED',
|
|
26028
25960
|
dropped: 'DROPPED'
|
|
26029
25961
|
};
|
|
26030
25962
|
const supportedProductTypeKey = 'PRODUCT_TYPE';
|
|
@@ -28778,7 +28710,7 @@ function requireUtils$b () {
|
|
|
28778
28710
|
if (!crcTable.length) genCRCTable();
|
|
28779
28711
|
|
|
28780
28712
|
let len = buf.length;
|
|
28781
|
-
let crc =
|
|
28713
|
+
let crc = -1;
|
|
28782
28714
|
for (let off = 0; off < len; ) crc = Utils.crc32update(crc, buf[off++]);
|
|
28783
28715
|
// xor and cast as uint32 number
|
|
28784
28716
|
return ~crc >>> 0;
|
|
@@ -31237,7 +31169,7 @@ function requireCloud () {
|
|
|
31237
31169
|
if (hasRequiredCloud) return cloud;
|
|
31238
31170
|
hasRequiredCloud = 1;
|
|
31239
31171
|
|
|
31240
|
-
const https = require$$2$
|
|
31172
|
+
const https = require$$2$2;
|
|
31241
31173
|
const fs = require$$0$d;
|
|
31242
31174
|
const util = require$$0$6;
|
|
31243
31175
|
const AdmZip = requireAdmZip();
|
|
@@ -33953,7 +33885,7 @@ function requireClient$6 () {
|
|
|
33953
33885
|
if (hasRequiredClient$6) return client$6;
|
|
33954
33886
|
hasRequiredClient$6 = 1;
|
|
33955
33887
|
|
|
33956
|
-
const events = require$$0$
|
|
33888
|
+
const events = require$$0$7;
|
|
33957
33889
|
const util = require$$0$6;
|
|
33958
33890
|
|
|
33959
33891
|
const utils = requireUtils$c();
|
|
@@ -35140,7 +35072,7 @@ function requireTree () {
|
|
|
35140
35072
|
if (hasRequiredTree) return tree;
|
|
35141
35073
|
hasRequiredTree = 1;
|
|
35142
35074
|
|
|
35143
|
-
const EventEmitter = require$$0$
|
|
35075
|
+
const EventEmitter = require$$0$7;
|
|
35144
35076
|
|
|
35145
35077
|
/**
|
|
35146
35078
|
* Represents a tree node where the key is composed by 1 or more strings.
|
|
@@ -39179,16 +39111,16 @@ function requireSyntax () {
|
|
|
39179
39111
|
/** @type {import('./syntax')} */
|
|
39180
39112
|
syntax = SyntaxError;
|
|
39181
39113
|
return syntax;
|
|
39182
|
-
}var type
|
|
39114
|
+
}var type;
|
|
39183
39115
|
var hasRequiredType;
|
|
39184
39116
|
|
|
39185
39117
|
function requireType () {
|
|
39186
|
-
if (hasRequiredType) return type
|
|
39118
|
+
if (hasRequiredType) return type;
|
|
39187
39119
|
hasRequiredType = 1;
|
|
39188
39120
|
|
|
39189
39121
|
/** @type {import('./type')} */
|
|
39190
|
-
type
|
|
39191
|
-
return type
|
|
39122
|
+
type = TypeError;
|
|
39123
|
+
return type;
|
|
39192
39124
|
}var uri;
|
|
39193
39125
|
var hasRequiredUri;
|
|
39194
39126
|
|
|
@@ -40076,7 +40008,7 @@ function requireObjectInspect () {
|
|
|
40076
40008
|
num === Infinity
|
|
40077
40009
|
|| num === -Infinity
|
|
40078
40010
|
|| num !== num
|
|
40079
|
-
|| (num && num > -
|
|
40011
|
+
|| (num && num > -1e3 && num < 1000)
|
|
40080
40012
|
|| $test.call(/e/, str)
|
|
40081
40013
|
) {
|
|
40082
40014
|
return str;
|
|
@@ -53373,7 +53305,7 @@ function requireForm_data () {
|
|
|
53373
53305
|
var util = require$$0$6;
|
|
53374
53306
|
var path = require$$1$2;
|
|
53375
53307
|
var http$1 = http;
|
|
53376
|
-
var https = require$$2$
|
|
53308
|
+
var https = require$$2$2;
|
|
53377
53309
|
var parseUrl = require$$0$f.parse;
|
|
53378
53310
|
var fs = require$$0$d;
|
|
53379
53311
|
var Stream = require$$0$b.Stream;
|
|
@@ -54977,7 +54909,7 @@ function requireFollowRedirects () {
|
|
|
54977
54909
|
var url = require$$0$f;
|
|
54978
54910
|
var URL = url.URL;
|
|
54979
54911
|
var http$1 = http;
|
|
54980
|
-
var https = require$$2$
|
|
54912
|
+
var https = require$$2$2;
|
|
54981
54913
|
var Writable = require$$0$b.Writable;
|
|
54982
54914
|
var assert = require$$0$i;
|
|
54983
54915
|
var debug = requireDebug$2();
|
|
@@ -55658,12 +55590,12 @@ function requireAxios () {
|
|
|
55658
55590
|
const url = require$$0$f;
|
|
55659
55591
|
const proxyFromEnv = requireProxyFromEnv();
|
|
55660
55592
|
const http$1 = http;
|
|
55661
|
-
const https = require$$2$
|
|
55593
|
+
const https = require$$2$2;
|
|
55662
55594
|
const util = require$$0$6;
|
|
55663
55595
|
const followRedirects = requireFollowRedirects();
|
|
55664
55596
|
const zlib = require$$0$e;
|
|
55665
55597
|
const stream = require$$0$b;
|
|
55666
|
-
const events = require$$0$
|
|
55598
|
+
const events = require$$0$7;
|
|
55667
55599
|
|
|
55668
55600
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
55669
55601
|
|
|
@@ -57125,7 +57057,7 @@ function requireAxios () {
|
|
|
57125
57057
|
}
|
|
57126
57058
|
}
|
|
57127
57059
|
|
|
57128
|
-
return (
|
|
57060
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
57129
57061
|
}
|
|
57130
57062
|
|
|
57131
57063
|
const defaults = {
|
|
@@ -60395,76 +60327,17 @@ function requireAxios () {
|
|
|
60395
60327
|
axios_1 = axios;
|
|
60396
60328
|
|
|
60397
60329
|
return axios_1;
|
|
60398
|
-
}var name$
|
|
60399
|
-
var description$5 = "The official CouchDB client for Node.js";
|
|
60400
|
-
var license$7 = "Apache-2.0";
|
|
60401
|
-
var homepage$6 = "http://github.com/apache/couchdb-nano";
|
|
60402
|
-
var repository$6 = "http://github.com/apache/couchdb-nano";
|
|
60330
|
+
}var name$2 = "nano";
|
|
60403
60331
|
var version$8 = "10.1.4";
|
|
60404
|
-
var author$4 = "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)";
|
|
60405
|
-
var keywords$6 = [
|
|
60406
|
-
"couchdb",
|
|
60407
|
-
"data",
|
|
60408
|
-
"request",
|
|
60409
|
-
"json",
|
|
60410
|
-
"nosql",
|
|
60411
|
-
"micro",
|
|
60412
|
-
"nano",
|
|
60413
|
-
"database"
|
|
60414
|
-
];
|
|
60415
|
-
var dependencies$6 = {
|
|
60416
|
-
axios: "^1.7.4",
|
|
60417
|
-
qs: "^6.13.0",
|
|
60418
|
-
"node-abort-controller": "^3.1.1"
|
|
60419
|
-
};
|
|
60420
|
-
var devDependencies$6 = {
|
|
60421
|
-
"@types/node": "^22.3.0",
|
|
60422
|
-
jest: "^29.7.0",
|
|
60423
|
-
nock: "^13.5.4",
|
|
60424
|
-
standard: "^17.1.0",
|
|
60425
|
-
typescript: "^5.5.4"
|
|
60426
|
-
};
|
|
60427
|
-
var scripts$6 = {
|
|
60428
|
-
standard: "standard --fix",
|
|
60429
|
-
test: "standard && tsc lib/nano.d.ts && npm run jest",
|
|
60430
|
-
jest: "jest test/* --coverage --env node"
|
|
60431
|
-
};
|
|
60432
|
-
var main$7 = "./lib/nano.js";
|
|
60433
|
-
var types$7 = "./lib/nano.d.ts";
|
|
60434
|
-
var engines$6 = {
|
|
60435
|
-
node: ">=14"
|
|
60436
|
-
};
|
|
60437
|
-
var standard = {
|
|
60438
|
-
env: [
|
|
60439
|
-
"jest"
|
|
60440
|
-
]
|
|
60441
|
-
};
|
|
60442
60332
|
var require$$7$2 = {
|
|
60443
|
-
name: name$
|
|
60444
|
-
|
|
60445
|
-
license: license$7,
|
|
60446
|
-
homepage: homepage$6,
|
|
60447
|
-
repository: repository$6,
|
|
60448
|
-
version: version$8,
|
|
60449
|
-
author: author$4,
|
|
60450
|
-
keywords: keywords$6,
|
|
60451
|
-
dependencies: dependencies$6,
|
|
60452
|
-
devDependencies: devDependencies$6,
|
|
60453
|
-
scripts: scripts$6,
|
|
60454
|
-
main: main$7,
|
|
60455
|
-
types: types$7,
|
|
60456
|
-
engines: engines$6,
|
|
60457
|
-
"pre-commit": [
|
|
60458
|
-
"test"
|
|
60459
|
-
],
|
|
60460
|
-
standard: standard
|
|
60461
|
-
};var nodeAbortController;
|
|
60333
|
+
name: name$2,
|
|
60334
|
+
version: version$8};var nodeAbortController;
|
|
60462
60335
|
var hasRequiredNodeAbortController;
|
|
60463
60336
|
|
|
60464
60337
|
function requireNodeAbortController () {
|
|
60465
60338
|
if (hasRequiredNodeAbortController) return nodeAbortController;
|
|
60466
60339
|
hasRequiredNodeAbortController = 1;
|
|
60467
|
-
const { EventEmitter } = require$$0$
|
|
60340
|
+
const { EventEmitter } = require$$0$7;
|
|
60468
60341
|
|
|
60469
60342
|
class AbortSignal {
|
|
60470
60343
|
constructor() {
|
|
@@ -60539,7 +60412,7 @@ var hasRequiredChangesreader;
|
|
|
60539
60412
|
function requireChangesreader () {
|
|
60540
60413
|
if (hasRequiredChangesreader) return changesreader;
|
|
60541
60414
|
hasRequiredChangesreader = 1;
|
|
60542
|
-
const EventEmitter = require$$0$
|
|
60415
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
60543
60416
|
const AbortController = commonjsGlobal.AbortController || requireNodeAbortController().AbortController;
|
|
60544
60417
|
const stream = require$$0$b;
|
|
60545
60418
|
const EVENT_BATCH = 'batch';
|
|
@@ -61054,7 +60927,7 @@ function requireNano () {
|
|
|
61054
60927
|
|
|
61055
60928
|
const { URL } = require$$0$f;
|
|
61056
60929
|
const http$1 = http;
|
|
61057
|
-
const https = require$$2$
|
|
60930
|
+
const https = require$$2$2;
|
|
61058
60931
|
const assert = require$$0$i;
|
|
61059
60932
|
const querystring = /*@__PURE__*/ requireLib$a();
|
|
61060
60933
|
const axios = /*@__PURE__*/ requireAxios();
|
|
@@ -62506,7 +62379,7 @@ function requireDirty$1 () {
|
|
|
62506
62379
|
hasRequiredDirty$1 = 1;
|
|
62507
62380
|
Object.defineProperty(dirty, "__esModule", { value: true });
|
|
62508
62381
|
const fs_1 = require$$0$d;
|
|
62509
|
-
const events_1 = require$$0$
|
|
62382
|
+
const events_1 = require$$0$7;
|
|
62510
62383
|
class Dirty extends events_1.EventEmitter {
|
|
62511
62384
|
path;
|
|
62512
62385
|
_data;
|
|
@@ -62784,7 +62657,7 @@ class Dirty_db extends AbstractDatabase {
|
|
|
62784
62657
|
if (callback)
|
|
62785
62658
|
callback();
|
|
62786
62659
|
}
|
|
62787
|
-
}var dist$
|
|
62660
|
+
}var dist$e = {};var src$3 = {};var src$2 = {exports: {}};var browser$1 = {exports: {}};/**
|
|
62788
62661
|
* Helpers.
|
|
62789
62662
|
*/
|
|
62790
62663
|
|
|
@@ -63859,11 +63732,11 @@ function requireSrc$1 () {
|
|
|
63859
63732
|
|
|
63860
63733
|
} (src$3));
|
|
63861
63734
|
return src$3;
|
|
63862
|
-
}var hasRequiredDist$
|
|
63735
|
+
}var hasRequiredDist$e;
|
|
63863
63736
|
|
|
63864
|
-
function requireDist$
|
|
63865
|
-
if (hasRequiredDist$
|
|
63866
|
-
hasRequiredDist$
|
|
63737
|
+
function requireDist$e () {
|
|
63738
|
+
if (hasRequiredDist$e) return dist$e;
|
|
63739
|
+
hasRequiredDist$e = 1;
|
|
63867
63740
|
(function (exports) {
|
|
63868
63741
|
function __export(m) {
|
|
63869
63742
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
@@ -63871,16 +63744,16 @@ function requireDist$d () {
|
|
|
63871
63744
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63872
63745
|
__export(requireSrc$1());
|
|
63873
63746
|
|
|
63874
|
-
} (dist$
|
|
63875
|
-
return dist$
|
|
63876
|
-
}var distExports$4 = requireDist$
|
|
63877
|
-
var debug$1 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);var dist$
|
|
63747
|
+
} (dist$e));
|
|
63748
|
+
return dist$e;
|
|
63749
|
+
}var distExports$4 = requireDist$e();var srcExports = requireSrc$2();
|
|
63750
|
+
var debug$1 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);var dist$d = {};var hasRequiredDist$d;
|
|
63878
63751
|
|
|
63879
|
-
function requireDist$
|
|
63880
|
-
if (hasRequiredDist$
|
|
63881
|
-
hasRequiredDist$
|
|
63882
|
-
Object.defineProperty(dist$
|
|
63883
|
-
dist$
|
|
63752
|
+
function requireDist$d () {
|
|
63753
|
+
if (hasRequiredDist$d) return dist$d;
|
|
63754
|
+
hasRequiredDist$d = 1;
|
|
63755
|
+
Object.defineProperty(dist$d, "__esModule", { value: true });
|
|
63756
|
+
dist$d.createDeferred = dist$d.deferred = void 0;
|
|
63884
63757
|
/**
|
|
63885
63758
|
* Creates a new `DeferredPromise`
|
|
63886
63759
|
*
|
|
@@ -63918,7 +63791,7 @@ function requireDist$c () {
|
|
|
63918
63791
|
},
|
|
63919
63792
|
};
|
|
63920
63793
|
}
|
|
63921
|
-
dist$
|
|
63794
|
+
dist$d.deferred = deferred;
|
|
63922
63795
|
/**
|
|
63923
63796
|
* Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the
|
|
63924
63797
|
* local variable name rather than the factory import name, without needing to rename on import.
|
|
@@ -63927,7 +63800,7 @@ function requireDist$c () {
|
|
|
63927
63800
|
import {createDeferred} from '@kwsites/promise-deferred`;
|
|
63928
63801
|
```
|
|
63929
63802
|
*/
|
|
63930
|
-
dist$
|
|
63803
|
+
dist$d.createDeferred = deferred;
|
|
63931
63804
|
/**
|
|
63932
63805
|
* Default export allows use as:
|
|
63933
63806
|
*
|
|
@@ -63935,10 +63808,10 @@ function requireDist$c () {
|
|
|
63935
63808
|
import deferred from '@kwsites/promise-deferred`;
|
|
63936
63809
|
```
|
|
63937
63810
|
*/
|
|
63938
|
-
dist$
|
|
63811
|
+
dist$d.default = deferred;
|
|
63939
63812
|
|
|
63940
|
-
return dist$
|
|
63941
|
-
}var distExports$3 = requireDist$
|
|
63813
|
+
return dist$d;
|
|
63814
|
+
}var distExports$3 = requireDist$d();var __defProp$1 = Object.defineProperty;
|
|
63942
63815
|
var __defProps = Object.defineProperties;
|
|
63943
63816
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
63944
63817
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -68906,7 +68779,7 @@ function requireDiagnostic () {
|
|
|
68906
68779
|
*/
|
|
68907
68780
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68908
68781
|
exports.events = void 0;
|
|
68909
|
-
const events_1 = require$$0$
|
|
68782
|
+
const events_1 = require$$0$7;
|
|
68910
68783
|
const errors_1 = requireErrors$a();
|
|
68911
68784
|
var events;
|
|
68912
68785
|
(function (events) {
|
|
@@ -70474,99 +70347,9 @@ function requireSerializer$1 () {
|
|
|
70474
70347
|
_a = symbols_1.kJsonOptions;
|
|
70475
70348
|
|
|
70476
70349
|
return Serializer$1;
|
|
70477
|
-
}var
|
|
70478
|
-
var version$7 = "8.4.1";
|
|
70479
|
-
var description$4 = "Transport classes and utilities shared among Node.js Elastic client libraries";
|
|
70480
|
-
var main$6 = "index.js";
|
|
70481
|
-
var types$6 = "index.d.ts";
|
|
70482
|
-
var scripts$5 = {
|
|
70483
|
-
test: "npm run build && npm run lint && tap test/{unit,acceptance}/{*,**/*}.test.ts",
|
|
70484
|
-
"test:unit": "npm run build && tap test/unit/{*,**/*}.test.ts",
|
|
70485
|
-
"test:acceptance": "npm run build && tap test/acceptance/*.test.ts",
|
|
70486
|
-
"test:coverage-100": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --100",
|
|
70487
|
-
"test:coverage-report": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
|
|
70488
|
-
"test:coverage-ui": "npm run build && tap test/{unit,acceptance}/{*,**/*}.test.ts --coverage --coverage-report=html",
|
|
70489
|
-
lint: "ts-standard src",
|
|
70490
|
-
"lint:fix": "ts-standard --fix src",
|
|
70491
|
-
"license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause;0BSD'",
|
|
70492
|
-
prebuild: "npm run clean-build && npm run lint",
|
|
70493
|
-
build: "tsc",
|
|
70494
|
-
"clean-build": "rimraf ./lib && mkdir lib",
|
|
70495
|
-
prepublishOnly: "npm run build"
|
|
70496
|
-
};
|
|
70497
|
-
var repository$5 = {
|
|
70498
|
-
type: "git",
|
|
70499
|
-
url: "git+https://github.com/elastic/elastic-transport-js.git"
|
|
70500
|
-
};
|
|
70501
|
-
var keywords$5 = [
|
|
70502
|
-
];
|
|
70503
|
-
var author$3 = {
|
|
70504
|
-
name: "Elastic Client Library Maintainers",
|
|
70505
|
-
company: "Elastic BV"
|
|
70506
|
-
};
|
|
70507
|
-
var license$6 = "Apache-2.0";
|
|
70508
|
-
var bugs$4 = {
|
|
70509
|
-
url: "https://github.com/elastic/elastic-transport-js/issues"
|
|
70510
|
-
};
|
|
70511
|
-
var homepage$5 = "https://github.com/elastic/elastic-transport-js#readme";
|
|
70512
|
-
var engines$5 = {
|
|
70513
|
-
node: ">=16"
|
|
70514
|
-
};
|
|
70515
|
-
var devDependencies$5 = {
|
|
70516
|
-
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
|
|
70517
|
-
"@types/debug": "^4.1.7",
|
|
70518
|
-
"@types/ms": "^0.7.31",
|
|
70519
|
-
"@types/node": "^17.0.31",
|
|
70520
|
-
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
70521
|
-
"@types/stoppable": "^1.1.1",
|
|
70522
|
-
"@types/tap": "^15.0.7",
|
|
70523
|
-
"@types/ungap__structured-clone": "^0.3.3",
|
|
70524
|
-
"@ungap/structured-clone": "^1.2.0",
|
|
70525
|
-
"into-stream": "^6.0.0",
|
|
70526
|
-
"license-checker": "^25.0.1",
|
|
70527
|
-
"node-abort-controller": "^3.0.1",
|
|
70528
|
-
proxy: "^1.0.2",
|
|
70529
|
-
rimraf: "^3.0.2",
|
|
70530
|
-
stoppable: "^1.1.0",
|
|
70531
|
-
tap: "^16.1.0",
|
|
70532
|
-
"ts-node": "^10.7.0",
|
|
70533
|
-
"ts-standard": "^11.0.0",
|
|
70534
|
-
typescript: "^4.6.4",
|
|
70535
|
-
workq: "^3.0.0"
|
|
70536
|
-
};
|
|
70537
|
-
var dependencies$5 = {
|
|
70538
|
-
debug: "^4.3.4",
|
|
70539
|
-
hpagent: "^1.0.0",
|
|
70540
|
-
ms: "^2.1.3",
|
|
70541
|
-
"secure-json-parse": "^2.4.0",
|
|
70542
|
-
tslib: "^2.4.0",
|
|
70543
|
-
undici: "^5.22.1"
|
|
70544
|
-
};
|
|
70545
|
-
var tap$1 = {
|
|
70546
|
-
ts: true,
|
|
70547
|
-
jsx: false,
|
|
70548
|
-
flow: false,
|
|
70549
|
-
coverage: false,
|
|
70550
|
-
"check-coverage": false
|
|
70551
|
-
};
|
|
70350
|
+
}var version$7 = "8.4.1";
|
|
70552
70351
|
var require$$10 = {
|
|
70553
|
-
|
|
70554
|
-
version: version$7,
|
|
70555
|
-
description: description$4,
|
|
70556
|
-
main: main$6,
|
|
70557
|
-
types: types$6,
|
|
70558
|
-
scripts: scripts$5,
|
|
70559
|
-
repository: repository$5,
|
|
70560
|
-
keywords: keywords$5,
|
|
70561
|
-
author: author$3,
|
|
70562
|
-
license: license$6,
|
|
70563
|
-
bugs: bugs$4,
|
|
70564
|
-
homepage: homepage$5,
|
|
70565
|
-
engines: engines$5,
|
|
70566
|
-
devDependencies: devDependencies$5,
|
|
70567
|
-
dependencies: dependencies$5,
|
|
70568
|
-
tap: tap$1
|
|
70569
|
-
};var hasRequiredTransport$1;
|
|
70352
|
+
version: version$7};var hasRequiredTransport$1;
|
|
70570
70353
|
|
|
70571
70354
|
function requireTransport$1 () {
|
|
70572
70355
|
if (hasRequiredTransport$1) return Transport;
|
|
@@ -71441,7 +71224,7 @@ function requireHpagent () {
|
|
|
71441
71224
|
if (hasRequiredHpagent) return hpagent;
|
|
71442
71225
|
hasRequiredHpagent = 1;
|
|
71443
71226
|
|
|
71444
|
-
const https = require$$2$
|
|
71227
|
+
const https = require$$2$2;
|
|
71445
71228
|
const http$1 = http;
|
|
71446
71229
|
const { URL } = require$$0$f;
|
|
71447
71230
|
|
|
@@ -71594,7 +71377,7 @@ function requireHttpConnection () {
|
|
|
71594
71377
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
71595
71378
|
const hpagent_1 = tslib_1.__importDefault(requireHpagent());
|
|
71596
71379
|
const http_1 = tslib_1.__importDefault(http);
|
|
71597
|
-
const https_1 = tslib_1.__importDefault(require$$2$
|
|
71380
|
+
const https_1 = tslib_1.__importDefault(require$$2$2);
|
|
71598
71381
|
const debug_1 = tslib_1.__importDefault(requireSrc());
|
|
71599
71382
|
const buffer_1 = tslib_1.__importDefault(require$$0$k);
|
|
71600
71383
|
const BaseConnection_1 = tslib_1.__importStar(requireBaseConnection());
|
|
@@ -72390,7 +72173,7 @@ function requireUtil$9 () {
|
|
|
72390
72173
|
const { kDestroyed, kBodyUsed } = requireSymbols$4();
|
|
72391
72174
|
const { IncomingMessage } = http;
|
|
72392
72175
|
const stream = require$$0$b;
|
|
72393
|
-
const net = require$$0$
|
|
72176
|
+
const net = require$$0$8;
|
|
72394
72177
|
const { InvalidArgumentError } = requireErrors$9();
|
|
72395
72178
|
const { Blob } = require$$0$k;
|
|
72396
72179
|
const nodeUtil = require$$0$6;
|
|
@@ -73010,7 +72793,7 @@ function requireTimers$1 () {
|
|
|
73010
72793
|
}
|
|
73011
72794
|
};
|
|
73012
72795
|
return timers$1;
|
|
73013
|
-
}var main
|
|
72796
|
+
}var main = {exports: {}};var sbmh;
|
|
73014
72797
|
var hasRequiredSbmh;
|
|
73015
72798
|
|
|
73016
72799
|
function requireSbmh () {
|
|
@@ -74524,7 +74307,7 @@ function requireUrlencoded$1 () {
|
|
|
74524
74307
|
}var hasRequiredMain;
|
|
74525
74308
|
|
|
74526
74309
|
function requireMain () {
|
|
74527
|
-
if (hasRequiredMain) return main
|
|
74310
|
+
if (hasRequiredMain) return main.exports;
|
|
74528
74311
|
hasRequiredMain = 1;
|
|
74529
74312
|
|
|
74530
74313
|
const WritableStream = require$$0$l.Writable;
|
|
@@ -74605,12 +74388,12 @@ function requireMain () {
|
|
|
74605
74388
|
this._parser.write(chunk, cb);
|
|
74606
74389
|
};
|
|
74607
74390
|
|
|
74608
|
-
main
|
|
74609
|
-
main
|
|
74610
|
-
main
|
|
74391
|
+
main.exports = Busboy;
|
|
74392
|
+
main.exports.default = Busboy;
|
|
74393
|
+
main.exports.Busboy = Busboy;
|
|
74611
74394
|
|
|
74612
|
-
main
|
|
74613
|
-
return main
|
|
74395
|
+
main.exports.Dicer = Dicer;
|
|
74396
|
+
return main.exports;
|
|
74614
74397
|
}var constants$7;
|
|
74615
74398
|
var hasRequiredConstants$7;
|
|
74616
74399
|
|
|
@@ -74823,7 +74606,7 @@ function requireUtil$8 () {
|
|
|
74823
74606
|
|
|
74824
74607
|
const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = requireConstants$7();
|
|
74825
74608
|
const { getGlobalOrigin } = requireGlobal$1();
|
|
74826
|
-
const { performance } = require$$2$
|
|
74609
|
+
const { performance } = require$$2$3;
|
|
74827
74610
|
const { isBlobLike, toUSVString, ReadableStreamFrom } = requireUtil$9();
|
|
74828
74611
|
const assert = require$$0$i;
|
|
74829
74612
|
const { isUint8Array } = require$$5$2;
|
|
@@ -79017,7 +78800,7 @@ function requireDispatcher () {
|
|
|
79017
78800
|
if (hasRequiredDispatcher) return dispatcher;
|
|
79018
78801
|
hasRequiredDispatcher = 1;
|
|
79019
78802
|
|
|
79020
|
-
const EventEmitter = require$$0$
|
|
78803
|
+
const EventEmitter = require$$0$7;
|
|
79021
78804
|
|
|
79022
78805
|
class Dispatcher extends EventEmitter {
|
|
79023
78806
|
dispatch () {
|
|
@@ -79240,7 +79023,7 @@ function requireConnect$1 () {
|
|
|
79240
79023
|
if (hasRequiredConnect$1) return connect$1;
|
|
79241
79024
|
hasRequiredConnect$1 = 1;
|
|
79242
79025
|
|
|
79243
|
-
const net = require$$0$
|
|
79026
|
+
const net = require$$0$8;
|
|
79244
79027
|
const assert = require$$0$i;
|
|
79245
79028
|
const util = requireUtil$9();
|
|
79246
79029
|
const { InvalidArgumentError, ConnectTimeoutError } = requireErrors$9();
|
|
@@ -79738,7 +79521,7 @@ function requireRedirectHandler () {
|
|
|
79738
79521
|
const { kBodyUsed } = requireSymbols$4();
|
|
79739
79522
|
const assert = require$$0$i;
|
|
79740
79523
|
const { InvalidArgumentError } = requireErrors$9();
|
|
79741
|
-
const EE = require$$0$
|
|
79524
|
+
const EE = require$$0$7;
|
|
79742
79525
|
|
|
79743
79526
|
const redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
79744
79527
|
|
|
@@ -79989,7 +79772,7 @@ function requireClient$5 () {
|
|
|
79989
79772
|
/* global WebAssembly */
|
|
79990
79773
|
|
|
79991
79774
|
const assert = require$$0$i;
|
|
79992
|
-
const net = require$$0$
|
|
79775
|
+
const net = require$$0$8;
|
|
79993
79776
|
const http$1 = http;
|
|
79994
79777
|
const { pipeline } = require$$0$b;
|
|
79995
79778
|
const util = requireUtil$9();
|
|
@@ -87314,7 +87097,7 @@ function requireRequest$3 () {
|
|
|
87314
87097
|
const { URLSerializer } = requireDataURL();
|
|
87315
87098
|
const { kHeadersList, kConstruct } = requireSymbols$4();
|
|
87316
87099
|
const assert = require$$0$i;
|
|
87317
|
-
const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$
|
|
87100
|
+
const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$7;
|
|
87318
87101
|
|
|
87319
87102
|
let TransformStream = globalThis.TransformStream;
|
|
87320
87103
|
|
|
@@ -88288,7 +88071,7 @@ function requireFetch () {
|
|
|
88288
88071
|
DOMException
|
|
88289
88072
|
} = requireConstants$7();
|
|
88290
88073
|
const { kHeadersList } = requireSymbols$4();
|
|
88291
|
-
const EE = require$$0$
|
|
88074
|
+
const EE = require$$0$7;
|
|
88292
88075
|
const { Readable, pipeline } = require$$0$b;
|
|
88293
88076
|
const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = requireUtil$9();
|
|
88294
88077
|
const { dataURLProcessor, serializeAMimeType } = requireDataURL();
|
|
@@ -95480,7 +95263,7 @@ function requireUndiciConnection () {
|
|
|
95480
95263
|
Object.defineProperty(UndiciConnection, "__esModule", { value: true });
|
|
95481
95264
|
const tslib_1 = require$$0$4;
|
|
95482
95265
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
95483
|
-
const events_1 = require$$0$
|
|
95266
|
+
const events_1 = require$$0$7;
|
|
95484
95267
|
const debug_1 = tslib_1.__importDefault(requireSrc());
|
|
95485
95268
|
const buffer_1 = tslib_1.__importDefault(require$$0$k);
|
|
95486
95269
|
const BaseConnection_1 = tslib_1.__importStar(requireBaseConnection());
|
|
@@ -103132,10 +102915,10 @@ function requireKnn_search () {
|
|
|
103132
102915
|
knn_search.default = KnnSearchApi;
|
|
103133
102916
|
|
|
103134
102917
|
return knn_search;
|
|
103135
|
-
}var license
|
|
102918
|
+
}var license = {};var hasRequiredLicense;
|
|
103136
102919
|
|
|
103137
102920
|
function requireLicense () {
|
|
103138
|
-
if (hasRequiredLicense) return license
|
|
102921
|
+
if (hasRequiredLicense) return license;
|
|
103139
102922
|
hasRequiredLicense = 1;
|
|
103140
102923
|
/*
|
|
103141
102924
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
@@ -103155,7 +102938,7 @@ function requireLicense () {
|
|
|
103155
102938
|
* specific language governing permissions and limitations
|
|
103156
102939
|
* under the License.
|
|
103157
102940
|
*/
|
|
103158
|
-
Object.defineProperty(license
|
|
102941
|
+
Object.defineProperty(license, "__esModule", { value: true });
|
|
103159
102942
|
class License {
|
|
103160
102943
|
constructor(transport) {
|
|
103161
102944
|
Object.defineProperty(this, "transport", {
|
|
@@ -103307,9 +103090,9 @@ function requireLicense () {
|
|
|
103307
103090
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
103308
103091
|
}
|
|
103309
103092
|
}
|
|
103310
|
-
license
|
|
103093
|
+
license.default = License;
|
|
103311
103094
|
|
|
103312
|
-
return license
|
|
103095
|
+
return license;
|
|
103313
103096
|
}var logstash = {};var hasRequiredLogstash;
|
|
103314
103097
|
|
|
103315
103098
|
function requireLogstash () {
|
|
@@ -111787,120 +111570,9 @@ function requireApi () {
|
|
|
111787
111570
|
});
|
|
111788
111571
|
|
|
111789
111572
|
return api$1;
|
|
111790
|
-
}var
|
|
111791
|
-
var version$6 = "8.13.1";
|
|
111792
|
-
var versionCanary = "8.13.1-canary.0";
|
|
111793
|
-
var description$3 = "The official Elasticsearch client for Node.js";
|
|
111794
|
-
var main$4 = "index.js";
|
|
111795
|
-
var types$5 = "index.d.ts";
|
|
111796
|
-
var type = "commonjs";
|
|
111797
|
-
var scripts$4 = {
|
|
111798
|
-
test: "npm run build && npm run lint && tap test/unit/{*,**/*}.test.ts",
|
|
111799
|
-
"test:unit": "npm run build && tap test/unit/{*,**/*}.test.ts",
|
|
111800
|
-
"test:coverage-100": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --100",
|
|
111801
|
-
"test:coverage-report": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage && nyc report --reporter=text-lcov > coverage.lcov",
|
|
111802
|
-
"test:coverage-ui": "npm run build && tap test/unit/{*,**/*}.test.ts --coverage --coverage-report=html",
|
|
111803
|
-
"test:integration": "tsc && node test/integration/index.js",
|
|
111804
|
-
lint: "ts-standard src",
|
|
111805
|
-
"lint:fix": "ts-standard --fix src",
|
|
111806
|
-
"license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause;0BSD'",
|
|
111807
|
-
prebuild: "npm run clean-build && npm run lint",
|
|
111808
|
-
build: "tsc",
|
|
111809
|
-
"clean-build": "rimraf ./lib && mkdir lib",
|
|
111810
|
-
prepublishOnly: "npm run build"
|
|
111811
|
-
};
|
|
111812
|
-
var keywords$4 = [
|
|
111813
|
-
"elasticsearch",
|
|
111814
|
-
"elastic",
|
|
111815
|
-
"kibana",
|
|
111816
|
-
"mapping",
|
|
111817
|
-
"REST",
|
|
111818
|
-
"search",
|
|
111819
|
-
"client",
|
|
111820
|
-
"index"
|
|
111821
|
-
];
|
|
111822
|
-
var contributors$1 = [
|
|
111823
|
-
{
|
|
111824
|
-
name: "Elastic Client Library Maintainers",
|
|
111825
|
-
company: "Elastic BV"
|
|
111826
|
-
}
|
|
111827
|
-
];
|
|
111828
|
-
var license$4 = "Apache-2.0";
|
|
111829
|
-
var repository$4 = {
|
|
111830
|
-
type: "git",
|
|
111831
|
-
url: "https://github.com/elastic/elasticsearch-js.git"
|
|
111832
|
-
};
|
|
111833
|
-
var bugs$3 = {
|
|
111834
|
-
url: "https://github.com/elastic/elasticsearch-js/issues"
|
|
111835
|
-
};
|
|
111836
|
-
var homepage$4 = "http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html";
|
|
111837
|
-
var engines$4 = {
|
|
111838
|
-
node: ">=18"
|
|
111839
|
-
};
|
|
111840
|
-
var devDependencies$4 = {
|
|
111841
|
-
"@sinonjs/fake-timers": "github:sinonjs/fake-timers#0bfffc1",
|
|
111842
|
-
"@types/debug": "^4.1.7",
|
|
111843
|
-
"@types/ms": "^0.7.31",
|
|
111844
|
-
"@types/node": "^17.0.31",
|
|
111845
|
-
"@types/sinonjs__fake-timers": "^8.1.2",
|
|
111846
|
-
"@types/split2": "^3.2.1",
|
|
111847
|
-
"@types/stoppable": "^1.1.1",
|
|
111848
|
-
"@types/tap": "^15.0.7",
|
|
111849
|
-
chai: "^4.3.7",
|
|
111850
|
-
"cross-zip": "^4.0.0",
|
|
111851
|
-
desm: "^1.2.0",
|
|
111852
|
-
"into-stream": "^7.0.0",
|
|
111853
|
-
"js-yaml": "^4.1.0",
|
|
111854
|
-
"license-checker": "^25.0.1",
|
|
111855
|
-
minimist: "^1.2.6",
|
|
111856
|
-
ms: "^2.1.3",
|
|
111857
|
-
"node-abort-controller": "^3.0.1",
|
|
111858
|
-
"node-fetch": "^2.6.7",
|
|
111859
|
-
ora: "^5.4.1",
|
|
111860
|
-
proxy: "^1.0.2",
|
|
111861
|
-
rimraf: "^3.0.2",
|
|
111862
|
-
semver: "^7.3.7",
|
|
111863
|
-
split2: "^4.1.0",
|
|
111864
|
-
stoppable: "^1.1.0",
|
|
111865
|
-
tap: "^16.1.0",
|
|
111866
|
-
"ts-node": "^10.7.0",
|
|
111867
|
-
"ts-standard": "^11.0.0",
|
|
111868
|
-
typescript: "^4.6.4",
|
|
111869
|
-
workq: "^3.0.0",
|
|
111870
|
-
xmlbuilder2: "^3.0.2",
|
|
111871
|
-
zx: "^7.2.2"
|
|
111872
|
-
};
|
|
111873
|
-
var dependencies$4 = {
|
|
111874
|
-
"@elastic/transport": "~8.4.1",
|
|
111875
|
-
tslib: "^2.4.0"
|
|
111876
|
-
};
|
|
111877
|
-
var tap = {
|
|
111878
|
-
ts: true,
|
|
111879
|
-
jsx: false,
|
|
111880
|
-
flow: false,
|
|
111881
|
-
coverage: false,
|
|
111882
|
-
"check-coverage": false
|
|
111883
|
-
};
|
|
111573
|
+
}var version$6 = "8.13.1";
|
|
111884
111574
|
var require$$9 = {
|
|
111885
|
-
|
|
111886
|
-
version: version$6,
|
|
111887
|
-
versionCanary: versionCanary,
|
|
111888
|
-
description: description$3,
|
|
111889
|
-
main: main$4,
|
|
111890
|
-
types: types$5,
|
|
111891
|
-
type: type,
|
|
111892
|
-
scripts: scripts$4,
|
|
111893
|
-
keywords: keywords$4,
|
|
111894
|
-
contributors: contributors$1,
|
|
111895
|
-
license: license$4,
|
|
111896
|
-
repository: repository$4,
|
|
111897
|
-
bugs: bugs$3,
|
|
111898
|
-
homepage: homepage$4,
|
|
111899
|
-
engines: engines$4,
|
|
111900
|
-
devDependencies: devDependencies$4,
|
|
111901
|
-
dependencies: dependencies$4,
|
|
111902
|
-
tap: tap
|
|
111903
|
-
};var hasRequiredClient$4;
|
|
111575
|
+
version: version$6};var hasRequiredClient$4;
|
|
111904
111576
|
|
|
111905
111577
|
function requireClient$4 () {
|
|
111906
111578
|
if (hasRequiredClient$4) return client$4;
|
|
@@ -112548,7 +112220,7 @@ class Elasticsearch_db extends AbstractDatabase {
|
|
|
112548
112220
|
set(key, value) {
|
|
112549
112221
|
this._data.set(key, value);
|
|
112550
112222
|
}
|
|
112551
|
-
}class Mock_db extends require$$0$
|
|
112223
|
+
}class Mock_db extends require$$0$7.EventEmitter {
|
|
112552
112224
|
settings;
|
|
112553
112225
|
mock;
|
|
112554
112226
|
constructor(settings) {
|
|
@@ -122538,7 +122210,7 @@ function requireMongo_types () {
|
|
|
122538
122210
|
hasRequiredMongo_types = 1;
|
|
122539
122211
|
Object.defineProperty(mongo_types, "__esModule", { value: true });
|
|
122540
122212
|
mongo_types.CancellationToken = mongo_types.TypedEventEmitter = void 0;
|
|
122541
|
-
const events_1 = require$$0$
|
|
122213
|
+
const events_1 = require$$0$7;
|
|
122542
122214
|
const mongo_logger_1 = requireMongo_logger();
|
|
122543
122215
|
const utils_1 = requireUtils$8();
|
|
122544
122216
|
/**
|
|
@@ -128811,7 +128483,7 @@ function requireLib$9 () {
|
|
|
128811
128483
|
// (where n is a non-negative integer)
|
|
128812
128484
|
//
|
|
128813
128485
|
// Branch here for cases 1 and 4
|
|
128814
|
-
if ((x > 0 && (x % 1) ===
|
|
128486
|
+
if ((x > 0 && (x % 1) === 0.5 && (x & 1) === 0) ||
|
|
128815
128487
|
(x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) {
|
|
128816
128488
|
return censorNegativeZero(Math.floor(x));
|
|
128817
128489
|
}
|
|
@@ -129902,7 +129574,7 @@ function requireRegexes () {
|
|
|
129902
129574
|
bidiS6
|
|
129903
129575
|
};
|
|
129904
129576
|
return regexes;
|
|
129905
|
-
}var require$$2$
|
|
129577
|
+
}var require$$2$1 = [
|
|
129906
129578
|
[
|
|
129907
129579
|
[
|
|
129908
129580
|
0,
|
|
@@ -178518,7 +178190,7 @@ function requireTr46 () {
|
|
|
178518
178190
|
|
|
178519
178191
|
const punycode = require$$0$3;
|
|
178520
178192
|
const regexes = requireRegexes();
|
|
178521
|
-
const mappingTable = require$$2$
|
|
178193
|
+
const mappingTable = require$$2$1;
|
|
178522
178194
|
const { STATUS_MAPPING } = requireStatusMapping();
|
|
178523
178195
|
|
|
178524
178196
|
function containsNonASCII(str) {
|
|
@@ -182234,203 +181906,9 @@ function requireLib$8 () {
|
|
|
182234
181906
|
|
|
182235
181907
|
} (lib$8));
|
|
182236
181908
|
return lib$8;
|
|
182237
|
-
}var client_metadata = {};var
|
|
182238
|
-
var version$5 = "6.15.0";
|
|
182239
|
-
var description$2 = "The official MongoDB driver for Node.js";
|
|
182240
|
-
var main$3 = "lib/index.js";
|
|
182241
|
-
var files$2 = [
|
|
182242
|
-
"lib",
|
|
182243
|
-
"src",
|
|
182244
|
-
"etc/prepare.js",
|
|
182245
|
-
"mongodb.d.ts",
|
|
182246
|
-
"tsconfig.json"
|
|
182247
|
-
];
|
|
182248
|
-
var types$4 = "mongodb.d.ts";
|
|
182249
|
-
var repository$3 = {
|
|
182250
|
-
type: "git",
|
|
182251
|
-
url: "git@github.com:mongodb/node-mongodb-native.git"
|
|
182252
|
-
};
|
|
182253
|
-
var keywords$3 = [
|
|
182254
|
-
"mongodb",
|
|
182255
|
-
"driver",
|
|
182256
|
-
"official"
|
|
182257
|
-
];
|
|
182258
|
-
var author$2 = {
|
|
182259
|
-
name: "The MongoDB NodeJS Team",
|
|
182260
|
-
email: "dbx-node@mongodb.com"
|
|
182261
|
-
};
|
|
182262
|
-
var dependencies$3 = {
|
|
182263
|
-
"@mongodb-js/saslprep": "^1.1.9",
|
|
182264
|
-
bson: "^6.10.3",
|
|
182265
|
-
"mongodb-connection-string-url": "^3.0.0"
|
|
182266
|
-
};
|
|
182267
|
-
var peerDependencies = {
|
|
182268
|
-
"@aws-sdk/credential-providers": "^3.188.0",
|
|
182269
|
-
"@mongodb-js/zstd": "^1.1.0 || ^2.0.0",
|
|
182270
|
-
"gcp-metadata": "^5.2.0",
|
|
182271
|
-
kerberos: "^2.0.1",
|
|
182272
|
-
"mongodb-client-encryption": ">=6.0.0 <7",
|
|
182273
|
-
snappy: "^7.2.2",
|
|
182274
|
-
socks: "^2.7.1"
|
|
182275
|
-
};
|
|
182276
|
-
var peerDependenciesMeta = {
|
|
182277
|
-
"@aws-sdk/credential-providers": {
|
|
182278
|
-
optional: true
|
|
182279
|
-
},
|
|
182280
|
-
"@mongodb-js/zstd": {
|
|
182281
|
-
optional: true
|
|
182282
|
-
},
|
|
182283
|
-
kerberos: {
|
|
182284
|
-
optional: true
|
|
182285
|
-
},
|
|
182286
|
-
snappy: {
|
|
182287
|
-
optional: true
|
|
182288
|
-
},
|
|
182289
|
-
"mongodb-client-encryption": {
|
|
182290
|
-
optional: true
|
|
182291
|
-
},
|
|
182292
|
-
"gcp-metadata": {
|
|
182293
|
-
optional: true
|
|
182294
|
-
},
|
|
182295
|
-
socks: {
|
|
182296
|
-
optional: true
|
|
182297
|
-
}
|
|
182298
|
-
};
|
|
182299
|
-
var devDependencies$3 = {
|
|
182300
|
-
"@aws-sdk/credential-providers": "^3.632.0",
|
|
182301
|
-
"@iarna/toml": "^2.2.5",
|
|
182302
|
-
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
182303
|
-
"@microsoft/api-extractor": "^7.49.2",
|
|
182304
|
-
"@microsoft/tsdoc-config": "^0.17.1",
|
|
182305
|
-
"@mongodb-js/zstd": "^2.0.0",
|
|
182306
|
-
"@types/chai": "^4.3.17",
|
|
182307
|
-
"@types/chai-subset": "^1.3.5",
|
|
182308
|
-
"@types/express": "^4.17.21",
|
|
182309
|
-
"@types/kerberos": "^1.1.5",
|
|
182310
|
-
"@types/mocha": "^10.0.9",
|
|
182311
|
-
"@types/node": "^22.13.0",
|
|
182312
|
-
"@types/saslprep": "^1.0.3",
|
|
182313
|
-
"@types/semver": "^7.5.8",
|
|
182314
|
-
"@types/sinon": "^17.0.3",
|
|
182315
|
-
"@types/sinon-chai": "^3.2.12",
|
|
182316
|
-
"@types/whatwg-url": "^11.0.5",
|
|
182317
|
-
"@typescript-eslint/eslint-plugin": "8.4.0",
|
|
182318
|
-
"@typescript-eslint/parser": "8.4.0",
|
|
182319
|
-
chai: "^4.4.1",
|
|
182320
|
-
"chai-subset": "^1.6.0",
|
|
182321
|
-
chalk: "^4.1.2",
|
|
182322
|
-
eslint: "9.9.0",
|
|
182323
|
-
"eslint-config-prettier": "^9.1.0",
|
|
182324
|
-
"eslint-plugin-mocha": "^10.4.1",
|
|
182325
|
-
"eslint-plugin-prettier": "^5.2.3",
|
|
182326
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
182327
|
-
"eslint-plugin-tsdoc": "^0.4.0",
|
|
182328
|
-
"eslint-plugin-unused-imports": "^4.1.4",
|
|
182329
|
-
express: "^4.21.2",
|
|
182330
|
-
"gcp-metadata": "^5.3.0",
|
|
182331
|
-
"js-yaml": "^4.1.0",
|
|
182332
|
-
mocha: "^10.8.2",
|
|
182333
|
-
"mocha-sinon": "^2.1.2",
|
|
182334
|
-
"mongodb-client-encryption": "^6.3.0",
|
|
182335
|
-
"mongodb-legacy": "^6.1.3",
|
|
182336
|
-
nyc: "^15.1.0",
|
|
182337
|
-
prettier: "^3.4.2",
|
|
182338
|
-
semver: "^7.7.0",
|
|
182339
|
-
sinon: "^18.0.0",
|
|
182340
|
-
"sinon-chai": "^3.7.0",
|
|
182341
|
-
snappy: "^7.2.2",
|
|
182342
|
-
socks: "^2.8.1",
|
|
182343
|
-
"source-map-support": "^0.5.21",
|
|
182344
|
-
"ts-node": "^10.9.2",
|
|
182345
|
-
tsd: "^0.31.2",
|
|
182346
|
-
typescript: "5.5",
|
|
182347
|
-
"typescript-cached-transpile": "^0.0.6",
|
|
182348
|
-
"v8-heapsnapshot": "^1.3.1",
|
|
182349
|
-
yargs: "^17.7.2"
|
|
182350
|
-
};
|
|
182351
|
-
var license$3 = "Apache-2.0";
|
|
182352
|
-
var engines$3 = {
|
|
182353
|
-
node: ">=16.20.1"
|
|
182354
|
-
};
|
|
182355
|
-
var bugs$2 = {
|
|
182356
|
-
url: "https://jira.mongodb.org/projects/NODE/issues/"
|
|
182357
|
-
};
|
|
182358
|
-
var homepage$3 = "https://github.com/mongodb/node-mongodb-native";
|
|
182359
|
-
var scripts$3 = {
|
|
182360
|
-
"build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
|
|
182361
|
-
"build:ts": "node ./node_modules/typescript/bin/tsc",
|
|
182362
|
-
"build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts",
|
|
182363
|
-
"build:docs": "./etc/docs/build.ts",
|
|
182364
|
-
"build:typedoc": "typedoc",
|
|
182365
|
-
"build:nightly": "node ./.github/scripts/nightly.mjs",
|
|
182366
|
-
"check:bench": "npm --prefix test/benchmarks/driver_bench start",
|
|
182367
|
-
"check:coverage": "nyc npm run test:all",
|
|
182368
|
-
"check:integration-coverage": "nyc npm run check:test",
|
|
182369
|
-
"check:lambda": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js",
|
|
182370
|
-
"check:lambda:aws": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js",
|
|
182371
|
-
"check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd",
|
|
182372
|
-
"check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test",
|
|
182373
|
-
"check:tsd": "tsd --version && tsd",
|
|
182374
|
-
"check:dependencies": "mocha test/action/dependency.test.ts",
|
|
182375
|
-
"check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd",
|
|
182376
|
-
"check:search-indexes": "nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts",
|
|
182377
|
-
"check:test": "mocha --config test/mocha_mongodb.js test/integration",
|
|
182378
|
-
"check:unit": "mocha test/unit",
|
|
182379
|
-
"check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit",
|
|
182380
|
-
"check:atlas": "mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts",
|
|
182381
|
-
"check:resource-management": "mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts",
|
|
182382
|
-
"check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts",
|
|
182383
|
-
"check:adl": "mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing",
|
|
182384
|
-
"check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts",
|
|
182385
|
-
"check:oidc-auth": "mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts",
|
|
182386
|
-
"check:oidc-test": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts",
|
|
182387
|
-
"check:oidc-azure": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts",
|
|
182388
|
-
"check:oidc-gcp": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts",
|
|
182389
|
-
"check:oidc-k8s": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts",
|
|
182390
|
-
"check:kerberos": "nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts",
|
|
182391
|
-
"check:tls": "mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts",
|
|
182392
|
-
"check:ldap": "nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts",
|
|
182393
|
-
"check:socks5": "mocha --config test/manual/mocharc.js test/manual/socks5.test.ts",
|
|
182394
|
-
"check:csfle": "mocha --config test/mocha_mongodb.js test/integration/client-side-encryption",
|
|
182395
|
-
"check:snappy": "mocha test/unit/assorted/snappy.test.js",
|
|
182396
|
-
"check:x509": "mocha test/manual/x509_auth.test.ts",
|
|
182397
|
-
"fix:eslint": "npm run check:eslint -- --fix",
|
|
182398
|
-
prepare: "node etc/prepare.js",
|
|
182399
|
-
"preview:docs": "ts-node etc/docs/preview.ts",
|
|
182400
|
-
test: "npm run check:lint && npm run test:all",
|
|
182401
|
-
"test:all": "npm run check:unit && npm run check:test",
|
|
182402
|
-
"update:docs": "npm run build:docs -- --yes"
|
|
182403
|
-
};
|
|
182404
|
-
var tsd = {
|
|
182405
|
-
directory: "test/types",
|
|
182406
|
-
compilerOptions: {
|
|
182407
|
-
strict: true,
|
|
182408
|
-
target: "esnext",
|
|
182409
|
-
module: "commonjs",
|
|
182410
|
-
moduleResolution: "node"
|
|
182411
|
-
}
|
|
182412
|
-
};
|
|
181909
|
+
}var client_metadata = {};var version$5 = "6.15.0";
|
|
182413
181910
|
var require$$5$1 = {
|
|
182414
|
-
|
|
182415
|
-
version: version$5,
|
|
182416
|
-
description: description$2,
|
|
182417
|
-
main: main$3,
|
|
182418
|
-
files: files$2,
|
|
182419
|
-
types: types$4,
|
|
182420
|
-
repository: repository$3,
|
|
182421
|
-
keywords: keywords$3,
|
|
182422
|
-
author: author$2,
|
|
182423
|
-
dependencies: dependencies$3,
|
|
182424
|
-
peerDependencies: peerDependencies,
|
|
182425
|
-
peerDependenciesMeta: peerDependenciesMeta,
|
|
182426
|
-
devDependencies: devDependencies$3,
|
|
182427
|
-
license: license$3,
|
|
182428
|
-
engines: engines$3,
|
|
182429
|
-
bugs: bugs$2,
|
|
182430
|
-
homepage: homepage$3,
|
|
182431
|
-
scripts: scripts$3,
|
|
182432
|
-
tsd: tsd
|
|
182433
|
-
};var hasRequiredClient_metadata;
|
|
181911
|
+
version: version$5};var hasRequiredClient_metadata;
|
|
182434
181912
|
|
|
182435
181913
|
function requireClient_metadata () {
|
|
182436
181914
|
if (hasRequiredClient_metadata) return client_metadata;
|
|
@@ -183985,7 +183463,7 @@ function requireState_machine () {
|
|
|
183985
183463
|
Object.defineProperty(state_machine, "__esModule", { value: true });
|
|
183986
183464
|
state_machine.StateMachine = void 0;
|
|
183987
183465
|
const fs = require$$0$p;
|
|
183988
|
-
const net = require$$0$
|
|
183466
|
+
const net = require$$0$8;
|
|
183989
183467
|
const tls = require$$1$1;
|
|
183990
183468
|
const bson_1 = requireBson();
|
|
183991
183469
|
const abstract_cursor_1 = requireAbstract_cursor();
|
|
@@ -185118,7 +184596,7 @@ function requireAuto_encrypter () {
|
|
|
185118
184596
|
var _a;
|
|
185119
184597
|
Object.defineProperty(auto_encrypter, "__esModule", { value: true });
|
|
185120
184598
|
auto_encrypter.AutoEncrypter = auto_encrypter.AutoEncryptionLoggerLevel = void 0;
|
|
185121
|
-
const net = require$$0$
|
|
184599
|
+
const net = require$$0$8;
|
|
185122
184600
|
const bson_1 = requireBson();
|
|
185123
184601
|
const constants_1 = requireConstants$2();
|
|
185124
184602
|
const deps_1 = requireDeps();
|
|
@@ -188182,7 +187660,7 @@ function requireConnect () {
|
|
|
188182
187660
|
exports.performInitialHandshake = performInitialHandshake;
|
|
188183
187661
|
exports.prepareHandshakeDocument = prepareHandshakeDocument;
|
|
188184
187662
|
exports.makeSocket = makeSocket;
|
|
188185
|
-
const net = require$$0$
|
|
187663
|
+
const net = require$$0$8;
|
|
188186
187664
|
const tls = require$$1$1;
|
|
188187
187665
|
const constants_1 = requireConstants$2();
|
|
188188
187666
|
const deps_1 = requireDeps();
|
|
@@ -192634,12 +192112,12 @@ function requirePlain () {
|
|
|
192634
192112
|
plain.Plain = Plain;
|
|
192635
192113
|
|
|
192636
192114
|
return plain;
|
|
192637
|
-
}var scram = {};var dist$
|
|
192638
|
-
var hasRequiredDist$
|
|
192115
|
+
}var scram = {};var dist$c;
|
|
192116
|
+
var hasRequiredDist$c;
|
|
192639
192117
|
|
|
192640
|
-
function requireDist$
|
|
192641
|
-
if (hasRequiredDist$
|
|
192642
|
-
hasRequiredDist$
|
|
192118
|
+
function requireDist$c () {
|
|
192119
|
+
if (hasRequiredDist$c) return dist$c;
|
|
192120
|
+
hasRequiredDist$c = 1;
|
|
192643
192121
|
const getCodePoint = (character) => character.codePointAt(0);
|
|
192644
192122
|
const first = (x) => x[0];
|
|
192645
192123
|
const last = (x) => x[x.length - 1];
|
|
@@ -192702,9 +192180,9 @@ function requireDist$b () {
|
|
|
192702
192180
|
}
|
|
192703
192181
|
saslprep.saslprep = saslprep;
|
|
192704
192182
|
saslprep.default = saslprep;
|
|
192705
|
-
dist$
|
|
192183
|
+
dist$c = saslprep;
|
|
192706
192184
|
|
|
192707
|
-
return dist$
|
|
192185
|
+
return dist$c;
|
|
192708
192186
|
}var memoryCodePoints = {};var memoryPager;
|
|
192709
192187
|
var hasRequiredMemoryPager;
|
|
192710
192188
|
|
|
@@ -193031,7 +192509,7 @@ function requireNode () {
|
|
|
193031
192509
|
var __importDefault = (node && node.__importDefault) || function (mod) {
|
|
193032
192510
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
193033
192511
|
};
|
|
193034
|
-
const index_1 = __importDefault(requireDist$
|
|
192512
|
+
const index_1 = __importDefault(requireDist$c());
|
|
193035
192513
|
const memory_code_points_1 = requireMemoryCodePoints();
|
|
193036
192514
|
const code_points_data_1 = __importDefault(requireCodePointsData());
|
|
193037
192515
|
const codePoints = (0, memory_code_points_1.createMemoryCodePoints)(code_points_data_1.default);
|
|
@@ -204714,7 +204192,7 @@ function requireLib$6 () {
|
|
|
204714
204192
|
|
|
204715
204193
|
} (lib$6));
|
|
204716
204194
|
return lib$6;
|
|
204717
|
-
}var tarn = {exports: {}};var Pool = {};var PendingOperation = {};var TimeoutError = {};var hasRequiredTimeoutError$1;
|
|
204195
|
+
}var tarn = {exports: {}};var Pool$1 = {};var PendingOperation = {};var TimeoutError = {};var hasRequiredTimeoutError$1;
|
|
204718
204196
|
|
|
204719
204197
|
function requireTimeoutError$1 () {
|
|
204720
204198
|
if (hasRequiredTimeoutError$1) return TimeoutError;
|
|
@@ -204895,15 +204373,15 @@ function requireResource () {
|
|
|
204895
204373
|
}var hasRequiredPool$2;
|
|
204896
204374
|
|
|
204897
204375
|
function requirePool$2 () {
|
|
204898
|
-
if (hasRequiredPool$2) return Pool;
|
|
204376
|
+
if (hasRequiredPool$2) return Pool$1;
|
|
204899
204377
|
hasRequiredPool$2 = 1;
|
|
204900
|
-
Object.defineProperty(Pool, "__esModule", { value: true });
|
|
204378
|
+
Object.defineProperty(Pool$1, "__esModule", { value: true });
|
|
204901
204379
|
const PendingOperation_1 = requirePendingOperation();
|
|
204902
204380
|
const Resource_1 = requireResource();
|
|
204903
204381
|
const utils_1 = requireUtils$6();
|
|
204904
|
-
const events_1 = require$$0$
|
|
204382
|
+
const events_1 = require$$0$7;
|
|
204905
204383
|
const timers_1 = require$$1$7;
|
|
204906
|
-
|
|
204384
|
+
class Pool {
|
|
204907
204385
|
constructor(opt) {
|
|
204908
204386
|
this.destroyed = false;
|
|
204909
204387
|
this.emitter = new events_1.EventEmitter();
|
|
@@ -205376,8 +204854,8 @@ function requirePool$2 () {
|
|
|
205376
204854
|
}
|
|
205377
204855
|
});
|
|
205378
204856
|
}
|
|
205379
|
-
}
|
|
205380
|
-
Pool.Pool = Pool
|
|
204857
|
+
}
|
|
204858
|
+
Pool$1.Pool = Pool;
|
|
205381
204859
|
function remove(arr, item) {
|
|
205382
204860
|
const idx = arr.indexOf(item);
|
|
205383
204861
|
if (idx === -1) {
|
|
@@ -205412,7 +204890,7 @@ function requirePool$2 () {
|
|
|
205412
204890
|
});
|
|
205413
204891
|
});
|
|
205414
204892
|
}
|
|
205415
|
-
return Pool;
|
|
204893
|
+
return Pool$1;
|
|
205416
204894
|
}var hasRequiredTarn;
|
|
205417
204895
|
|
|
205418
204896
|
function requireTarn () {
|
|
@@ -209334,7 +208812,7 @@ function requireBulkLoad () {
|
|
|
209334
208812
|
value: true
|
|
209335
208813
|
});
|
|
209336
208814
|
exports.default = void 0;
|
|
209337
|
-
var _events = require$$0$
|
|
208815
|
+
var _events = require$$0$7;
|
|
209338
208816
|
var _writableTrackingBuffer = _interopRequireDefault(requireWritableTrackingBuffer());
|
|
209339
208817
|
var _stream = require$$0$b;
|
|
209340
208818
|
var _token = requireToken();
|
|
@@ -209344,19 +208822,7 @@ function requireBulkLoad () {
|
|
|
209344
208822
|
*/
|
|
209345
208823
|
const FLAGS = {
|
|
209346
208824
|
nullable: 1 << 0,
|
|
209347
|
-
caseSen: 1 << 1,
|
|
209348
208825
|
updateableReadWrite: 1 << 2,
|
|
209349
|
-
updateableUnknown: 1 << 3,
|
|
209350
|
-
identity: 1 << 4,
|
|
209351
|
-
computed: 1 << 5,
|
|
209352
|
-
// introduced in TDS 7.2
|
|
209353
|
-
fixedLenCLRType: 1 << 8,
|
|
209354
|
-
// introduced in TDS 7.2
|
|
209355
|
-
sparseColumnSet: 1 << 10,
|
|
209356
|
-
// introduced in TDS 7.3.B
|
|
209357
|
-
hidden: 1 << 13,
|
|
209358
|
-
// introduced in TDS 7.2
|
|
209359
|
-
key: 1 << 14,
|
|
209360
208826
|
// introduced in TDS 7.2
|
|
209361
208827
|
nullableUnknown: 1 << 15 // introduced in TDS 7.2
|
|
209362
208828
|
};
|
|
@@ -209365,14 +208831,7 @@ function requireBulkLoad () {
|
|
|
209365
208831
|
* @private
|
|
209366
208832
|
*/
|
|
209367
208833
|
const DONE_STATUS = {
|
|
209368
|
-
FINAL: 0x00
|
|
209369
|
-
MORE: 0x1,
|
|
209370
|
-
ERROR: 0x2,
|
|
209371
|
-
INXACT: 0x4,
|
|
209372
|
-
COUNT: 0x10,
|
|
209373
|
-
ATTN: 0x20,
|
|
209374
|
-
SRVERROR: 0x100
|
|
209375
|
-
};
|
|
208834
|
+
FINAL: 0x00};
|
|
209376
208835
|
|
|
209377
208836
|
/**
|
|
209378
208837
|
* @private
|
|
@@ -212077,7 +211536,7 @@ async function prepareFormData(formData, request) {
|
|
|
212077
211536
|
}
|
|
212078
211537
|
}
|
|
212079
211538
|
request.multipartBody = { parts };
|
|
212080
|
-
}var dist$
|
|
211539
|
+
}var dist$b = {};var dist$a = {};var helpers$2 = {};var hasRequiredHelpers$2;
|
|
212081
211540
|
|
|
212082
211541
|
function requireHelpers$2 () {
|
|
212083
211542
|
if (hasRequiredHelpers$2) return helpers$2;
|
|
@@ -212108,7 +211567,7 @@ function requireHelpers$2 () {
|
|
|
212108
211567
|
Object.defineProperty(helpers$2, "__esModule", { value: true });
|
|
212109
211568
|
helpers$2.req = helpers$2.json = helpers$2.toBuffer = void 0;
|
|
212110
211569
|
const http$1 = __importStar(http);
|
|
212111
|
-
const https = __importStar(require$$2$
|
|
211570
|
+
const https = __importStar(require$$2$2);
|
|
212112
211571
|
async function toBuffer(stream) {
|
|
212113
211572
|
let length = 0;
|
|
212114
211573
|
const chunks = [];
|
|
@@ -212148,13 +211607,13 @@ function requireHelpers$2 () {
|
|
|
212148
211607
|
helpers$2.req = req;
|
|
212149
211608
|
|
|
212150
211609
|
return helpers$2;
|
|
212151
|
-
}var hasRequiredDist$
|
|
211610
|
+
}var hasRequiredDist$b;
|
|
212152
211611
|
|
|
212153
|
-
function requireDist$
|
|
212154
|
-
if (hasRequiredDist$
|
|
212155
|
-
hasRequiredDist$
|
|
211612
|
+
function requireDist$b () {
|
|
211613
|
+
if (hasRequiredDist$b) return dist$a;
|
|
211614
|
+
hasRequiredDist$b = 1;
|
|
212156
211615
|
(function (exports) {
|
|
212157
|
-
var __createBinding = (dist$
|
|
211616
|
+
var __createBinding = (dist$a && dist$a.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212158
211617
|
if (k2 === undefined) k2 = k;
|
|
212159
211618
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212160
211619
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212165,26 +211624,26 @@ function requireDist$a () {
|
|
|
212165
211624
|
if (k2 === undefined) k2 = k;
|
|
212166
211625
|
o[k2] = m[k];
|
|
212167
211626
|
}));
|
|
212168
|
-
var __setModuleDefault = (dist$
|
|
211627
|
+
var __setModuleDefault = (dist$a && dist$a.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212169
211628
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212170
211629
|
}) : function(o, v) {
|
|
212171
211630
|
o["default"] = v;
|
|
212172
211631
|
});
|
|
212173
|
-
var __importStar = (dist$
|
|
211632
|
+
var __importStar = (dist$a && dist$a.__importStar) || function (mod) {
|
|
212174
211633
|
if (mod && mod.__esModule) return mod;
|
|
212175
211634
|
var result = {};
|
|
212176
211635
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212177
211636
|
__setModuleDefault(result, mod);
|
|
212178
211637
|
return result;
|
|
212179
211638
|
};
|
|
212180
|
-
var __exportStar = (dist$
|
|
211639
|
+
var __exportStar = (dist$a && dist$a.__exportStar) || function(m, exports) {
|
|
212181
211640
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
212182
211641
|
};
|
|
212183
211642
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
212184
211643
|
exports.Agent = void 0;
|
|
212185
|
-
const net = __importStar(require$$0$
|
|
211644
|
+
const net = __importStar(require$$0$8);
|
|
212186
211645
|
const http$1 = __importStar(http);
|
|
212187
|
-
const https_1 = require$$2$
|
|
211646
|
+
const https_1 = require$$2$2;
|
|
212188
211647
|
__exportStar(requireHelpers$2(), exports);
|
|
212189
211648
|
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
212190
211649
|
class Agent extends http$1.Agent {
|
|
@@ -212328,8 +211787,8 @@ function requireDist$a () {
|
|
|
212328
211787
|
}
|
|
212329
211788
|
exports.Agent = Agent;
|
|
212330
211789
|
|
|
212331
|
-
} (dist$
|
|
212332
|
-
return dist$
|
|
211790
|
+
} (dist$a));
|
|
211791
|
+
return dist$a;
|
|
212333
211792
|
}var parseProxyResponse = {};var hasRequiredParseProxyResponse;
|
|
212334
211793
|
|
|
212335
211794
|
function requireParseProxyResponse () {
|
|
@@ -212436,12 +211895,12 @@ function requireParseProxyResponse () {
|
|
|
212436
211895
|
parseProxyResponse.parseProxyResponse = parseProxyResponse$1;
|
|
212437
211896
|
|
|
212438
211897
|
return parseProxyResponse;
|
|
212439
|
-
}var hasRequiredDist$
|
|
211898
|
+
}var hasRequiredDist$a;
|
|
212440
211899
|
|
|
212441
|
-
function requireDist$
|
|
212442
|
-
if (hasRequiredDist$
|
|
212443
|
-
hasRequiredDist$
|
|
212444
|
-
var __createBinding = (dist$
|
|
211900
|
+
function requireDist$a () {
|
|
211901
|
+
if (hasRequiredDist$a) return dist$b;
|
|
211902
|
+
hasRequiredDist$a = 1;
|
|
211903
|
+
var __createBinding = (dist$b && dist$b.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212445
211904
|
if (k2 === undefined) k2 = k;
|
|
212446
211905
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212447
211906
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212452,28 +211911,28 @@ function requireDist$9 () {
|
|
|
212452
211911
|
if (k2 === undefined) k2 = k;
|
|
212453
211912
|
o[k2] = m[k];
|
|
212454
211913
|
}));
|
|
212455
|
-
var __setModuleDefault = (dist$
|
|
211914
|
+
var __setModuleDefault = (dist$b && dist$b.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212456
211915
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212457
211916
|
}) : function(o, v) {
|
|
212458
211917
|
o["default"] = v;
|
|
212459
211918
|
});
|
|
212460
|
-
var __importStar = (dist$
|
|
211919
|
+
var __importStar = (dist$b && dist$b.__importStar) || function (mod) {
|
|
212461
211920
|
if (mod && mod.__esModule) return mod;
|
|
212462
211921
|
var result = {};
|
|
212463
211922
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212464
211923
|
__setModuleDefault(result, mod);
|
|
212465
211924
|
return result;
|
|
212466
211925
|
};
|
|
212467
|
-
var __importDefault = (dist$
|
|
211926
|
+
var __importDefault = (dist$b && dist$b.__importDefault) || function (mod) {
|
|
212468
211927
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
212469
211928
|
};
|
|
212470
|
-
Object.defineProperty(dist$
|
|
212471
|
-
dist$
|
|
212472
|
-
const net = __importStar(require$$0$
|
|
211929
|
+
Object.defineProperty(dist$b, "__esModule", { value: true });
|
|
211930
|
+
dist$b.HttpsProxyAgent = void 0;
|
|
211931
|
+
const net = __importStar(require$$0$8);
|
|
212473
211932
|
const tls = __importStar(require$$1$1);
|
|
212474
211933
|
const assert_1 = __importDefault(require$$0$i);
|
|
212475
211934
|
const debug_1 = __importDefault(requireSrc());
|
|
212476
|
-
const agent_base_1 = requireDist$
|
|
211935
|
+
const agent_base_1 = requireDist$b();
|
|
212477
211936
|
const url_1 = require$$0$f;
|
|
212478
211937
|
const parse_proxy_response_1 = requireParseProxyResponse();
|
|
212479
211938
|
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
@@ -212600,7 +212059,7 @@ function requireDist$9 () {
|
|
|
212600
212059
|
}
|
|
212601
212060
|
}
|
|
212602
212061
|
HttpsProxyAgent.protocols = ['http', 'https'];
|
|
212603
|
-
dist$
|
|
212062
|
+
dist$b.HttpsProxyAgent = HttpsProxyAgent;
|
|
212604
212063
|
function resume(socket) {
|
|
212605
212064
|
socket.resume();
|
|
212606
212065
|
}
|
|
@@ -212615,13 +212074,13 @@ function requireDist$9 () {
|
|
|
212615
212074
|
return ret;
|
|
212616
212075
|
}
|
|
212617
212076
|
|
|
212618
|
-
return dist$
|
|
212619
|
-
}var distExports$2 = requireDist$
|
|
212077
|
+
return dist$b;
|
|
212078
|
+
}var distExports$2 = requireDist$a();var dist$9 = {};var hasRequiredDist$9;
|
|
212620
212079
|
|
|
212621
|
-
function requireDist$
|
|
212622
|
-
if (hasRequiredDist$
|
|
212623
|
-
hasRequiredDist$
|
|
212624
|
-
var __createBinding = (dist$
|
|
212080
|
+
function requireDist$9 () {
|
|
212081
|
+
if (hasRequiredDist$9) return dist$9;
|
|
212082
|
+
hasRequiredDist$9 = 1;
|
|
212083
|
+
var __createBinding = (dist$9 && dist$9.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212625
212084
|
if (k2 === undefined) k2 = k;
|
|
212626
212085
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212627
212086
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212632,28 +212091,28 @@ function requireDist$8 () {
|
|
|
212632
212091
|
if (k2 === undefined) k2 = k;
|
|
212633
212092
|
o[k2] = m[k];
|
|
212634
212093
|
}));
|
|
212635
|
-
var __setModuleDefault = (dist$
|
|
212094
|
+
var __setModuleDefault = (dist$9 && dist$9.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212636
212095
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212637
212096
|
}) : function(o, v) {
|
|
212638
212097
|
o["default"] = v;
|
|
212639
212098
|
});
|
|
212640
|
-
var __importStar = (dist$
|
|
212099
|
+
var __importStar = (dist$9 && dist$9.__importStar) || function (mod) {
|
|
212641
212100
|
if (mod && mod.__esModule) return mod;
|
|
212642
212101
|
var result = {};
|
|
212643
212102
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212644
212103
|
__setModuleDefault(result, mod);
|
|
212645
212104
|
return result;
|
|
212646
212105
|
};
|
|
212647
|
-
var __importDefault = (dist$
|
|
212106
|
+
var __importDefault = (dist$9 && dist$9.__importDefault) || function (mod) {
|
|
212648
212107
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
212649
212108
|
};
|
|
212650
|
-
Object.defineProperty(dist$
|
|
212651
|
-
dist$
|
|
212652
|
-
const net = __importStar(require$$0$
|
|
212109
|
+
Object.defineProperty(dist$9, "__esModule", { value: true });
|
|
212110
|
+
dist$9.HttpProxyAgent = void 0;
|
|
212111
|
+
const net = __importStar(require$$0$8);
|
|
212653
212112
|
const tls = __importStar(require$$1$1);
|
|
212654
212113
|
const debug_1 = __importDefault(requireSrc());
|
|
212655
|
-
const events_1 = require$$0$
|
|
212656
|
-
const agent_base_1 = requireDist$
|
|
212114
|
+
const events_1 = require$$0$7;
|
|
212115
|
+
const agent_base_1 = requireDist$b();
|
|
212657
212116
|
const url_1 = require$$0$f;
|
|
212658
212117
|
const debug = (0, debug_1.default)('http-proxy-agent');
|
|
212659
212118
|
/**
|
|
@@ -212756,7 +212215,7 @@ function requireDist$8 () {
|
|
|
212756
212215
|
}
|
|
212757
212216
|
}
|
|
212758
212217
|
HttpProxyAgent.protocols = ['http', 'https'];
|
|
212759
|
-
dist$
|
|
212218
|
+
dist$9.HttpProxyAgent = HttpProxyAgent;
|
|
212760
212219
|
function omit(obj, ...keys) {
|
|
212761
212220
|
const ret = {};
|
|
212762
212221
|
let key;
|
|
@@ -212768,8 +212227,8 @@ function requireDist$8 () {
|
|
|
212768
212227
|
return ret;
|
|
212769
212228
|
}
|
|
212770
212229
|
|
|
212771
|
-
return dist$
|
|
212772
|
-
}var distExports$1 = requireDist$
|
|
212230
|
+
return dist$9;
|
|
212231
|
+
}var distExports$1 = requireDist$9();// Copyright (c) Microsoft Corporation.
|
|
212773
212232
|
// Licensed under the MIT license.
|
|
212774
212233
|
const HTTPS_PROXY = "HTTPS_PROXY";
|
|
212775
212234
|
const HTTP_PROXY = "HTTP_PROXY";
|
|
@@ -215839,25 +215298,14 @@ const Constants$1 = {
|
|
|
215839
215298
|
INVALID_INSTANCE: "invalid_instance",
|
|
215840
215299
|
};
|
|
215841
215300
|
const HttpStatus = {
|
|
215842
|
-
SUCCESS: 200,
|
|
215843
215301
|
SUCCESS_RANGE_START: 200,
|
|
215844
215302
|
SUCCESS_RANGE_END: 299,
|
|
215845
215303
|
REDIRECT: 302,
|
|
215846
|
-
CLIENT_ERROR: 400,
|
|
215847
215304
|
CLIENT_ERROR_RANGE_START: 400,
|
|
215848
|
-
BAD_REQUEST: 400,
|
|
215849
|
-
UNAUTHORIZED: 401,
|
|
215850
|
-
NOT_FOUND: 404,
|
|
215851
|
-
REQUEST_TIMEOUT: 408,
|
|
215852
|
-
TOO_MANY_REQUESTS: 429,
|
|
215853
215305
|
CLIENT_ERROR_RANGE_END: 499,
|
|
215854
215306
|
SERVER_ERROR: 500,
|
|
215855
215307
|
SERVER_ERROR_RANGE_START: 500,
|
|
215856
|
-
|
|
215857
|
-
GATEWAY_TIMEOUT: 504,
|
|
215858
|
-
SERVER_ERROR_RANGE_END: 599,
|
|
215859
|
-
MULTI_SIDED_ERROR: 600,
|
|
215860
|
-
};
|
|
215308
|
+
SERVER_ERROR_RANGE_END: 599};
|
|
215861
215309
|
const OIDC_DEFAULT_SCOPES = [
|
|
215862
215310
|
Constants$1.OPENID_SCOPE,
|
|
215863
215311
|
Constants$1.PROFILE_SCOPE,
|
|
@@ -215929,7 +215377,6 @@ const ResponseMode = {
|
|
|
215929
215377
|
* allowed grant_type
|
|
215930
215378
|
*/
|
|
215931
215379
|
const GrantType = {
|
|
215932
|
-
IMPLICIT_GRANT: "implicit",
|
|
215933
215380
|
AUTHORIZATION_CODE_GRANT: "authorization_code",
|
|
215934
215381
|
CLIENT_CREDENTIALS_GRANT: "client_credentials",
|
|
215935
215382
|
RESOURCE_OWNER_PASSWORD_GRANT: "password",
|
|
@@ -215943,7 +215390,6 @@ const GrantType = {
|
|
|
215943
215390
|
const CacheAccountType = {
|
|
215944
215391
|
MSSTS_ACCOUNT_TYPE: "MSSTS",
|
|
215945
215392
|
ADFS_ACCOUNT_TYPE: "ADFS",
|
|
215946
|
-
MSAV1_ACCOUNT_TYPE: "MSA",
|
|
215947
215393
|
GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
|
|
215948
215394
|
};
|
|
215949
215395
|
/**
|
|
@@ -215980,7 +215426,6 @@ const AuthorityMetadataSource = {
|
|
|
215980
215426
|
};
|
|
215981
215427
|
const SERVER_TELEM_CONSTANTS = {
|
|
215982
215428
|
SCHEMA_VERSION: 5,
|
|
215983
|
-
MAX_CUR_HEADER_BYTES: 80,
|
|
215984
215429
|
MAX_LAST_HEADER_BYTES: 330,
|
|
215985
215430
|
MAX_CACHED_ERRORS: 50,
|
|
215986
215431
|
CACHE_KEY: "server-telemetry",
|
|
@@ -216042,9 +215487,7 @@ const RegionDiscoverySources = {
|
|
|
216042
215487
|
* Region Discovery Outcomes
|
|
216043
215488
|
*/
|
|
216044
215489
|
const RegionDiscoveryOutcomes = {
|
|
216045
|
-
CONFIGURED_MATCHES_DETECTED: "1",
|
|
216046
215490
|
CONFIGURED_NO_AUTO_DETECTION: "2",
|
|
216047
|
-
CONFIGURED_NOT_DETECTED: "3",
|
|
216048
215491
|
AUTO_DETECTION_REQUESTED_SUCCESSFUL: "4",
|
|
216049
215492
|
AUTO_DETECTION_REQUESTED_FAILED: "5",
|
|
216050
215493
|
};
|
|
@@ -216709,7 +216152,6 @@ const rawMetdataJSON = {
|
|
|
216709
216152
|
},
|
|
216710
216153
|
},
|
|
216711
216154
|
instanceDiscoveryMetadata: {
|
|
216712
|
-
tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
|
|
216713
216155
|
metadata: [
|
|
216714
216156
|
{
|
|
216715
216157
|
preferred_network: "login.microsoftonline.com",
|
|
@@ -216834,18 +216276,7 @@ const ProtocolMode = {
|
|
|
216834
216276
|
*/
|
|
216835
216277
|
const AzureCloudInstance = {
|
|
216836
216278
|
// AzureCloudInstance is not specified.
|
|
216837
|
-
None: "none"
|
|
216838
|
-
// Microsoft Azure public cloud
|
|
216839
|
-
AzurePublic: "https://login.microsoftonline.com",
|
|
216840
|
-
// Microsoft PPE
|
|
216841
|
-
AzurePpe: "https://login.windows-ppe.net",
|
|
216842
|
-
// Microsoft Chinese national/regional cloud
|
|
216843
|
-
AzureChina: "https://login.chinacloudapi.cn",
|
|
216844
|
-
// Microsoft German national/regional cloud ("Black Forest")
|
|
216845
|
-
AzureGermany: "https://login.microsoftonline.de",
|
|
216846
|
-
// US Government cloud
|
|
216847
|
-
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
216848
|
-
};/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
216279
|
+
None: "none"};/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
216849
216280
|
/*
|
|
216850
216281
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
216851
216282
|
* Licensed under the MIT License.
|
|
@@ -218828,7 +218259,7 @@ class Logger {
|
|
|
218828
218259
|
}
|
|
218829
218260
|
}/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
218830
218261
|
/* eslint-disable header/header */
|
|
218831
|
-
const name$
|
|
218262
|
+
const name$1 = "@azure/msal-common";
|
|
218832
218263
|
const version$4 = "14.12.0";/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
218833
218264
|
|
|
218834
218265
|
/*
|
|
@@ -219435,7 +218866,7 @@ class CacheManager {
|
|
|
219435
218866
|
constructor(clientId, cryptoImpl, logger, staticAuthorityOptions) {
|
|
219436
218867
|
this.clientId = clientId;
|
|
219437
218868
|
this.cryptoImpl = cryptoImpl;
|
|
219438
|
-
this.commonLogger = logger.clone(name$
|
|
218869
|
+
this.commonLogger = logger.clone(name$1, version$4);
|
|
219439
218870
|
this.staticAuthorityOptions = staticAuthorityOptions;
|
|
219440
218871
|
}
|
|
219441
218872
|
/**
|
|
@@ -220181,8 +219612,7 @@ class CacheManager {
|
|
|
220181
219612
|
* Distinguish between Bearer and PoP/SSH token cache types
|
|
220182
219613
|
* Cast to lowercase to handle "bearer" from ADFS
|
|
220183
219614
|
*/
|
|
220184
|
-
const credentialType = authScheme
|
|
220185
|
-
authScheme.toLowerCase() !==
|
|
219615
|
+
const credentialType = authScheme.toLowerCase() !==
|
|
220186
219616
|
AuthenticationScheme.BEARER.toLowerCase()
|
|
220187
219617
|
? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
|
|
220188
219618
|
: CredentialType.ACCESS_TOKEN;
|
|
@@ -221404,7 +220834,7 @@ class BaseClient {
|
|
|
221404
220834
|
// Set the configuration
|
|
221405
220835
|
this.config = buildClientConfiguration(configuration);
|
|
221406
220836
|
// Initialize the logger
|
|
221407
|
-
this.logger = new Logger(this.config.loggerOptions, name$
|
|
220837
|
+
this.logger = new Logger(this.config.loggerOptions, name$1, version$4);
|
|
221408
220838
|
// Initialize crypto
|
|
221409
220839
|
this.cryptoUtils = this.config.cryptoInterface;
|
|
221410
220840
|
// Initialize storage interface
|
|
@@ -221662,9 +221092,7 @@ class ProtocolUtils {
|
|
|
221662
221092
|
* Licensed under the MIT License.
|
|
221663
221093
|
*/
|
|
221664
221094
|
const KeyLocation = {
|
|
221665
|
-
SW: "sw"
|
|
221666
|
-
UHW: "uhw",
|
|
221667
|
-
};
|
|
221095
|
+
SW: "sw"};
|
|
221668
221096
|
/** @internal */
|
|
221669
221097
|
class PopTokenGenerator {
|
|
221670
221098
|
constructor(cryptoUtils, performanceClient) {
|
|
@@ -223276,7 +222704,6 @@ const HttpMethod = {
|
|
|
223276
222704
|
POST: "post",
|
|
223277
222705
|
};
|
|
223278
222706
|
const ProxyStatus = {
|
|
223279
|
-
SUCCESS: HttpStatus.SUCCESS,
|
|
223280
222707
|
SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
|
|
223281
222708
|
SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
|
|
223282
222709
|
SERVER_ERROR: HttpStatus.SERVER_ERROR,
|
|
@@ -223330,10 +222757,7 @@ const ApiId = {
|
|
|
223330
222757
|
* JWT constants
|
|
223331
222758
|
*/
|
|
223332
222759
|
const JwtConstants = {
|
|
223333
|
-
ALGORITHM: "alg",
|
|
223334
222760
|
RSA_256: "RS256",
|
|
223335
|
-
X5T: "x5t",
|
|
223336
|
-
X5C: "x5c",
|
|
223337
222761
|
AUDIENCE: "aud",
|
|
223338
222762
|
EXPIRATION_TIME: "exp",
|
|
223339
222763
|
ISSUER: "iss",
|
|
@@ -223558,7 +222982,7 @@ const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, ti
|
|
|
223558
222982
|
...NetworkUtils.urlToHttpOptions(url),
|
|
223559
222983
|
};
|
|
223560
222984
|
if (agentOptions && Object.keys(agentOptions).length) {
|
|
223561
|
-
customOptions.agent = new require$$2$
|
|
222985
|
+
customOptions.agent = new require$$2$2.Agent(agentOptions);
|
|
223562
222986
|
}
|
|
223563
222987
|
if (isPostRequest) {
|
|
223564
222988
|
// needed for post request to work
|
|
@@ -223580,7 +223004,7 @@ const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, ti
|
|
|
223580
223004
|
request = http.request(customOptions);
|
|
223581
223005
|
}
|
|
223582
223006
|
else {
|
|
223583
|
-
request = require$$2$
|
|
223007
|
+
request = require$$2$2.request(customOptions);
|
|
223584
223008
|
}
|
|
223585
223009
|
if (isPostRequest) {
|
|
223586
223010
|
request.write(body);
|
|
@@ -230807,7 +230231,7 @@ class ClientAssertion {
|
|
|
230807
230231
|
}
|
|
230808
230232
|
}/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
230809
230233
|
/* eslint-disable header/header */
|
|
230810
|
-
const name
|
|
230234
|
+
const name = "@azure/msal-node";
|
|
230811
230235
|
const version$3 = "2.9.2";/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
230812
230236
|
|
|
230813
230237
|
/*
|
|
@@ -231007,7 +230431,7 @@ class ClientApplication {
|
|
|
231007
230431
|
constructor(configuration) {
|
|
231008
230432
|
this.config = buildAppConfiguration(configuration);
|
|
231009
230433
|
this.cryptoProvider = new CryptoProvider();
|
|
231010
|
-
this.logger = new Logger(this.config.system.loggerOptions, name
|
|
230434
|
+
this.logger = new Logger(this.config.system.loggerOptions, name, version$3);
|
|
231011
230435
|
this.storage = new NodeStorage(this.logger, this.config.auth.clientId, this.cryptoProvider, buildStaticAuthorityOptions(this.config.auth));
|
|
231012
230436
|
this.tokenCache = new TokenCache(this.storage, this.logger, this.config.cache.cachePlugin);
|
|
231013
230437
|
}
|
|
@@ -232151,8 +231575,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
232151
231575
|
* Distinguish between Bearer and PoP/SSH token cache types
|
|
232152
231576
|
* Cast to lowercase to handle "bearer" from ADFS
|
|
232153
231577
|
*/
|
|
232154
|
-
const credentialType = authScheme
|
|
232155
|
-
authScheme.toLowerCase() !==
|
|
231578
|
+
const credentialType = authScheme.toLowerCase() !==
|
|
232156
231579
|
AuthenticationScheme.BEARER.toLowerCase()
|
|
232157
231580
|
? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
|
|
232158
231581
|
: CredentialType.ACCESS_TOKEN;
|
|
@@ -232408,9 +231831,7 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
232408
231831
|
}
|
|
232409
231832
|
}/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
232410
231833
|
({
|
|
232411
|
-
win32: `${process.env["ProgramData"]}\\AzureConnectedMachineAgent\\Tokens
|
|
232412
|
-
linux: "/var/opt/azcmagent/tokens/",
|
|
232413
|
-
});// Copyright (c) Microsoft Corporation.
|
|
231834
|
+
win32: `${process.env["ProgramData"]}\\AzureConnectedMachineAgent\\Tokens\\`});// Copyright (c) Microsoft Corporation.
|
|
232414
231835
|
// Licensed under the MIT license.
|
|
232415
231836
|
const msiName$6 = "ManagedIdentityCredential - AppServiceMSI 2017";
|
|
232416
231837
|
const logger$o = credentialLogger(msiName$6);
|
|
@@ -232824,7 +232245,7 @@ const fabricMsi = {
|
|
|
232824
232245
|
"IDENTITY_SERVER_THUMBPRINT=[REDACTED].",
|
|
232825
232246
|
].join(" "));
|
|
232826
232247
|
const request = createPipelineRequest(Object.assign({ abortSignal: getTokenOptions.abortSignal }, prepareRequestOptions$1(scopes, clientId, resourceId)));
|
|
232827
|
-
request.agent = new require$$2$
|
|
232248
|
+
request.agent = new require$$2$2.Agent({
|
|
232828
232249
|
// This is necessary because Service Fabric provides a self-signed certificate.
|
|
232829
232250
|
// The alternative path is to verify the certificate using the IDENTITY_SERVER_THUMBPRINT env variable.
|
|
232830
232251
|
rejectUnauthorized: false,
|
|
@@ -236545,7 +235966,7 @@ function requireDebug () {
|
|
|
236545
235966
|
value: true
|
|
236546
235967
|
});
|
|
236547
235968
|
exports.default = void 0;
|
|
236548
|
-
var _events = require$$0$
|
|
235969
|
+
var _events = require$$0$7;
|
|
236549
235970
|
var util = _interopRequireWildcard(require$$0$6);
|
|
236550
235971
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
236551
235972
|
function _interopRequireWildcard(e, r) { if (e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -236640,8 +236061,8 @@ function requireSender$1 () {
|
|
|
236640
236061
|
sender$2.sendInParallel = sendInParallel;
|
|
236641
236062
|
sender$2.sendMessage = sendMessage;
|
|
236642
236063
|
var _dgram = _interopRequireDefault(require$$0$r);
|
|
236643
|
-
var _net = _interopRequireDefault(require$$0$
|
|
236644
|
-
var _nodeUrl = _interopRequireDefault(require$$2$
|
|
236064
|
+
var _net = _interopRequireDefault(require$$0$8);
|
|
236065
|
+
var _nodeUrl = _interopRequireDefault(require$$2$4);
|
|
236645
236066
|
var _abortError = _interopRequireDefault(requireAbortError());
|
|
236646
236067
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
236647
236068
|
async function sendInParallel(addresses, port, request, signal) {
|
|
@@ -236913,14 +236334,11 @@ function requireSprintf () {
|
|
|
236913
236334
|
!function() {
|
|
236914
236335
|
|
|
236915
236336
|
var re = {
|
|
236916
|
-
not_string: /[^s]/,
|
|
236917
|
-
not_bool: /[^t]/,
|
|
236918
236337
|
not_type: /[^T]/,
|
|
236919
236338
|
not_primitive: /[^v]/,
|
|
236920
236339
|
number: /[diefg]/,
|
|
236921
236340
|
numeric_arg: /[bcdiefguxX]/,
|
|
236922
236341
|
json: /[j]/,
|
|
236923
|
-
not_json: /[^j]/,
|
|
236924
236342
|
text: /^[^\x25]+/,
|
|
236925
236343
|
modulo: /^\x25{2}/,
|
|
236926
236344
|
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
|
|
@@ -237582,48 +237000,29 @@ function requireLogin7Payload () {
|
|
|
237582
237000
|
var _tdsVersions = requireTdsVersions();
|
|
237583
237001
|
const FLAGS_1 = {
|
|
237584
237002
|
ENDIAN_LITTLE: 0x00,
|
|
237585
|
-
ENDIAN_BIG: 0x01,
|
|
237586
237003
|
CHARSET_ASCII: 0x00,
|
|
237587
|
-
CHARSET_EBCDIC: 0x02,
|
|
237588
237004
|
FLOAT_IEEE_754: 0x00,
|
|
237589
|
-
FLOAT_VAX: 0x04,
|
|
237590
|
-
FLOAT_ND5000: 0x08,
|
|
237591
|
-
BCP_DUMPLOAD_ON: 0x00,
|
|
237592
237005
|
BCP_DUMPLOAD_OFF: 0x10,
|
|
237593
|
-
USE_DB_ON: 0x00,
|
|
237594
237006
|
USE_DB_OFF: 0x20,
|
|
237595
237007
|
INIT_DB_WARN: 0x00,
|
|
237596
237008
|
INIT_DB_FATAL: 0x40,
|
|
237597
|
-
SET_LANG_WARN_OFF: 0x00,
|
|
237598
237009
|
SET_LANG_WARN_ON: 0x80
|
|
237599
237010
|
};
|
|
237600
237011
|
const FLAGS_2 = {
|
|
237601
237012
|
INIT_LANG_WARN: 0x00,
|
|
237602
|
-
INIT_LANG_FATAL: 0x01,
|
|
237603
237013
|
ODBC_OFF: 0x00,
|
|
237604
|
-
ODBC_ON: 0x02,
|
|
237605
|
-
F_TRAN_BOUNDARY: 0x04,
|
|
237606
|
-
F_CACHE_CONNECT: 0x08,
|
|
237607
237014
|
USER_NORMAL: 0x00,
|
|
237608
|
-
USER_SERVER: 0x10,
|
|
237609
|
-
USER_REMUSER: 0x20,
|
|
237610
|
-
USER_SQLREPL: 0x40,
|
|
237611
237015
|
INTEGRATED_SECURITY_OFF: 0x00,
|
|
237612
237016
|
INTEGRATED_SECURITY_ON: 0x80
|
|
237613
237017
|
};
|
|
237614
237018
|
const TYPE_FLAGS = {
|
|
237615
237019
|
SQL_DFLT: 0x00,
|
|
237616
|
-
SQL_TSQL: 0x08,
|
|
237617
237020
|
OLEDB_OFF: 0x00,
|
|
237618
|
-
OLEDB_ON: 0x10,
|
|
237619
237021
|
READ_WRITE_INTENT: 0x00,
|
|
237620
237022
|
READ_ONLY_INTENT: 0x20
|
|
237621
237023
|
};
|
|
237622
237024
|
const FLAGS_3 = {
|
|
237623
237025
|
CHANGE_PASSWORD_NO: 0x00,
|
|
237624
|
-
CHANGE_PASSWORD_YES: 0x01,
|
|
237625
|
-
BINARY_XML: 0x02,
|
|
237626
|
-
SPAWN_USER_INSTANCE: 0x04,
|
|
237627
237026
|
UNKNOWN_COLLATION_HANDLING: 0x08,
|
|
237628
237027
|
EXTENSION_USED: 0x10
|
|
237629
237028
|
};
|
|
@@ -237633,9 +237032,7 @@ function requireLogin7Payload () {
|
|
|
237633
237032
|
LIBRARY_ADAL: 0x02,
|
|
237634
237033
|
FEDAUTH_YES_ECHO: 0x01,
|
|
237635
237034
|
FEDAUTH_NO_ECHO: 0x00,
|
|
237636
|
-
ADAL_WORKFLOW_USER_PASS: 0x01
|
|
237637
|
-
ADAL_WORKFLOW_INTEGRATED: 0x02
|
|
237638
|
-
};
|
|
237035
|
+
ADAL_WORKFLOW_USER_PASS: 0x01};
|
|
237639
237036
|
const FEATURE_EXT_TERMINATOR = 0xFF;
|
|
237640
237037
|
/*
|
|
237641
237038
|
s2.2.6.3
|
|
@@ -238721,19 +238118,19 @@ function requireErrors$6 () {
|
|
|
238721
238118
|
errors$6.RequestError = RequestError;
|
|
238722
238119
|
|
|
238723
238120
|
return errors$6;
|
|
238724
|
-
}var types$
|
|
238121
|
+
}var types$1 = {};var hasRequiredTypes$1;
|
|
238725
238122
|
|
|
238726
238123
|
function requireTypes$1 () {
|
|
238727
|
-
if (hasRequiredTypes$1) return types$
|
|
238124
|
+
if (hasRequiredTypes$1) return types$1;
|
|
238728
238125
|
hasRequiredTypes$1 = 1;
|
|
238729
238126
|
|
|
238730
|
-
Object.defineProperty(types$
|
|
238127
|
+
Object.defineProperty(types$1, "__esModule", {
|
|
238731
238128
|
value: true
|
|
238732
238129
|
});
|
|
238733
|
-
types$
|
|
238130
|
+
types$1.SQLServerStatementColumnEncryptionSetting = types$1.SQLServerEncryptionType = types$1.DescribeParameterEncryptionResultSet2 = types$1.DescribeParameterEncryptionResultSet1 = void 0;
|
|
238734
238131
|
// This code is based on the `mssql-jdbc` library published under the conditions of MIT license.
|
|
238735
238132
|
// Copyright (c) 2019 Microsoft Corporation
|
|
238736
|
-
types$
|
|
238133
|
+
types$1.SQLServerEncryptionType = /*#__PURE__*/function (SQLServerEncryptionType) {
|
|
238737
238134
|
SQLServerEncryptionType[SQLServerEncryptionType["Deterministic"] = 1] = "Deterministic";
|
|
238738
238135
|
SQLServerEncryptionType[SQLServerEncryptionType["Randomized"] = 2] = "Randomized";
|
|
238739
238136
|
SQLServerEncryptionType[SQLServerEncryptionType["PlainText"] = 0] = "PlainText";
|
|
@@ -238742,7 +238139,7 @@ function requireTypes$1 () {
|
|
|
238742
238139
|
// Fields in the first resultset of "sp_describe_parameter_encryption"
|
|
238743
238140
|
// We expect the server to return the fields in the resultset in the same order as mentioned below.
|
|
238744
238141
|
// If the server changes the below order, then transparent parameter encryption will break.
|
|
238745
|
-
types$
|
|
238142
|
+
types$1.DescribeParameterEncryptionResultSet1 = /*#__PURE__*/function (DescribeParameterEncryptionResultSet1) {
|
|
238746
238143
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["KeyOrdinal"] = 0] = "KeyOrdinal";
|
|
238747
238144
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["DbId"] = 1] = "DbId";
|
|
238748
238145
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["KeyId"] = 2] = "KeyId";
|
|
@@ -238756,7 +238153,7 @@ function requireTypes$1 () {
|
|
|
238756
238153
|
}({}); // Fields in the second resultset of "sp_describe_parameter_encryption"
|
|
238757
238154
|
// We expect the server to return the fields in the resultset in the same order as mentioned below.
|
|
238758
238155
|
// If the server changes the below order, then transparent parameter encryption will break.
|
|
238759
|
-
types$
|
|
238156
|
+
types$1.DescribeParameterEncryptionResultSet2 = /*#__PURE__*/function (DescribeParameterEncryptionResultSet2) {
|
|
238760
238157
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ParameterOrdinal"] = 0] = "ParameterOrdinal";
|
|
238761
238158
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ParameterName"] = 1] = "ParameterName";
|
|
238762
238159
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ColumnEncryptionAlgorithm"] = 2] = "ColumnEncryptionAlgorithm";
|
|
@@ -238765,7 +238162,7 @@ function requireTypes$1 () {
|
|
|
238765
238162
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["NormalizationRuleVersion"] = 5] = "NormalizationRuleVersion";
|
|
238766
238163
|
return DescribeParameterEncryptionResultSet2;
|
|
238767
238164
|
}({});
|
|
238768
|
-
types$
|
|
238165
|
+
types$1.SQLServerStatementColumnEncryptionSetting = /*#__PURE__*/function (SQLServerStatementColumnEncryptionSetting) {
|
|
238769
238166
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["UseConnectionSetting"] = 0] = "UseConnectionSetting";
|
|
238770
238167
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["Enabled"] = 1] = "Enabled";
|
|
238771
238168
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["ResultSetOnly"] = 2] = "ResultSetOnly";
|
|
@@ -238773,7 +238170,7 @@ function requireTypes$1 () {
|
|
|
238773
238170
|
return SQLServerStatementColumnEncryptionSetting;
|
|
238774
238171
|
}({});
|
|
238775
238172
|
|
|
238776
|
-
return types$
|
|
238173
|
+
return types$1;
|
|
238777
238174
|
}var hasRequiredRequest$1;
|
|
238778
238175
|
|
|
238779
238176
|
function requireRequest$1 () {
|
|
@@ -238785,7 +238182,7 @@ function requireRequest$1 () {
|
|
|
238785
238182
|
value: true
|
|
238786
238183
|
});
|
|
238787
238184
|
exports.default = void 0;
|
|
238788
|
-
var _events = require$$0$
|
|
238185
|
+
var _events = require$$0$7;
|
|
238789
238186
|
var _errors = requireErrors$6();
|
|
238790
238187
|
var _types = requireTypes$1();
|
|
238791
238188
|
/**
|
|
@@ -239177,10 +238574,7 @@ function requireAllHeaders () {
|
|
|
239177
238574
|
});
|
|
239178
238575
|
allHeaders.writeToTrackingBuffer = writeToTrackingBuffer;
|
|
239179
238576
|
const TYPE = {
|
|
239180
|
-
|
|
239181
|
-
TXN_DESCRIPTOR: 2,
|
|
239182
|
-
TRACE_ACTIVITY: 3
|
|
239183
|
-
};
|
|
238577
|
+
TXN_DESCRIPTOR: 2};
|
|
239184
238578
|
const TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8;
|
|
239185
238579
|
const TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN;
|
|
239186
238580
|
function writeToTrackingBuffer(buffer, txnDescriptor, outstandingRequestCount) {
|
|
@@ -239216,9 +238610,7 @@ function requireRpcrequestPayload () {
|
|
|
239216
238610
|
// };
|
|
239217
238611
|
|
|
239218
238612
|
const STATUS = {
|
|
239219
|
-
BY_REF_VALUE: 0x01
|
|
239220
|
-
DEFAULT_VALUE: 0x02
|
|
239221
|
-
};
|
|
238613
|
+
BY_REF_VALUE: 0x01};
|
|
239222
238614
|
|
|
239223
238615
|
/*
|
|
239224
238616
|
s2.2.6.5
|
|
@@ -241025,7 +240417,7 @@ function requireUtil$2 () {
|
|
|
241025
240417
|
return fn
|
|
241026
240418
|
},
|
|
241027
240419
|
addAbortListener:
|
|
241028
|
-
require$$0$
|
|
240420
|
+
require$$0$7.addAbortListener ||
|
|
241029
240421
|
function addAbortListener(signal, listener) {
|
|
241030
240422
|
if (signal === undefined) {
|
|
241031
240423
|
throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)
|
|
@@ -242555,7 +241947,7 @@ function requireLegacy () {
|
|
|
242555
241947
|
hasRequiredLegacy = 1;
|
|
242556
241948
|
|
|
242557
241949
|
const { ArrayIsArray, ObjectSetPrototypeOf } = requirePrimordials();
|
|
242558
|
-
const { EventEmitter: EE } = require$$0$
|
|
241950
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
242559
241951
|
function Stream(opts) {
|
|
242560
241952
|
EE.call(this, opts);
|
|
242561
241953
|
}
|
|
@@ -243321,7 +242713,7 @@ function requireReadable () {
|
|
|
243321
242713
|
} = requirePrimordials();
|
|
243322
242714
|
readable = Readable;
|
|
243323
242715
|
Readable.ReadableState = ReadableState;
|
|
243324
|
-
const { EventEmitter: EE } = require$$0$
|
|
242716
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
243325
242717
|
const { Stream, prependListener } = requireLegacy();
|
|
243326
242718
|
const { Buffer } = require$$0$k;
|
|
243327
242719
|
const { addAbortSignal } = requireAddAbortSignal();
|
|
@@ -244593,7 +243985,7 @@ function requireWritable () {
|
|
|
244593
243985
|
} = requirePrimordials();
|
|
244594
243986
|
writable = Writable;
|
|
244595
243987
|
Writable.WritableState = WritableState;
|
|
244596
|
-
const { EventEmitter: EE } = require$$0$
|
|
243988
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
244597
243989
|
const Stream = requireLegacy().Stream;
|
|
244598
243990
|
const { Buffer } = require$$0$k;
|
|
244599
243991
|
const destroyImpl = requireDestroy();
|
|
@@ -248151,7 +247543,7 @@ function requireMessageIo () {
|
|
|
248151
247543
|
exports.default = void 0;
|
|
248152
247544
|
var _nativeDuplexpair = _interopRequireDefault(requireNativeDuplexpair());
|
|
248153
247545
|
var tls = _interopRequireWildcard(require$$1$1);
|
|
248154
|
-
var _events = require$$0$
|
|
247546
|
+
var _events = require$$0$7;
|
|
248155
247547
|
var _message = _interopRequireDefault(requireMessage());
|
|
248156
247548
|
var _packet = requirePacket$1();
|
|
248157
247549
|
var _incomingMessageStream = _interopRequireDefault(requireIncomingMessageStream());
|
|
@@ -254491,7 +253883,7 @@ var InstantPrinterParser = function () {
|
|
|
254491
253883
|
buf.append(':00');
|
|
254492
253884
|
}
|
|
254493
253885
|
if (_hi < 0) {
|
|
254494
|
-
if (_ldt.year() === -
|
|
253886
|
+
if (_ldt.year() === -1e4) {
|
|
254495
253887
|
buf.replace(pos, pos + 2, "" + (_hi - 1));
|
|
254496
253888
|
} else if (_lo === 0) {
|
|
254497
253889
|
buf.insert(pos, _hi);
|
|
@@ -262307,7 +261699,7 @@ function requireDbcsCodec () {
|
|
|
262307
261699
|
var UNASSIGNED = -1,
|
|
262308
261700
|
GB18030_CODE = -2,
|
|
262309
261701
|
SEQ_START = -10,
|
|
262310
|
-
NODE_START = -
|
|
261702
|
+
NODE_START = -1e3,
|
|
262311
261703
|
UNASSIGNED_NODE = new Array(0x100),
|
|
262312
261704
|
DEF_CHAR = -1;
|
|
262313
261705
|
|
|
@@ -264247,7 +263639,7 @@ function requireDbcsCodec () {
|
|
|
264247
263639
|
4,
|
|
264248
263640
|
"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"
|
|
264249
263641
|
]
|
|
264250
|
-
];var require$$2
|
|
263642
|
+
];var require$$2 = [
|
|
264251
263643
|
[
|
|
264252
263644
|
"0",
|
|
264253
263645
|
"\u0000",
|
|
@@ -271244,13 +270636,13 @@ function requireDbcsData () {
|
|
|
271244
270636
|
'936': 'cp936',
|
|
271245
270637
|
'cp936': {
|
|
271246
270638
|
type: '_dbcs',
|
|
271247
|
-
table: function() { return require$$2
|
|
270639
|
+
table: function() { return require$$2 },
|
|
271248
270640
|
},
|
|
271249
270641
|
|
|
271250
270642
|
// GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
|
|
271251
270643
|
'gbk': {
|
|
271252
270644
|
type: '_dbcs',
|
|
271253
|
-
table: function() { return require$$2
|
|
270645
|
+
table: function() { return require$$2.concat(require$$3$1) },
|
|
271254
270646
|
},
|
|
271255
270647
|
'xgbk': 'gbk',
|
|
271256
270648
|
'isoir58': 'gbk',
|
|
@@ -271262,7 +270654,7 @@ function requireDbcsData () {
|
|
|
271262
270654
|
// http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
|
|
271263
270655
|
'gb18030': {
|
|
271264
270656
|
type: '_dbcs',
|
|
271265
|
-
table: function() { return require$$2
|
|
270657
|
+
table: function() { return require$$2.concat(require$$3$1) },
|
|
271266
270658
|
gb18030: function() { return require$$4 },
|
|
271267
270659
|
encodeSkipVals: [0x80],
|
|
271268
270660
|
encodeAdd: {'€': 0xA2E3},
|
|
@@ -274397,8 +273789,6 @@ function requireDoneTokenParser () {
|
|
|
274397
273789
|
const STATUS = {
|
|
274398
273790
|
MORE: 0x0001,
|
|
274399
273791
|
ERROR: 0x0002,
|
|
274400
|
-
// This bit is not yet in use by SQL Server, so is not exposed in the returned token
|
|
274401
|
-
INXACT: 0x0004,
|
|
274402
273792
|
COUNT: 0x0010,
|
|
274403
273793
|
ATTN: 0x0020,
|
|
274404
273794
|
SRVERROR: 0x0100
|
|
@@ -274820,11 +274210,7 @@ function requireFeatureExtAckParser () {
|
|
|
274820
274210
|
var _helpers = requireHelpers$1();
|
|
274821
274211
|
var _token = requireToken();
|
|
274822
274212
|
const FEATURE_ID = {
|
|
274823
|
-
SESSIONRECOVERY: 0x01,
|
|
274824
274213
|
FEDAUTH: 0x02,
|
|
274825
|
-
COLUMNENCRYPTION: 0x04,
|
|
274826
|
-
GLOBALTRANSACTIONS: 0x05,
|
|
274827
|
-
AZURESQLSUPPORT: 0x08,
|
|
274828
274214
|
UTF8_SUPPORT: 0x0A,
|
|
274829
274215
|
TERMINATOR: 0xFF
|
|
274830
274216
|
};
|
|
@@ -276537,7 +275923,7 @@ function requireTokenStreamParser () {
|
|
|
276537
275923
|
value: true
|
|
276538
275924
|
});
|
|
276539
275925
|
tokenStreamParser.Parser = void 0;
|
|
276540
|
-
var _events = require$$0$
|
|
275926
|
+
var _events = require$$0$7;
|
|
276541
275927
|
var _streamParser = _interopRequireDefault(requireStreamParser());
|
|
276542
275928
|
var _stream = require$$0$b;
|
|
276543
275929
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -276721,8 +276107,8 @@ function requireConnector () {
|
|
|
276721
276107
|
connector.connectInParallel = connectInParallel;
|
|
276722
276108
|
connector.connectInSequence = connectInSequence;
|
|
276723
276109
|
connector.lookupAllAddresses = lookupAllAddresses;
|
|
276724
|
-
var _net = _interopRequireDefault(require$$0$
|
|
276725
|
-
var _nodeUrl = _interopRequireDefault(require$$2$
|
|
276110
|
+
var _net = _interopRequireDefault(require$$0$8);
|
|
276111
|
+
var _nodeUrl = _interopRequireDefault(require$$2$4);
|
|
276726
276112
|
var _abortError = _interopRequireDefault(requireAbortError());
|
|
276727
276113
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
276728
276114
|
async function connectInParallel(options, lookup, signal) {
|
|
@@ -276890,34 +276276,13 @@ function requireNtlm () {
|
|
|
276890
276276
|
NTLM_NegotiateUnicode: 0x00000001,
|
|
276891
276277
|
NTLM_NegotiateOEM: 0x00000002,
|
|
276892
276278
|
NTLM_RequestTarget: 0x00000004,
|
|
276893
|
-
NTLM_Unknown9: 0x00000008,
|
|
276894
|
-
NTLM_NegotiateSign: 0x00000010,
|
|
276895
|
-
NTLM_NegotiateSeal: 0x00000020,
|
|
276896
|
-
NTLM_NegotiateDatagram: 0x00000040,
|
|
276897
|
-
NTLM_NegotiateLanManagerKey: 0x00000080,
|
|
276898
|
-
NTLM_Unknown8: 0x00000100,
|
|
276899
276279
|
NTLM_NegotiateNTLM: 0x00000200,
|
|
276900
|
-
NTLM_NegotiateNTOnly: 0x00000400,
|
|
276901
|
-
NTLM_Anonymous: 0x00000800,
|
|
276902
276280
|
NTLM_NegotiateOemDomainSupplied: 0x00001000,
|
|
276903
276281
|
NTLM_NegotiateOemWorkstationSupplied: 0x00002000,
|
|
276904
|
-
NTLM_Unknown6: 0x00004000,
|
|
276905
276282
|
NTLM_NegotiateAlwaysSign: 0x00008000,
|
|
276906
|
-
NTLM_TargetTypeDomain: 0x00010000,
|
|
276907
|
-
NTLM_TargetTypeServer: 0x00020000,
|
|
276908
|
-
NTLM_TargetTypeShare: 0x00040000,
|
|
276909
276283
|
NTLM_NegotiateExtendedSecurity: 0x00080000,
|
|
276910
|
-
NTLM_NegotiateIdentify: 0x00100000,
|
|
276911
|
-
NTLM_Unknown5: 0x00200000,
|
|
276912
|
-
NTLM_RequestNonNTSessionKey: 0x00400000,
|
|
276913
|
-
NTLM_NegotiateTargetInfo: 0x00800000,
|
|
276914
|
-
NTLM_Unknown4: 0x01000000,
|
|
276915
276284
|
NTLM_NegotiateVersion: 0x02000000,
|
|
276916
|
-
NTLM_Unknown3: 0x04000000,
|
|
276917
|
-
NTLM_Unknown2: 0x08000000,
|
|
276918
|
-
NTLM_Unknown1: 0x10000000,
|
|
276919
276285
|
NTLM_Negotiate128: 0x20000000,
|
|
276920
|
-
NTLM_NegotiateKeyExchange: 0x40000000,
|
|
276921
276286
|
NTLM_Negotiate56: 0x80000000
|
|
276922
276287
|
};
|
|
276923
276288
|
function createNTLMRequest(options) {
|
|
@@ -277014,166 +276379,9 @@ function requireSpecialStoredProcedure () {
|
|
|
277014
276379
|
|
|
277015
276380
|
} (specialStoredProcedure, specialStoredProcedure.exports));
|
|
277016
276381
|
return specialStoredProcedure.exports;
|
|
277017
|
-
}var
|
|
277018
|
-
var contributors = [
|
|
277019
|
-
"Alex Robson",
|
|
277020
|
-
"Arthur Schreiber",
|
|
277021
|
-
"Bret Copeland <bret@atlantisflight.org> (https://github.com/bretcope)",
|
|
277022
|
-
"Bryan Ross <bryan@rossipedia.com> (https://github.com/rossipedia)",
|
|
277023
|
-
"Ciaran Jessup <ciaranj@gmail.com>",
|
|
277024
|
-
"Cort Fritz <cfritz@caa.com>",
|
|
277025
|
-
"lastonesky",
|
|
277026
|
-
"Patrik Simek <patrik@patriksimek.cz>",
|
|
277027
|
-
"Phil Dodderidge <pdodde@poyntz.com>",
|
|
277028
|
-
"Zach Aller"
|
|
277029
|
-
];
|
|
277030
|
-
var name$2 = "tedious";
|
|
277031
|
-
var description$1 = "A TDS driver, for connecting to MS SQLServer databases.";
|
|
277032
|
-
var keywords$2 = [
|
|
277033
|
-
"sql",
|
|
277034
|
-
"database",
|
|
277035
|
-
"mssql",
|
|
277036
|
-
"sqlserver",
|
|
277037
|
-
"sql-server",
|
|
277038
|
-
"tds",
|
|
277039
|
-
"msnodesql",
|
|
277040
|
-
"azure"
|
|
277041
|
-
];
|
|
277042
|
-
var homepage$2 = "https://github.com/tediousjs/tedious";
|
|
277043
|
-
var bugs$1 = "https://github.com/tediousjs/tedious/issues";
|
|
277044
|
-
var license$2 = "MIT";
|
|
277045
|
-
var version$2 = "18.2.1";
|
|
277046
|
-
var main$2 = "./lib/tedious.js";
|
|
277047
|
-
var types$2 = "./lib/tedious.d.ts";
|
|
277048
|
-
var repository$2 = {
|
|
277049
|
-
type: "git",
|
|
277050
|
-
url: "https://github.com/tediousjs/tedious.git"
|
|
277051
|
-
};
|
|
277052
|
-
var engines$2 = {
|
|
277053
|
-
node: ">=18"
|
|
277054
|
-
};
|
|
277055
|
-
var publishConfig = {
|
|
277056
|
-
tag: "next"
|
|
277057
|
-
};
|
|
277058
|
-
var dependencies$2 = {
|
|
277059
|
-
"@azure/identity": "^4.2.1",
|
|
277060
|
-
"@azure/keyvault-keys": "^4.4.0",
|
|
277061
|
-
"@js-joda/core": "^5.6.1",
|
|
277062
|
-
"@types/node": ">=18",
|
|
277063
|
-
bl: "^6.0.11",
|
|
277064
|
-
"iconv-lite": "^0.6.3",
|
|
277065
|
-
"js-md4": "^0.3.2",
|
|
277066
|
-
"native-duplexpair": "^1.0.0",
|
|
277067
|
-
"sprintf-js": "^1.1.3"
|
|
277068
|
-
};
|
|
277069
|
-
var devDependencies$2 = {
|
|
277070
|
-
"@babel/cli": "^7.23.9",
|
|
277071
|
-
"@babel/core": "^7.23.9",
|
|
277072
|
-
"@babel/node": "^7.23.9",
|
|
277073
|
-
"@babel/preset-env": "^7.23.9",
|
|
277074
|
-
"@babel/preset-typescript": "^7.23.3",
|
|
277075
|
-
"@babel/register": "^7.23.7",
|
|
277076
|
-
"@types/async": "^3.2.24",
|
|
277077
|
-
"@types/bl": "^5.1.0",
|
|
277078
|
-
"@types/chai": "^4.3.12",
|
|
277079
|
-
"@types/depd": "^1.1.36",
|
|
277080
|
-
"@types/lru-cache": "^5.1.1",
|
|
277081
|
-
"@types/mocha": "^10.0.6",
|
|
277082
|
-
"@types/sprintf-js": "^1.1.4",
|
|
277083
|
-
"@typescript-eslint/eslint-plugin": "^7.0.2",
|
|
277084
|
-
"@typescript-eslint/parser": "^7.0.2",
|
|
277085
|
-
async: "^3.2.5",
|
|
277086
|
-
"babel-plugin-istanbul": "^6.1.1",
|
|
277087
|
-
chai: "^4.4.1",
|
|
277088
|
-
codecov: "^3.8.3",
|
|
277089
|
-
eslint: "^8.57.0",
|
|
277090
|
-
mitm: "^1.7.2",
|
|
277091
|
-
mocha: "^10.3.0",
|
|
277092
|
-
nyc: "^15.1.0",
|
|
277093
|
-
rimraf: "^5.0.5",
|
|
277094
|
-
"semantic-release": "^19.0.3",
|
|
277095
|
-
sinon: "^15.2.0",
|
|
277096
|
-
typedoc: "^0.25.8",
|
|
277097
|
-
typescript: "^5.3.3"
|
|
277098
|
-
};
|
|
277099
|
-
var scripts$2 = {
|
|
277100
|
-
docs: "typedoc",
|
|
277101
|
-
lint: "eslint src test --ext .js,.ts && tsc",
|
|
277102
|
-
test: "mocha --forbid-only test/unit test/unit/token test/unit/tracking-buffer",
|
|
277103
|
-
"test-integration": "mocha --forbid-only test/integration/",
|
|
277104
|
-
"test-all": "mocha --forbid-only test/unit/ test/unit/token/ test/unit/tracking-buffer test/integration/",
|
|
277105
|
-
"build:types": "tsc --project tsconfig.build-types.json",
|
|
277106
|
-
build: "rimraf lib && babel src --out-dir lib --extensions .js,.ts && npm run build:types",
|
|
277107
|
-
prepublish: "npm run build",
|
|
277108
|
-
"semantic-release": "semantic-release"
|
|
277109
|
-
};
|
|
277110
|
-
var babel = {
|
|
277111
|
-
sourceMaps: "both",
|
|
277112
|
-
ignore: [
|
|
277113
|
-
"./src/**/*.d.ts"
|
|
277114
|
-
],
|
|
277115
|
-
presets: [
|
|
277116
|
-
[
|
|
277117
|
-
"@babel/preset-env",
|
|
277118
|
-
{
|
|
277119
|
-
targets: {
|
|
277120
|
-
node: 18
|
|
277121
|
-
}
|
|
277122
|
-
}
|
|
277123
|
-
],
|
|
277124
|
-
[
|
|
277125
|
-
"@babel/preset-typescript",
|
|
277126
|
-
{
|
|
277127
|
-
allowDeclareFields: true
|
|
277128
|
-
}
|
|
277129
|
-
]
|
|
277130
|
-
],
|
|
277131
|
-
plugins: [
|
|
277132
|
-
[
|
|
277133
|
-
"@babel/transform-typescript",
|
|
277134
|
-
{
|
|
277135
|
-
allowDeclareFields: true
|
|
277136
|
-
}
|
|
277137
|
-
]
|
|
277138
|
-
]
|
|
277139
|
-
};
|
|
277140
|
-
var mocha = {
|
|
277141
|
-
require: "test/setup.js",
|
|
277142
|
-
timeout: 5000,
|
|
277143
|
-
extension: [
|
|
277144
|
-
"js",
|
|
277145
|
-
"ts"
|
|
277146
|
-
]
|
|
277147
|
-
};
|
|
277148
|
-
var nyc = {
|
|
277149
|
-
sourceMap: false,
|
|
277150
|
-
instrument: false,
|
|
277151
|
-
extension: [
|
|
277152
|
-
".ts"
|
|
277153
|
-
]
|
|
277154
|
-
};
|
|
276382
|
+
}var version$2 = "18.2.1";
|
|
277155
276383
|
var require$$32 = {
|
|
277156
|
-
|
|
277157
|
-
contributors: contributors,
|
|
277158
|
-
name: name$2,
|
|
277159
|
-
description: description$1,
|
|
277160
|
-
keywords: keywords$2,
|
|
277161
|
-
homepage: homepage$2,
|
|
277162
|
-
bugs: bugs$1,
|
|
277163
|
-
license: license$2,
|
|
277164
|
-
version: version$2,
|
|
277165
|
-
main: main$2,
|
|
277166
|
-
types: types$2,
|
|
277167
|
-
repository: repository$2,
|
|
277168
|
-
engines: engines$2,
|
|
277169
|
-
publishConfig: publishConfig,
|
|
277170
|
-
dependencies: dependencies$2,
|
|
277171
|
-
devDependencies: devDependencies$2,
|
|
277172
|
-
scripts: scripts$2,
|
|
277173
|
-
babel: babel,
|
|
277174
|
-
mocha: mocha,
|
|
277175
|
-
nyc: nyc
|
|
277176
|
-
};var handler = {};var hasRequiredHandler;
|
|
276384
|
+
version: version$2};var handler = {};var hasRequiredHandler;
|
|
277177
276385
|
|
|
277178
276386
|
function requireHandler () {
|
|
277179
276387
|
if (hasRequiredHandler) return handler;
|
|
@@ -277636,14 +276844,14 @@ function requireConnection$2 () {
|
|
|
277636
276844
|
var _crypto = _interopRequireDefault(require$$0$a);
|
|
277637
276845
|
var _os = _interopRequireDefault(require$$0$c);
|
|
277638
276846
|
var tls = _interopRequireWildcard(require$$1$1);
|
|
277639
|
-
var net = _interopRequireWildcard(require$$0$
|
|
276847
|
+
var net = _interopRequireWildcard(require$$0$8);
|
|
277640
276848
|
var _dns = _interopRequireDefault(require$$0$9);
|
|
277641
276849
|
var _constants = _interopRequireDefault(require$$5$3);
|
|
277642
276850
|
var _stream = require$$0$b;
|
|
277643
276851
|
var _identity = require$$7$1;
|
|
277644
276852
|
var _bulkLoad = _interopRequireDefault(requireBulkLoad());
|
|
277645
276853
|
var _debug = _interopRequireDefault(requireDebug());
|
|
277646
|
-
var _events = require$$0$
|
|
276854
|
+
var _events = require$$0$7;
|
|
277647
276855
|
var _instanceLookup = requireInstanceLookup();
|
|
277648
276856
|
var _transientErrorLookup = requireTransientErrorLookup();
|
|
277649
276857
|
var _packet = requirePacket$1();
|
|
@@ -280898,7 +280106,6 @@ function requireUdt () {
|
|
|
280898
280106
|
const properties = {
|
|
280899
280107
|
Z: (flags & (1 << 0)) > 0,
|
|
280900
280108
|
M: (flags & (1 << 1)) > 0,
|
|
280901
|
-
V: (flags & (1 << 2)) > 0,
|
|
280902
280109
|
P: (flags & (1 << 3)) > 0,
|
|
280903
280110
|
L: (flags & (1 << 4)) > 0
|
|
280904
280111
|
};
|
|
@@ -288510,13 +287717,13 @@ function requireAuth_switch_response () {
|
|
|
288510
287717
|
|
|
288511
287718
|
auth_switch_response = AuthSwitchResponse;
|
|
288512
287719
|
return auth_switch_response;
|
|
288513
|
-
}var types
|
|
287720
|
+
}var types = {exports: {}};var hasRequiredTypes;
|
|
288514
287721
|
|
|
288515
287722
|
function requireTypes () {
|
|
288516
|
-
if (hasRequiredTypes) return types
|
|
287723
|
+
if (hasRequiredTypes) return types.exports;
|
|
288517
287724
|
hasRequiredTypes = 1;
|
|
288518
287725
|
|
|
288519
|
-
types
|
|
287726
|
+
types.exports = {
|
|
288520
287727
|
0x00: 'DECIMAL', // aka DECIMAL
|
|
288521
287728
|
0x01: 'TINY', // aka TINYINT, 1 byte
|
|
288522
287729
|
0x02: 'SHORT', // aka SMALLINT, 2 bytes
|
|
@@ -288550,36 +287757,36 @@ function requireTypes () {
|
|
|
288550
287757
|
|
|
288551
287758
|
// Manually extracted from mysql-5.5.23/include/mysql_com.h
|
|
288552
287759
|
// some more info here: http://dev.mysql.com/doc/refman/5.5/en/c-api-prepared-statement-type-codes.html
|
|
288553
|
-
types
|
|
288554
|
-
types
|
|
288555
|
-
types
|
|
288556
|
-
types
|
|
288557
|
-
types
|
|
288558
|
-
types
|
|
288559
|
-
types
|
|
288560
|
-
types
|
|
288561
|
-
types
|
|
288562
|
-
types
|
|
288563
|
-
types
|
|
288564
|
-
types
|
|
288565
|
-
types
|
|
288566
|
-
types
|
|
288567
|
-
types
|
|
288568
|
-
types
|
|
288569
|
-
types
|
|
288570
|
-
types
|
|
288571
|
-
types
|
|
288572
|
-
types
|
|
288573
|
-
types
|
|
288574
|
-
types
|
|
288575
|
-
types
|
|
288576
|
-
types
|
|
288577
|
-
types
|
|
288578
|
-
types
|
|
288579
|
-
types
|
|
288580
|
-
types
|
|
288581
|
-
types
|
|
288582
|
-
return types
|
|
287760
|
+
types.exports.DECIMAL = 0x00; // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html)
|
|
287761
|
+
types.exports.TINY = 0x01; // aka TINYINT, 1 byte
|
|
287762
|
+
types.exports.SHORT = 0x02; // aka SMALLINT, 2 bytes
|
|
287763
|
+
types.exports.LONG = 0x03; // aka INT, 4 bytes
|
|
287764
|
+
types.exports.FLOAT = 0x04; // aka FLOAT, 4-8 bytes
|
|
287765
|
+
types.exports.DOUBLE = 0x05; // aka DOUBLE, 8 bytes
|
|
287766
|
+
types.exports.NULL = 0x06; // NULL (used for prepared statements, I think)
|
|
287767
|
+
types.exports.TIMESTAMP = 0x07; // aka TIMESTAMP
|
|
287768
|
+
types.exports.LONGLONG = 0x08; // aka BIGINT, 8 bytes
|
|
287769
|
+
types.exports.INT24 = 0x09; // aka MEDIUMINT, 3 bytes
|
|
287770
|
+
types.exports.DATE = 0x0a; // aka DATE
|
|
287771
|
+
types.exports.TIME = 0x0b; // aka TIME
|
|
287772
|
+
types.exports.DATETIME = 0x0c; // aka DATETIME
|
|
287773
|
+
types.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
|
|
287774
|
+
types.exports.NEWDATE = 0x0e; // aka ?
|
|
287775
|
+
types.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
|
|
287776
|
+
types.exports.BIT = 0x10; // aka BIT, 1-8 byte
|
|
287777
|
+
types.exports.VECTOR = 0xf2;
|
|
287778
|
+
types.exports.JSON = 0xf5;
|
|
287779
|
+
types.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
|
|
287780
|
+
types.exports.ENUM = 0xf7; // aka ENUM
|
|
287781
|
+
types.exports.SET = 0xf8; // aka SET
|
|
287782
|
+
types.exports.TINY_BLOB = 0xf9; // aka TINYBLOB, TINYTEXT
|
|
287783
|
+
types.exports.MEDIUM_BLOB = 0xfa; // aka MEDIUMBLOB, MEDIUMTEXT
|
|
287784
|
+
types.exports.LONG_BLOB = 0xfb; // aka LONGBLOG, LONGTEXT
|
|
287785
|
+
types.exports.BLOB = 0xfc; // aka BLOB, TEXT
|
|
287786
|
+
types.exports.VAR_STRING = 0xfd; // aka VARCHAR, VARBINARY
|
|
287787
|
+
types.exports.STRING = 0xfe; // aka CHAR, BINARY
|
|
287788
|
+
types.exports.GEOMETRY = 0xff; // aka GEOMETRY
|
|
287789
|
+
return types.exports;
|
|
288583
287790
|
}var binary_row;
|
|
288584
287791
|
var hasRequiredBinary_row;
|
|
288585
287792
|
|
|
@@ -290785,7 +289992,7 @@ function requireCommand () {
|
|
|
290785
289992
|
if (hasRequiredCommand) return command;
|
|
290786
289993
|
hasRequiredCommand = 1;
|
|
290787
289994
|
|
|
290788
|
-
const EventEmitter = require$$0$
|
|
289995
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
290789
289996
|
const Timers = require$$1$7;
|
|
290790
289997
|
|
|
290791
289998
|
class Command extends EventEmitter {
|
|
@@ -291193,7 +290400,7 @@ function requireSeqQueue$1 () {
|
|
|
291193
290400
|
if (hasRequiredSeqQueue$1) return seqQueue$1.exports;
|
|
291194
290401
|
hasRequiredSeqQueue$1 = 1;
|
|
291195
290402
|
(function (module) {
|
|
291196
|
-
var EventEmitter = require$$0$
|
|
290403
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
291197
290404
|
var util = require$$0$6;
|
|
291198
290405
|
|
|
291199
290406
|
var DEFAULT_TIMEOUT = 3000;
|
|
@@ -293818,7 +293025,6 @@ function requireBinlog_query_statusvars () {
|
|
|
293818
293025
|
FLAGS2: 0,
|
|
293819
293026
|
SQL_MODE: 1,
|
|
293820
293027
|
CATALOG: 2,
|
|
293821
|
-
AUTO_INCREMENT: 3,
|
|
293822
293028
|
CHARSET: 4,
|
|
293823
293029
|
TIME_ZONE: 5,
|
|
293824
293030
|
CATALOG_NZ: 6,
|
|
@@ -294175,112 +293381,9 @@ function requireCommands$7 () {
|
|
|
294175
293381
|
Quit
|
|
294176
293382
|
};
|
|
294177
293383
|
return commands$7;
|
|
294178
|
-
}var
|
|
294179
|
-
var version$1 = "3.11.3";
|
|
294180
|
-
var description = "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS";
|
|
294181
|
-
var main$1 = "index.js";
|
|
294182
|
-
var typings = "typings/mysql/index";
|
|
294183
|
-
var scripts$1 = {
|
|
294184
|
-
lint: "npm run lint:docs && npm run lint:code",
|
|
294185
|
-
"lint:code": "eslint index.js promise.js index.d.ts promise.d.ts \"typings/**/*.ts\" \"lib/**/*.js\" \"test/**/*.{js,cjs,mjs,ts}\" \"benchmarks/**/*.js\"",
|
|
294186
|
-
"lint:docs": "eslint Contributing.md README.md",
|
|
294187
|
-
"lint:typings": "npx prettier --check ./typings",
|
|
294188
|
-
"lint:tests": "npx prettier --check ./test",
|
|
294189
|
-
test: "poku --debug --include=\"test/esm,test/unit,test/integration\"",
|
|
294190
|
-
"test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"",
|
|
294191
|
-
"test:deno": "deno run --allow-read --allow-env --allow-run npm:poku --debug --platform=\"deno\" --deno-allow=\"read,env,net,sys\" --deno-cjs=\".js,.cjs\" --include=\"test/esm,test/unit,test/integration\"",
|
|
294192
|
-
"test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"",
|
|
294193
|
-
"coverage-test": "c8 npm run test",
|
|
294194
|
-
benchmark: "node ./benchmarks/benchmark.js",
|
|
294195
|
-
prettier: "prettier --single-quote --trailing-comma none --write \"{lib,test}/**/*.js\"",
|
|
294196
|
-
"prettier:docs": "prettier --single-quote --trailing-comma none --write README.md",
|
|
294197
|
-
precommit: "lint-staged",
|
|
294198
|
-
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check",
|
|
294199
|
-
"wait-port": "wait-on"
|
|
294200
|
-
};
|
|
294201
|
-
var repository$1 = {
|
|
294202
|
-
type: "git",
|
|
294203
|
-
url: "https://github.com/sidorares/node-mysql2"
|
|
294204
|
-
};
|
|
294205
|
-
var homepage$1 = "https://sidorares.github.io/node-mysql2/docs";
|
|
294206
|
-
var keywords$1 = [
|
|
294207
|
-
"mysql",
|
|
294208
|
-
"client",
|
|
294209
|
-
"server"
|
|
294210
|
-
];
|
|
294211
|
-
var files$1 = [
|
|
294212
|
-
"lib",
|
|
294213
|
-
"typings/mysql",
|
|
294214
|
-
"index.js",
|
|
294215
|
-
"index.d.ts",
|
|
294216
|
-
"promise.js",
|
|
294217
|
-
"promise.d.ts"
|
|
294218
|
-
];
|
|
294219
|
-
var exports$1 = {
|
|
294220
|
-
".": "./index.js",
|
|
294221
|
-
"./package.json": "./package.json",
|
|
294222
|
-
"./promise": "./promise.js",
|
|
294223
|
-
"./promise.js": "./promise.js"
|
|
294224
|
-
};
|
|
294225
|
-
var engines$1 = {
|
|
294226
|
-
node: ">= 8.0"
|
|
294227
|
-
};
|
|
294228
|
-
var author = "Andrey Sidorov <andrey.sidorov@gmail.com>";
|
|
294229
|
-
var license$1 = "MIT";
|
|
294230
|
-
var dependencies$1 = {
|
|
294231
|
-
"aws-ssl-profiles": "^1.1.1",
|
|
294232
|
-
denque: "^2.1.0",
|
|
294233
|
-
"generate-function": "^2.3.1",
|
|
294234
|
-
"iconv-lite": "^0.6.3",
|
|
294235
|
-
long: "^5.2.1",
|
|
294236
|
-
"lru.min": "^1.0.0",
|
|
294237
|
-
"named-placeholders": "^1.1.3",
|
|
294238
|
-
"seq-queue": "^0.0.5",
|
|
294239
|
-
sqlstring: "^2.3.2"
|
|
294240
|
-
};
|
|
294241
|
-
var devDependencies$1 = {
|
|
294242
|
-
"@types/node": "^22.0.0",
|
|
294243
|
-
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
|
294244
|
-
"@typescript-eslint/parser": "^5.42.1",
|
|
294245
|
-
"assert-diff": "^3.0.2",
|
|
294246
|
-
benchmark: "^2.1.4",
|
|
294247
|
-
c8: "^10.1.1",
|
|
294248
|
-
"error-stack-parser": "^2.0.3",
|
|
294249
|
-
eslint: "^8.27.0",
|
|
294250
|
-
"eslint-config-prettier": "^9.0.0",
|
|
294251
|
-
"eslint-plugin-async-await": "0.0.0",
|
|
294252
|
-
"eslint-plugin-markdown": "^5.0.0",
|
|
294253
|
-
"lint-staged": "^15.0.1",
|
|
294254
|
-
poku: "^2.0.0",
|
|
294255
|
-
portfinder: "^1.0.28",
|
|
294256
|
-
prettier: "^3.0.0",
|
|
294257
|
-
progress: "^2.0.3",
|
|
294258
|
-
typescript: "^5.0.2"
|
|
294259
|
-
};
|
|
293384
|
+
}var version$1 = "3.11.3";
|
|
294260
293385
|
var require$$3 = {
|
|
294261
|
-
|
|
294262
|
-
version: version$1,
|
|
294263
|
-
description: description,
|
|
294264
|
-
main: main$1,
|
|
294265
|
-
typings: typings,
|
|
294266
|
-
scripts: scripts$1,
|
|
294267
|
-
"lint-staged": {
|
|
294268
|
-
"*.js": [
|
|
294269
|
-
"prettier --single-quote --trailing-comma none --write",
|
|
294270
|
-
"git add"
|
|
294271
|
-
]
|
|
294272
|
-
},
|
|
294273
|
-
repository: repository$1,
|
|
294274
|
-
homepage: homepage$1,
|
|
294275
|
-
keywords: keywords$1,
|
|
294276
|
-
files: files$1,
|
|
294277
|
-
exports: exports$1,
|
|
294278
|
-
engines: engines$1,
|
|
294279
|
-
author: author,
|
|
294280
|
-
license: license$1,
|
|
294281
|
-
dependencies: dependencies$1,
|
|
294282
|
-
devDependencies: devDependencies$1
|
|
294283
|
-
};var ssl_profiles = {};var lib$3 = {exports: {}};var defaults$1 = {};var hasRequiredDefaults$1;
|
|
293386
|
+
version: version$1};var ssl_profiles = {};var lib$3 = {exports: {}};var defaults$1 = {};var hasRequiredDefaults$1;
|
|
294284
293387
|
|
|
294285
293388
|
function requireDefaults$1 () {
|
|
294286
293389
|
if (hasRequiredDefaults$1) return defaults$1;
|
|
@@ -297618,7 +296721,7 @@ function requirePromise$1 () {
|
|
|
297618
296721
|
(function (exports) {
|
|
297619
296722
|
|
|
297620
296723
|
const core = requireMysql2();
|
|
297621
|
-
const EventEmitter = require$$0$
|
|
296724
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
297622
296725
|
const parserCache = requireParser_cache();
|
|
297623
296726
|
|
|
297624
296727
|
function makeDoneCb(resolve, reject, localErr) {
|
|
@@ -299625,10 +298728,10 @@ function requireConnection$1 () {
|
|
|
299625
298728
|
if (hasRequiredConnection$1) return connection$1;
|
|
299626
298729
|
hasRequiredConnection$1 = 1;
|
|
299627
298730
|
|
|
299628
|
-
const Net = require$$0$
|
|
298731
|
+
const Net = require$$0$8;
|
|
299629
298732
|
const Tls = require$$1$1;
|
|
299630
298733
|
const Timers = require$$1$7;
|
|
299631
|
-
const EventEmitter = require$$0$
|
|
298734
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
299632
298735
|
const Readable = require$$0$b.Readable;
|
|
299633
298736
|
const Queue = requireDenque();
|
|
299634
298737
|
const SqlString = requireSqlstring();
|
|
@@ -300642,7 +299745,7 @@ function requirePool$1 () {
|
|
|
300642
299745
|
const process = require$$0$o;
|
|
300643
299746
|
const mysql = requireMysql2();
|
|
300644
299747
|
|
|
300645
|
-
const EventEmitter = require$$0$
|
|
299748
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
300646
299749
|
const PoolConnection = requirePool_connection();
|
|
300647
299750
|
const Queue = requireDenque();
|
|
300648
299751
|
const Connection = requireConnection$1();
|
|
@@ -300924,7 +300027,7 @@ function requirePool_cluster () {
|
|
|
300924
300027
|
const Pool = requirePool$1();
|
|
300925
300028
|
const PoolConfig = requirePool_config();
|
|
300926
300029
|
const Connection = requireConnection$1();
|
|
300927
|
-
const EventEmitter = require$$0$
|
|
300030
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
300928
300031
|
|
|
300929
300032
|
/**
|
|
300930
300033
|
* Selector
|
|
@@ -301208,8 +300311,8 @@ function requireServer () {
|
|
|
301208
300311
|
if (hasRequiredServer) return server;
|
|
301209
300312
|
hasRequiredServer = 1;
|
|
301210
300313
|
|
|
301211
|
-
const net = require$$0$
|
|
301212
|
-
const EventEmitter = require$$0$
|
|
300314
|
+
const net = require$$0$8;
|
|
300315
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
301213
300316
|
|
|
301214
300317
|
const Connection = requireConnection$1();
|
|
301215
300318
|
const ConnectionConfig = requireConnection_config();
|
|
@@ -302993,6 +302096,11 @@ function requireUtilsLegacy () {
|
|
|
302993
302096
|
return nodeCrypto.createHash('sha256').update(text).digest()
|
|
302994
302097
|
}
|
|
302995
302098
|
|
|
302099
|
+
function hashByName(hashName, text) {
|
|
302100
|
+
hashName = hashName.replace(/(\D)-/, '$1'); // e.g. SHA-256 -> SHA256
|
|
302101
|
+
return nodeCrypto.createHash(hashName).update(text).digest()
|
|
302102
|
+
}
|
|
302103
|
+
|
|
302996
302104
|
function hmacSha256(key, msg) {
|
|
302997
302105
|
return nodeCrypto.createHmac('sha256', key).update(msg).digest()
|
|
302998
302106
|
}
|
|
@@ -303006,6 +302114,7 @@ function requireUtilsLegacy () {
|
|
|
303006
302114
|
randomBytes: nodeCrypto.randomBytes,
|
|
303007
302115
|
deriveKey,
|
|
303008
302116
|
sha256,
|
|
302117
|
+
hashByName,
|
|
303009
302118
|
hmacSha256,
|
|
303010
302119
|
md5,
|
|
303011
302120
|
};
|
|
@@ -303023,6 +302132,7 @@ function requireUtilsWebcrypto () {
|
|
|
303023
302132
|
randomBytes,
|
|
303024
302133
|
deriveKey,
|
|
303025
302134
|
sha256,
|
|
302135
|
+
hashByName,
|
|
303026
302136
|
hmacSha256,
|
|
303027
302137
|
md5,
|
|
303028
302138
|
};
|
|
@@ -303031,6 +302141,7 @@ function requireUtilsWebcrypto () {
|
|
|
303031
302141
|
* The Web Crypto API - grabbed from the Node.js library or the global
|
|
303032
302142
|
* @type Crypto
|
|
303033
302143
|
*/
|
|
302144
|
+
// eslint-disable-next-line no-undef
|
|
303034
302145
|
const webCrypto = nodeCrypto.webcrypto || globalThis.crypto;
|
|
303035
302146
|
/**
|
|
303036
302147
|
* The SubtleCrypto API for low level crypto operations.
|
|
@@ -303078,6 +302189,10 @@ function requireUtilsWebcrypto () {
|
|
|
303078
302189
|
return await subtleCrypto.digest('SHA-256', text)
|
|
303079
302190
|
}
|
|
303080
302191
|
|
|
302192
|
+
async function hashByName(hashName, text) {
|
|
302193
|
+
return await subtleCrypto.digest(hashName, text)
|
|
302194
|
+
}
|
|
302195
|
+
|
|
303081
302196
|
/**
|
|
303082
302197
|
* Sign the message with the given key
|
|
303083
302198
|
* @param {ArrayBuffer} keyBuffer
|
|
@@ -303114,6 +302229,135 @@ function requireUtils$2 () {
|
|
|
303114
302229
|
utils$2.exports = requireUtilsWebcrypto();
|
|
303115
302230
|
}
|
|
303116
302231
|
return utils$2.exports;
|
|
302232
|
+
}var certSignatures;
|
|
302233
|
+
var hasRequiredCertSignatures;
|
|
302234
|
+
|
|
302235
|
+
function requireCertSignatures () {
|
|
302236
|
+
if (hasRequiredCertSignatures) return certSignatures;
|
|
302237
|
+
hasRequiredCertSignatures = 1;
|
|
302238
|
+
function x509Error(msg, cert) {
|
|
302239
|
+
return new Error('SASL channel binding: ' + msg + ' when parsing public certificate ' + cert.toString('base64'))
|
|
302240
|
+
}
|
|
302241
|
+
|
|
302242
|
+
function readASN1Length(data, index) {
|
|
302243
|
+
let length = data[index++];
|
|
302244
|
+
if (length < 0x80) return { length, index }
|
|
302245
|
+
|
|
302246
|
+
const lengthBytes = length & 0x7f;
|
|
302247
|
+
if (lengthBytes > 4) throw x509Error('bad length', data)
|
|
302248
|
+
|
|
302249
|
+
length = 0;
|
|
302250
|
+
for (let i = 0; i < lengthBytes; i++) {
|
|
302251
|
+
length = (length << 8) | data[index++];
|
|
302252
|
+
}
|
|
302253
|
+
|
|
302254
|
+
return { length, index }
|
|
302255
|
+
}
|
|
302256
|
+
|
|
302257
|
+
function readASN1OID(data, index) {
|
|
302258
|
+
if (data[index++] !== 0x6) throw x509Error('non-OID data', data) // 6 = OID
|
|
302259
|
+
|
|
302260
|
+
const { length: OIDLength, index: indexAfterOIDLength } = readASN1Length(data, index);
|
|
302261
|
+
index = indexAfterOIDLength;
|
|
302262
|
+
let lastIndex = index + OIDLength;
|
|
302263
|
+
|
|
302264
|
+
const byte1 = data[index++];
|
|
302265
|
+
let oid = ((byte1 / 40) >> 0) + '.' + (byte1 % 40);
|
|
302266
|
+
|
|
302267
|
+
while (index < lastIndex) {
|
|
302268
|
+
// loop over numbers in OID
|
|
302269
|
+
let value = 0;
|
|
302270
|
+
while (index < lastIndex) {
|
|
302271
|
+
// loop over bytes in number
|
|
302272
|
+
const nextByte = data[index++];
|
|
302273
|
+
value = (value << 7) | (nextByte & 0x7f);
|
|
302274
|
+
if (nextByte < 0x80) break
|
|
302275
|
+
}
|
|
302276
|
+
oid += '.' + value;
|
|
302277
|
+
}
|
|
302278
|
+
|
|
302279
|
+
return { oid, index }
|
|
302280
|
+
}
|
|
302281
|
+
|
|
302282
|
+
function expectASN1Seq(data, index) {
|
|
302283
|
+
if (data[index++] !== 0x30) throw x509Error('non-sequence data', data) // 30 = Sequence
|
|
302284
|
+
return readASN1Length(data, index)
|
|
302285
|
+
}
|
|
302286
|
+
|
|
302287
|
+
function signatureAlgorithmHashFromCertificate(data, index) {
|
|
302288
|
+
// read this thread: https://www.postgresql.org/message-id/17760-b6c61e752ec07060%40postgresql.org
|
|
302289
|
+
if (index === undefined) index = 0;
|
|
302290
|
+
index = expectASN1Seq(data, index).index;
|
|
302291
|
+
const { length: certInfoLength, index: indexAfterCertInfoLength } = expectASN1Seq(data, index);
|
|
302292
|
+
index = indexAfterCertInfoLength + certInfoLength; // skip over certificate info
|
|
302293
|
+
index = expectASN1Seq(data, index).index; // skip over signature length field
|
|
302294
|
+
const { oid, index: indexAfterOID } = readASN1OID(data, index);
|
|
302295
|
+
switch (oid) {
|
|
302296
|
+
// RSA
|
|
302297
|
+
case '1.2.840.113549.1.1.4':
|
|
302298
|
+
return 'MD5'
|
|
302299
|
+
case '1.2.840.113549.1.1.5':
|
|
302300
|
+
return 'SHA-1'
|
|
302301
|
+
case '1.2.840.113549.1.1.11':
|
|
302302
|
+
return 'SHA-256'
|
|
302303
|
+
case '1.2.840.113549.1.1.12':
|
|
302304
|
+
return 'SHA-384'
|
|
302305
|
+
case '1.2.840.113549.1.1.13':
|
|
302306
|
+
return 'SHA-512'
|
|
302307
|
+
case '1.2.840.113549.1.1.14':
|
|
302308
|
+
return 'SHA-224'
|
|
302309
|
+
case '1.2.840.113549.1.1.15':
|
|
302310
|
+
return 'SHA512-224'
|
|
302311
|
+
case '1.2.840.113549.1.1.16':
|
|
302312
|
+
return 'SHA512-256'
|
|
302313
|
+
// ECDSA
|
|
302314
|
+
case '1.2.840.10045.4.1':
|
|
302315
|
+
return 'SHA-1'
|
|
302316
|
+
case '1.2.840.10045.4.3.1':
|
|
302317
|
+
return 'SHA-224'
|
|
302318
|
+
case '1.2.840.10045.4.3.2':
|
|
302319
|
+
return 'SHA-256'
|
|
302320
|
+
case '1.2.840.10045.4.3.3':
|
|
302321
|
+
return 'SHA-384'
|
|
302322
|
+
case '1.2.840.10045.4.3.4':
|
|
302323
|
+
return 'SHA-512'
|
|
302324
|
+
// RSASSA-PSS: hash is indicated separately
|
|
302325
|
+
case '1.2.840.113549.1.1.10': {
|
|
302326
|
+
index = indexAfterOID;
|
|
302327
|
+
index = expectASN1Seq(data, index).index;
|
|
302328
|
+
if (data[index++] !== 0xa0) throw x509Error('non-tag data', data) // a0 = constructed tag 0
|
|
302329
|
+
index = readASN1Length(data, index).index; // skip over tag length field
|
|
302330
|
+
index = expectASN1Seq(data, index).index; // skip over sequence length field
|
|
302331
|
+
const { oid: hashOID } = readASN1OID(data, index);
|
|
302332
|
+
switch (hashOID) {
|
|
302333
|
+
// standalone hash OIDs
|
|
302334
|
+
case '1.2.840.113549.2.5':
|
|
302335
|
+
return 'MD5'
|
|
302336
|
+
case '1.3.14.3.2.26':
|
|
302337
|
+
return 'SHA-1'
|
|
302338
|
+
case '2.16.840.1.101.3.4.2.1':
|
|
302339
|
+
return 'SHA-256'
|
|
302340
|
+
case '2.16.840.1.101.3.4.2.2':
|
|
302341
|
+
return 'SHA-384'
|
|
302342
|
+
case '2.16.840.1.101.3.4.2.3':
|
|
302343
|
+
return 'SHA-512'
|
|
302344
|
+
}
|
|
302345
|
+
throw x509Error('unknown hash OID ' + hashOID, data)
|
|
302346
|
+
}
|
|
302347
|
+
// Ed25519 -- see https: return//github.com/openssl/openssl/issues/15477
|
|
302348
|
+
case '1.3.101.110':
|
|
302349
|
+
case '1.3.101.112': // ph
|
|
302350
|
+
return 'SHA-512'
|
|
302351
|
+
// Ed448 -- still not in pg 17.2 (if supported, digest would be SHAKE256 x 64 bytes)
|
|
302352
|
+
case '1.3.101.111':
|
|
302353
|
+
case '1.3.101.113': // ph
|
|
302354
|
+
throw x509Error('Ed448 certificate channel binding is not currently supported by Postgres')
|
|
302355
|
+
}
|
|
302356
|
+
throw x509Error('unknown OID ' + oid, data)
|
|
302357
|
+
}
|
|
302358
|
+
|
|
302359
|
+
certSignatures = { signatureAlgorithmHashFromCertificate };
|
|
302360
|
+
return certSignatures;
|
|
303117
302361
|
}var sasl;
|
|
303118
302362
|
var hasRequiredSasl;
|
|
303119
302363
|
|
|
@@ -303121,23 +302365,35 @@ function requireSasl () {
|
|
|
303121
302365
|
if (hasRequiredSasl) return sasl;
|
|
303122
302366
|
hasRequiredSasl = 1;
|
|
303123
302367
|
const crypto = requireUtils$2();
|
|
302368
|
+
const { signatureAlgorithmHashFromCertificate } = requireCertSignatures();
|
|
302369
|
+
|
|
302370
|
+
function startSession(mechanisms, stream) {
|
|
302371
|
+
const candidates = ['SCRAM-SHA-256'];
|
|
302372
|
+
if (stream) candidates.unshift('SCRAM-SHA-256-PLUS'); // higher-priority, so placed first
|
|
303124
302373
|
|
|
303125
|
-
|
|
303126
|
-
|
|
303127
|
-
|
|
302374
|
+
const mechanism = candidates.find((candidate) => mechanisms.includes(candidate));
|
|
302375
|
+
|
|
302376
|
+
if (!mechanism) {
|
|
302377
|
+
throw new Error('SASL: Only mechanism(s) ' + candidates.join(' and ') + ' are supported')
|
|
302378
|
+
}
|
|
302379
|
+
|
|
302380
|
+
if (mechanism === 'SCRAM-SHA-256-PLUS' && typeof stream.getPeerCertificate !== 'function') {
|
|
302381
|
+
// this should never happen if we are really talking to a Postgres server
|
|
302382
|
+
throw new Error('SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate')
|
|
303128
302383
|
}
|
|
303129
302384
|
|
|
303130
302385
|
const clientNonce = crypto.randomBytes(18).toString('base64');
|
|
302386
|
+
const gs2Header = mechanism === 'SCRAM-SHA-256-PLUS' ? 'p=tls-server-end-point' : stream ? 'y' : 'n';
|
|
303131
302387
|
|
|
303132
302388
|
return {
|
|
303133
|
-
mechanism
|
|
302389
|
+
mechanism,
|
|
303134
302390
|
clientNonce,
|
|
303135
|
-
response: '
|
|
302391
|
+
response: gs2Header + ',,n=*,r=' + clientNonce,
|
|
303136
302392
|
message: 'SASLInitialResponse',
|
|
303137
302393
|
}
|
|
303138
302394
|
}
|
|
303139
302395
|
|
|
303140
|
-
async function continueSession(session, password, serverData) {
|
|
302396
|
+
async function continueSession(session, password, serverData, stream) {
|
|
303141
302397
|
if (session.message !== 'SASLInitialResponse') {
|
|
303142
302398
|
throw new Error('SASL: Last message was not SASLInitialResponse')
|
|
303143
302399
|
}
|
|
@@ -303161,7 +302417,21 @@ function requireSasl () {
|
|
|
303161
302417
|
|
|
303162
302418
|
var clientFirstMessageBare = 'n=*,r=' + session.clientNonce;
|
|
303163
302419
|
var serverFirstMessage = 'r=' + sv.nonce + ',s=' + sv.salt + ',i=' + sv.iteration;
|
|
303164
|
-
|
|
302420
|
+
|
|
302421
|
+
// without channel binding:
|
|
302422
|
+
let channelBinding = stream ? 'eSws' : 'biws'; // 'y,,' or 'n,,', base64-encoded
|
|
302423
|
+
|
|
302424
|
+
// override if channel binding is in use:
|
|
302425
|
+
if (session.mechanism === 'SCRAM-SHA-256-PLUS') {
|
|
302426
|
+
const peerCert = stream.getPeerCertificate().raw;
|
|
302427
|
+
let hashName = signatureAlgorithmHashFromCertificate(peerCert);
|
|
302428
|
+
if (hashName === 'MD5' || hashName === 'SHA-1') hashName = 'SHA-256';
|
|
302429
|
+
const certHash = await crypto.hashByName(hashName, peerCert);
|
|
302430
|
+
const bindingData = Buffer.concat([Buffer.from('p=tls-server-end-point,,'), Buffer.from(certHash)]);
|
|
302431
|
+
channelBinding = bindingData.toString('base64');
|
|
302432
|
+
}
|
|
302433
|
+
|
|
302434
|
+
var clientFinalMessageWithoutProof = 'c=' + channelBinding + ',r=' + sv.nonce;
|
|
303165
302435
|
var authMessage = clientFirstMessageBare + ',' + serverFirstMessage + ',' + clientFinalMessageWithoutProof;
|
|
303166
302436
|
|
|
303167
302437
|
var saltBytes = Buffer.from(sv.salt, 'base64');
|
|
@@ -303359,7 +302629,7 @@ function requirePgConnectionString () {
|
|
|
303359
302629
|
//MIT License
|
|
303360
302630
|
|
|
303361
302631
|
//parses a connection string
|
|
303362
|
-
function parse(str) {
|
|
302632
|
+
function parse(str, options = {}) {
|
|
303363
302633
|
//unix socket
|
|
303364
302634
|
if (str.charAt(0) === '/') {
|
|
303365
302635
|
const config = str.split(' ');
|
|
@@ -303373,7 +302643,7 @@ function requirePgConnectionString () {
|
|
|
303373
302643
|
let dummyHost = false;
|
|
303374
302644
|
if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) {
|
|
303375
302645
|
// Ensure spaces are encoded as %20
|
|
303376
|
-
str = encodeURI(str).replace(
|
|
302646
|
+
str = encodeURI(str).replace(/%25(\d\d)/g, '%$1');
|
|
303377
302647
|
}
|
|
303378
302648
|
|
|
303379
302649
|
try {
|
|
@@ -303441,29 +302711,126 @@ function requirePgConnectionString () {
|
|
|
303441
302711
|
config.ssl.ca = fs.readFileSync(config.sslrootcert).toString();
|
|
303442
302712
|
}
|
|
303443
302713
|
|
|
303444
|
-
|
|
303445
|
-
|
|
303446
|
-
|
|
303447
|
-
|
|
303448
|
-
|
|
303449
|
-
|
|
303450
|
-
|
|
303451
|
-
|
|
303452
|
-
|
|
303453
|
-
|
|
302714
|
+
if (options.useLibpqCompat && config.uselibpqcompat) {
|
|
302715
|
+
throw new Error('Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.')
|
|
302716
|
+
}
|
|
302717
|
+
|
|
302718
|
+
if (config.uselibpqcompat === 'true' || options.useLibpqCompat) {
|
|
302719
|
+
switch (config.sslmode) {
|
|
302720
|
+
case 'disable': {
|
|
302721
|
+
config.ssl = false;
|
|
302722
|
+
break
|
|
302723
|
+
}
|
|
302724
|
+
case 'prefer': {
|
|
302725
|
+
config.ssl.rejectUnauthorized = false;
|
|
302726
|
+
break
|
|
302727
|
+
}
|
|
302728
|
+
case 'require': {
|
|
302729
|
+
if (config.sslrootcert) {
|
|
302730
|
+
// If a root CA is specified, behavior of `sslmode=require` will be the same as that of `verify-ca`
|
|
302731
|
+
config.ssl.checkServerIdentity = function () {};
|
|
302732
|
+
} else {
|
|
302733
|
+
config.ssl.rejectUnauthorized = false;
|
|
302734
|
+
}
|
|
302735
|
+
break
|
|
302736
|
+
}
|
|
302737
|
+
case 'verify-ca': {
|
|
302738
|
+
if (!config.ssl.ca) {
|
|
302739
|
+
throw new Error(
|
|
302740
|
+
'SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.'
|
|
302741
|
+
)
|
|
302742
|
+
}
|
|
302743
|
+
config.ssl.checkServerIdentity = function () {};
|
|
302744
|
+
break
|
|
302745
|
+
}
|
|
303454
302746
|
}
|
|
303455
|
-
|
|
303456
|
-
|
|
303457
|
-
|
|
302747
|
+
} else {
|
|
302748
|
+
switch (config.sslmode) {
|
|
302749
|
+
case 'disable': {
|
|
302750
|
+
config.ssl = false;
|
|
302751
|
+
break
|
|
302752
|
+
}
|
|
302753
|
+
case 'prefer':
|
|
302754
|
+
case 'require':
|
|
302755
|
+
case 'verify-ca':
|
|
302756
|
+
case 'verify-full': {
|
|
302757
|
+
break
|
|
302758
|
+
}
|
|
302759
|
+
case 'no-verify': {
|
|
302760
|
+
config.ssl.rejectUnauthorized = false;
|
|
302761
|
+
break
|
|
302762
|
+
}
|
|
303458
302763
|
}
|
|
303459
302764
|
}
|
|
303460
302765
|
|
|
303461
302766
|
return config
|
|
303462
302767
|
}
|
|
303463
302768
|
|
|
302769
|
+
// convert pg-connection-string ssl config to a ClientConfig.ConnectionOptions
|
|
302770
|
+
function toConnectionOptions(sslConfig) {
|
|
302771
|
+
const connectionOptions = Object.entries(sslConfig).reduce((c, [key, value]) => {
|
|
302772
|
+
// we explicitly check for undefined and null instead of `if (value)` because some
|
|
302773
|
+
// options accept falsy values. Example: `ssl.rejectUnauthorized = false`
|
|
302774
|
+
if (value !== undefined && value !== null) {
|
|
302775
|
+
c[key] = value;
|
|
302776
|
+
}
|
|
302777
|
+
|
|
302778
|
+
return c
|
|
302779
|
+
}, {});
|
|
302780
|
+
|
|
302781
|
+
return connectionOptions
|
|
302782
|
+
}
|
|
302783
|
+
|
|
302784
|
+
// convert pg-connection-string config to a ClientConfig
|
|
302785
|
+
function toClientConfig(config) {
|
|
302786
|
+
const poolConfig = Object.entries(config).reduce((c, [key, value]) => {
|
|
302787
|
+
if (key === 'ssl') {
|
|
302788
|
+
const sslConfig = value;
|
|
302789
|
+
|
|
302790
|
+
if (typeof sslConfig === 'boolean') {
|
|
302791
|
+
c[key] = sslConfig;
|
|
302792
|
+
}
|
|
302793
|
+
// else path is taken. multiple tests produce a sslConfig that is an object
|
|
302794
|
+
// and we can console.log to see that we take this path
|
|
302795
|
+
//
|
|
302796
|
+
// see https://github.com/istanbuljs/babel-plugin-istanbul/issues/186#issuecomment-1137765139
|
|
302797
|
+
// istanbul ignore else
|
|
302798
|
+
else if (typeof sslConfig === 'object') {
|
|
302799
|
+
c[key] = toConnectionOptions(sslConfig);
|
|
302800
|
+
}
|
|
302801
|
+
} else if (value !== undefined && value !== null) {
|
|
302802
|
+
if (key === 'port') {
|
|
302803
|
+
// when port is not specified, it is converted into an empty string
|
|
302804
|
+
// we want to avoid NaN or empty string as a values in ClientConfig
|
|
302805
|
+
if (value !== '') {
|
|
302806
|
+
const v = parseInt(value, 10);
|
|
302807
|
+
if (isNaN(v)) {
|
|
302808
|
+
throw new Error(`Invalid ${key}: ${value}`)
|
|
302809
|
+
}
|
|
302810
|
+
|
|
302811
|
+
c[key] = v;
|
|
302812
|
+
}
|
|
302813
|
+
} else {
|
|
302814
|
+
c[key] = value;
|
|
302815
|
+
}
|
|
302816
|
+
}
|
|
302817
|
+
|
|
302818
|
+
return c
|
|
302819
|
+
}, {});
|
|
302820
|
+
|
|
302821
|
+
return poolConfig
|
|
302822
|
+
}
|
|
302823
|
+
|
|
302824
|
+
// parses a connection string into ClientConfig
|
|
302825
|
+
function parseIntoClientConfig(str) {
|
|
302826
|
+
return toClientConfig(parse(str))
|
|
302827
|
+
}
|
|
302828
|
+
|
|
303464
302829
|
pgConnectionString = parse;
|
|
303465
302830
|
|
|
303466
302831
|
parse.parse = parse;
|
|
302832
|
+
parse.toClientConfig = toClientConfig;
|
|
302833
|
+
parse.parseIntoClientConfig = parseIntoClientConfig;
|
|
303467
302834
|
return pgConnectionString;
|
|
303468
302835
|
}var connectionParameters;
|
|
303469
302836
|
var hasRequiredConnectionParameters;
|
|
@@ -303757,7 +303124,7 @@ function requireQuery$1 () {
|
|
|
303757
303124
|
if (hasRequiredQuery$1) return query$1;
|
|
303758
303125
|
hasRequiredQuery$1 = 1;
|
|
303759
303126
|
|
|
303760
|
-
const { EventEmitter } = require$$0$
|
|
303127
|
+
const { EventEmitter } = require$$0$7;
|
|
303761
303128
|
|
|
303762
303129
|
const Result = requireResult();
|
|
303763
303130
|
const utils = requireUtils$3();
|
|
@@ -303918,7 +303285,21 @@ function requireQuery$1 () {
|
|
|
303918
303285
|
return new Error('Query values must be an array')
|
|
303919
303286
|
}
|
|
303920
303287
|
if (this.requiresPreparation()) {
|
|
303921
|
-
|
|
303288
|
+
// If we're using the extended query protocol we fire off several separate commands
|
|
303289
|
+
// to the backend. On some versions of node & some operating system versions
|
|
303290
|
+
// the network stack writes each message separately instead of buffering them together
|
|
303291
|
+
// causing the client & network to send more slowly. Corking & uncorking the stream
|
|
303292
|
+
// allows node to buffer up the messages internally before sending them all off at once.
|
|
303293
|
+
// note: we're checking for existence of cork/uncork because some versions of streams
|
|
303294
|
+
// might not have this (cloudflare?)
|
|
303295
|
+
connection.stream.cork && connection.stream.cork();
|
|
303296
|
+
try {
|
|
303297
|
+
this.prepare(connection);
|
|
303298
|
+
} finally {
|
|
303299
|
+
// while unlikely for this.prepare to throw, if it does & we don't uncork this stream
|
|
303300
|
+
// this client becomes unresponsive, so put in finally block "just in case"
|
|
303301
|
+
connection.stream.uncork && connection.stream.uncork();
|
|
303302
|
+
}
|
|
303922
303303
|
} else {
|
|
303923
303304
|
connection.query(this.text);
|
|
303924
303305
|
}
|
|
@@ -303995,7 +303376,7 @@ function requireQuery$1 () {
|
|
|
303995
303376
|
|
|
303996
303377
|
query$1 = Query;
|
|
303997
303378
|
return query$1;
|
|
303998
|
-
}var dist$
|
|
303379
|
+
}var dist$8 = {};var messages = {};var hasRequiredMessages;
|
|
303999
303380
|
|
|
304000
303381
|
function requireMessages () {
|
|
304001
303382
|
if (hasRequiredMessages) return messages;
|
|
@@ -304487,6 +303868,7 @@ function requireBufferReader () {
|
|
|
304487
303868
|
cstring() {
|
|
304488
303869
|
const start = this.offset;
|
|
304489
303870
|
let end = start;
|
|
303871
|
+
// eslint-disable-next-line no-empty
|
|
304490
303872
|
while (this.buffer[end++] !== 0) { }
|
|
304491
303873
|
this.offset = end;
|
|
304492
303874
|
return this.buffer.toString(this.encoding, start, end - 1);
|
|
@@ -304754,15 +304136,17 @@ function requireParser () {
|
|
|
304754
304136
|
}
|
|
304755
304137
|
break;
|
|
304756
304138
|
case 10: // AuthenticationSASL
|
|
304757
|
-
|
|
304758
|
-
|
|
304759
|
-
|
|
304760
|
-
|
|
304761
|
-
|
|
304762
|
-
|
|
304763
|
-
|
|
304764
|
-
|
|
304765
|
-
|
|
304139
|
+
{
|
|
304140
|
+
message.name = 'authenticationSASL';
|
|
304141
|
+
message.mechanisms = [];
|
|
304142
|
+
let mechanism;
|
|
304143
|
+
do {
|
|
304144
|
+
mechanism = this.reader.cstring();
|
|
304145
|
+
if (mechanism) {
|
|
304146
|
+
message.mechanisms.push(mechanism);
|
|
304147
|
+
}
|
|
304148
|
+
} while (mechanism);
|
|
304149
|
+
}
|
|
304766
304150
|
break;
|
|
304767
304151
|
case 11: // AuthenticationSASLContinue
|
|
304768
304152
|
message.name = 'authenticationSASLContinue';
|
|
@@ -304809,11 +304193,11 @@ function requireParser () {
|
|
|
304809
304193
|
parser.Parser = Parser;
|
|
304810
304194
|
|
|
304811
304195
|
return parser;
|
|
304812
|
-
}var hasRequiredDist$
|
|
304196
|
+
}var hasRequiredDist$8;
|
|
304813
304197
|
|
|
304814
|
-
function requireDist$
|
|
304815
|
-
if (hasRequiredDist$
|
|
304816
|
-
hasRequiredDist$
|
|
304198
|
+
function requireDist$8 () {
|
|
304199
|
+
if (hasRequiredDist$8) return dist$8;
|
|
304200
|
+
hasRequiredDist$8 = 1;
|
|
304817
304201
|
(function (exports) {
|
|
304818
304202
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
304819
304203
|
exports.DatabaseError = exports.serialize = exports.parse = void 0;
|
|
@@ -304829,11 +304213,166 @@ function requireDist$7 () {
|
|
|
304829
304213
|
}
|
|
304830
304214
|
exports.parse = parse;
|
|
304831
304215
|
|
|
304832
|
-
} (dist$
|
|
304216
|
+
} (dist$8));
|
|
304217
|
+
return dist$8;
|
|
304218
|
+
}var dist$7 = {};var hasRequiredDist$7;
|
|
304219
|
+
|
|
304220
|
+
function requireDist$7 () {
|
|
304221
|
+
if (hasRequiredDist$7) return dist$7;
|
|
304222
|
+
hasRequiredDist$7 = 1;
|
|
304223
|
+
Object.defineProperty(dist$7, "__esModule", { value: true });
|
|
304224
|
+
dist$7.CloudflareSocket = void 0;
|
|
304225
|
+
const events_1 = require$$0$7;
|
|
304226
|
+
/**
|
|
304227
|
+
* Wrapper around the Cloudflare built-in socket that can be used by the `Connection`.
|
|
304228
|
+
*/
|
|
304229
|
+
class CloudflareSocket extends events_1.EventEmitter {
|
|
304230
|
+
constructor(ssl) {
|
|
304231
|
+
super();
|
|
304232
|
+
this.ssl = ssl;
|
|
304233
|
+
this.writable = false;
|
|
304234
|
+
this.destroyed = false;
|
|
304235
|
+
this._upgrading = false;
|
|
304236
|
+
this._upgraded = false;
|
|
304237
|
+
this._cfSocket = null;
|
|
304238
|
+
this._cfWriter = null;
|
|
304239
|
+
this._cfReader = null;
|
|
304240
|
+
}
|
|
304241
|
+
setNoDelay() {
|
|
304242
|
+
return this;
|
|
304243
|
+
}
|
|
304244
|
+
setKeepAlive() {
|
|
304245
|
+
return this;
|
|
304246
|
+
}
|
|
304247
|
+
ref() {
|
|
304248
|
+
return this;
|
|
304249
|
+
}
|
|
304250
|
+
unref() {
|
|
304251
|
+
return this;
|
|
304252
|
+
}
|
|
304253
|
+
async connect(port, host, connectListener) {
|
|
304254
|
+
try {
|
|
304255
|
+
log('connecting');
|
|
304256
|
+
if (connectListener)
|
|
304257
|
+
this.once('connect', connectListener);
|
|
304258
|
+
const options = this.ssl ? { secureTransport: 'starttls' } : {};
|
|
304259
|
+
const mod = await import('cloudflare:sockets');
|
|
304260
|
+
const connect = mod.connect;
|
|
304261
|
+
this._cfSocket = connect(`${host}:${port}`, options);
|
|
304262
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
304263
|
+
this._addClosedHandler();
|
|
304264
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
304265
|
+
if (this.ssl) {
|
|
304266
|
+
this._listenOnce().catch((e) => this.emit('error', e));
|
|
304267
|
+
}
|
|
304268
|
+
else {
|
|
304269
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
304270
|
+
}
|
|
304271
|
+
await this._cfWriter.ready;
|
|
304272
|
+
log('socket ready');
|
|
304273
|
+
this.writable = true;
|
|
304274
|
+
this.emit('connect');
|
|
304275
|
+
return this;
|
|
304276
|
+
}
|
|
304277
|
+
catch (e) {
|
|
304278
|
+
this.emit('error', e);
|
|
304279
|
+
}
|
|
304280
|
+
}
|
|
304281
|
+
async _listen() {
|
|
304282
|
+
// eslint-disable-next-line no-constant-condition
|
|
304283
|
+
while (true) {
|
|
304284
|
+
log('awaiting receive from CF socket');
|
|
304285
|
+
const { done, value } = await this._cfReader.read();
|
|
304286
|
+
log('CF socket received:', done, value);
|
|
304287
|
+
if (done) {
|
|
304288
|
+
log('done');
|
|
304289
|
+
break;
|
|
304290
|
+
}
|
|
304291
|
+
this.emit('data', Buffer.from(value));
|
|
304292
|
+
}
|
|
304293
|
+
}
|
|
304294
|
+
async _listenOnce() {
|
|
304295
|
+
log('awaiting first receive from CF socket');
|
|
304296
|
+
const { done, value } = await this._cfReader.read();
|
|
304297
|
+
log('First CF socket received:', done, value);
|
|
304298
|
+
this.emit('data', Buffer.from(value));
|
|
304299
|
+
}
|
|
304300
|
+
write(data, encoding = 'utf8', callback = () => { }) {
|
|
304301
|
+
if (data.length === 0)
|
|
304302
|
+
return callback();
|
|
304303
|
+
if (typeof data === 'string')
|
|
304304
|
+
data = Buffer.from(data, encoding);
|
|
304305
|
+
log('sending data direct:', data);
|
|
304306
|
+
this._cfWriter.write(data).then(() => {
|
|
304307
|
+
log('data sent');
|
|
304308
|
+
callback();
|
|
304309
|
+
}, (err) => {
|
|
304310
|
+
log('send error', err);
|
|
304311
|
+
callback(err);
|
|
304312
|
+
});
|
|
304313
|
+
return true;
|
|
304314
|
+
}
|
|
304315
|
+
end(data = Buffer.alloc(0), encoding = 'utf8', callback = () => { }) {
|
|
304316
|
+
log('ending CF socket');
|
|
304317
|
+
this.write(data, encoding, (err) => {
|
|
304318
|
+
this._cfSocket.close();
|
|
304319
|
+
if (callback)
|
|
304320
|
+
callback(err);
|
|
304321
|
+
});
|
|
304322
|
+
return this;
|
|
304323
|
+
}
|
|
304324
|
+
destroy(reason) {
|
|
304325
|
+
log('destroying CF socket', reason);
|
|
304326
|
+
this.destroyed = true;
|
|
304327
|
+
return this.end();
|
|
304328
|
+
}
|
|
304329
|
+
startTls(options) {
|
|
304330
|
+
if (this._upgraded) {
|
|
304331
|
+
// Don't try to upgrade again.
|
|
304332
|
+
this.emit('error', 'Cannot call `startTls()` more than once on a socket');
|
|
304333
|
+
return;
|
|
304334
|
+
}
|
|
304335
|
+
this._cfWriter.releaseLock();
|
|
304336
|
+
this._cfReader.releaseLock();
|
|
304337
|
+
this._upgrading = true;
|
|
304338
|
+
this._cfSocket = this._cfSocket.startTls(options);
|
|
304339
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
304340
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
304341
|
+
this._addClosedHandler();
|
|
304342
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
304343
|
+
}
|
|
304344
|
+
_addClosedHandler() {
|
|
304345
|
+
this._cfSocket.closed.then(() => {
|
|
304346
|
+
if (!this._upgrading) {
|
|
304347
|
+
log('CF socket closed');
|
|
304348
|
+
this._cfSocket = null;
|
|
304349
|
+
this.emit('close');
|
|
304350
|
+
}
|
|
304351
|
+
else {
|
|
304352
|
+
this._upgrading = false;
|
|
304353
|
+
this._upgraded = true;
|
|
304354
|
+
}
|
|
304355
|
+
}).catch((e) => this.emit('error', e));
|
|
304356
|
+
}
|
|
304357
|
+
}
|
|
304358
|
+
dist$7.CloudflareSocket = CloudflareSocket;
|
|
304359
|
+
const debug = false;
|
|
304360
|
+
function dump(data) {
|
|
304361
|
+
if (data instanceof Uint8Array || data instanceof ArrayBuffer) {
|
|
304362
|
+
const hex = Buffer.from(data).toString('hex');
|
|
304363
|
+
const str = new TextDecoder().decode(data);
|
|
304364
|
+
return `\n>>> STR: "${str.replace(/\n/g, '\\n')}"\n>>> HEX: ${hex}\n`;
|
|
304365
|
+
}
|
|
304366
|
+
else {
|
|
304367
|
+
return data;
|
|
304368
|
+
}
|
|
304369
|
+
}
|
|
304370
|
+
function log(...args) {
|
|
304371
|
+
debug && console.log(...args.map(dump));
|
|
304372
|
+
}
|
|
304373
|
+
|
|
304833
304374
|
return dist$7;
|
|
304834
|
-
}
|
|
304835
|
-
// See the `exports` field in package.json
|
|
304836
|
-
var empty = {};var empty$1=/*#__PURE__*/Object.freeze({__proto__:null,default:empty});var require$$2 = /*@__PURE__*/getAugmentedNamespace(empty$1);var stream$2;
|
|
304375
|
+
}var stream$2;
|
|
304837
304376
|
var hasRequiredStream$1;
|
|
304838
304377
|
|
|
304839
304378
|
function requireStream$1 () {
|
|
@@ -304860,7 +304399,7 @@ function requireStream$1 () {
|
|
|
304860
304399
|
*/
|
|
304861
304400
|
function getNodejsStreamFuncs() {
|
|
304862
304401
|
function getStream(ssl) {
|
|
304863
|
-
const net = require$$0$
|
|
304402
|
+
const net = require$$0$8;
|
|
304864
304403
|
return new net.Socket()
|
|
304865
304404
|
}
|
|
304866
304405
|
|
|
@@ -304879,7 +304418,7 @@ function requireStream$1 () {
|
|
|
304879
304418
|
*/
|
|
304880
304419
|
function getCloudflareStreamFuncs() {
|
|
304881
304420
|
function getStream(ssl) {
|
|
304882
|
-
const { CloudflareSocket } =
|
|
304421
|
+
const { CloudflareSocket } = requireDist$7();
|
|
304883
304422
|
return new CloudflareSocket(ssl)
|
|
304884
304423
|
}
|
|
304885
304424
|
|
|
@@ -304901,7 +304440,9 @@ function requireStream$1 () {
|
|
|
304901
304440
|
function isCloudflareRuntime() {
|
|
304902
304441
|
// Since 2022-03-21 the `global_navigator` compatibility flag is on for Cloudflare Workers
|
|
304903
304442
|
// which means that `navigator.userAgent` will be defined.
|
|
304443
|
+
// eslint-disable-next-line no-undef
|
|
304904
304444
|
if (typeof navigator === 'object' && navigator !== null && typeof navigator.userAgent === 'string') {
|
|
304445
|
+
// eslint-disable-next-line no-undef
|
|
304905
304446
|
return navigator.userAgent === 'Cloudflare-Workers'
|
|
304906
304447
|
}
|
|
304907
304448
|
// In case `navigator` or `navigator.userAgent` is not defined then try a more sneaky approach
|
|
@@ -304928,9 +304469,9 @@ function requireConnection () {
|
|
|
304928
304469
|
if (hasRequiredConnection) return connection;
|
|
304929
304470
|
hasRequiredConnection = 1;
|
|
304930
304471
|
|
|
304931
|
-
var EventEmitter = require$$0$
|
|
304472
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
304932
304473
|
|
|
304933
|
-
const { parse, serialize } = requireDist$
|
|
304474
|
+
const { parse, serialize } = requireDist$8();
|
|
304934
304475
|
const { getStream, getSecureStream } = requireStream$1();
|
|
304935
304476
|
|
|
304936
304477
|
const flushBuffer = serialize.flush();
|
|
@@ -305019,7 +304560,7 @@ function requireConnection () {
|
|
|
305019
304560
|
}
|
|
305020
304561
|
}
|
|
305021
304562
|
|
|
305022
|
-
var net = require$$0$
|
|
304563
|
+
var net = require$$0$8;
|
|
305023
304564
|
if (net.isIP && net.isIP(host) === 0) {
|
|
305024
304565
|
options.servername = host;
|
|
305025
304566
|
}
|
|
@@ -305568,7 +305109,7 @@ function requireClient$2 () {
|
|
|
305568
305109
|
if (hasRequiredClient$2) return client$2;
|
|
305569
305110
|
hasRequiredClient$2 = 1;
|
|
305570
305111
|
|
|
305571
|
-
var EventEmitter = require$$0$
|
|
305112
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
305572
305113
|
var utils = requireUtils$3();
|
|
305573
305114
|
var sasl = requireSasl();
|
|
305574
305115
|
var TypeOverrides = requireTypeOverrides();
|
|
@@ -305611,6 +305152,7 @@ function requireClient$2 () {
|
|
|
305611
305152
|
this._connectionError = false;
|
|
305612
305153
|
this._queryable = true;
|
|
305613
305154
|
|
|
305155
|
+
this.enableChannelBinding = Boolean(c.enableChannelBinding); // set true to use SCRAM-SHA-256-PLUS when offered
|
|
305614
305156
|
this.connection =
|
|
305615
305157
|
c.connection ||
|
|
305616
305158
|
new Connection({
|
|
@@ -305672,6 +305214,10 @@ function requireClient$2 () {
|
|
|
305672
305214
|
con._ending = true;
|
|
305673
305215
|
con.stream.destroy(new Error('timeout expired'));
|
|
305674
305216
|
}, this._connectionTimeoutMillis);
|
|
305217
|
+
|
|
305218
|
+
if (this.connectionTimeoutHandle.unref) {
|
|
305219
|
+
this.connectionTimeoutHandle.unref();
|
|
305220
|
+
}
|
|
305675
305221
|
}
|
|
305676
305222
|
|
|
305677
305223
|
if (this.host && this.host.indexOf('/') === 0) {
|
|
@@ -305826,7 +305372,7 @@ function requireClient$2 () {
|
|
|
305826
305372
|
_handleAuthSASL(msg) {
|
|
305827
305373
|
this._checkPgPass(() => {
|
|
305828
305374
|
try {
|
|
305829
|
-
this.saslSession = sasl.startSession(msg.mechanisms);
|
|
305375
|
+
this.saslSession = sasl.startSession(msg.mechanisms, this.enableChannelBinding && this.connection.stream);
|
|
305830
305376
|
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response);
|
|
305831
305377
|
} catch (err) {
|
|
305832
305378
|
this.connection.emit('error', err);
|
|
@@ -305836,7 +305382,12 @@ function requireClient$2 () {
|
|
|
305836
305382
|
|
|
305837
305383
|
async _handleAuthSASLContinue(msg) {
|
|
305838
305384
|
try {
|
|
305839
|
-
await sasl.continueSession(
|
|
305385
|
+
await sasl.continueSession(
|
|
305386
|
+
this.saslSession,
|
|
305387
|
+
this.password,
|
|
305388
|
+
msg.data,
|
|
305389
|
+
this.enableChannelBinding && this.connection.stream
|
|
305390
|
+
);
|
|
305840
305391
|
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response);
|
|
305841
305392
|
} catch (err) {
|
|
305842
305393
|
this.connection.emit('error', err);
|
|
@@ -306213,7 +305764,7 @@ var hasRequiredPgPool;
|
|
|
306213
305764
|
function requirePgPool () {
|
|
306214
305765
|
if (hasRequiredPgPool) return pgPool;
|
|
306215
305766
|
hasRequiredPgPool = 1;
|
|
306216
|
-
const EventEmitter = require$$0$
|
|
305767
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
306217
305768
|
|
|
306218
305769
|
const NOOP = function () {};
|
|
306219
305770
|
|
|
@@ -306419,6 +305970,10 @@ function requirePgPool () {
|
|
|
306419
305970
|
response.callback(new Error('timeout exceeded when trying to connect'));
|
|
306420
305971
|
}, this.options.connectionTimeoutMillis);
|
|
306421
305972
|
|
|
305973
|
+
if (tid.unref) {
|
|
305974
|
+
tid.unref();
|
|
305975
|
+
}
|
|
305976
|
+
|
|
306422
305977
|
this._pendingQueue.push(pendingItem);
|
|
306423
305978
|
return result
|
|
306424
305979
|
}
|
|
@@ -306686,7 +306241,7 @@ function requireQuery () {
|
|
|
306686
306241
|
if (hasRequiredQuery) return query.exports;
|
|
306687
306242
|
hasRequiredQuery = 1;
|
|
306688
306243
|
|
|
306689
|
-
var EventEmitter = require$$0$
|
|
306244
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
306690
306245
|
var util = require$$0$6;
|
|
306691
306246
|
var utils = requireUtils$3();
|
|
306692
306247
|
|
|
@@ -306861,6 +306416,7 @@ function requireClient$1 () {
|
|
|
306861
306416
|
|
|
306862
306417
|
// eslint-disable-next-line
|
|
306863
306418
|
var Native;
|
|
306419
|
+
// eslint-disable-next-line no-useless-catch
|
|
306864
306420
|
try {
|
|
306865
306421
|
// Wrap this `require()` in a try-catch to avoid upstream bundlers from complaining that this might not be available since it is an optional import
|
|
306866
306422
|
Native = require('pg-native');
|
|
@@ -306868,7 +306424,7 @@ function requireClient$1 () {
|
|
|
306868
306424
|
throw e
|
|
306869
306425
|
}
|
|
306870
306426
|
var TypeOverrides = requireTypeOverrides();
|
|
306871
|
-
var EventEmitter = require$$0$
|
|
306427
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
306872
306428
|
var util = require$$0$6;
|
|
306873
306429
|
var ConnectionParameters = requireConnectionParameters();
|
|
306874
306430
|
|
|
@@ -307183,8 +306739,10 @@ function requireLib$1 () {
|
|
|
307183
306739
|
var Client = requireClient$2();
|
|
307184
306740
|
var defaults = requireDefaults();
|
|
307185
306741
|
var Connection = requireConnection();
|
|
306742
|
+
var Result = requireResult();
|
|
306743
|
+
var utils = requireUtils$3();
|
|
307186
306744
|
var Pool = requirePgPool();
|
|
307187
|
-
const { DatabaseError } = requireDist$
|
|
306745
|
+
const { DatabaseError } = requireDist$8();
|
|
307188
306746
|
const { escapeIdentifier, escapeLiteral } = requireUtils$3();
|
|
307189
306747
|
|
|
307190
306748
|
const poolFactory = (Client) => {
|
|
@@ -307206,6 +306764,8 @@ function requireLib$1 () {
|
|
|
307206
306764
|
this.DatabaseError = DatabaseError;
|
|
307207
306765
|
this.escapeIdentifier = escapeIdentifier;
|
|
307208
306766
|
this.escapeLiteral = escapeLiteral;
|
|
306767
|
+
this.Result = Result;
|
|
306768
|
+
this.utils = utils;
|
|
307209
306769
|
};
|
|
307210
306770
|
|
|
307211
306771
|
if (typeof process.env.NODE_PG_FORCE_NATIVE !== 'undefined') {
|
|
@@ -307238,7 +306798,21 @@ function requireLib$1 () {
|
|
|
307238
306798
|
}
|
|
307239
306799
|
} (lib$2));
|
|
307240
306800
|
return lib$2.exports;
|
|
307241
|
-
}var libExports = requireLib$1()
|
|
306801
|
+
}var libExports = requireLib$1();
|
|
306802
|
+
var pg = /*@__PURE__*/getDefaultExportFromCjs(libExports);// ESM wrapper for pg
|
|
306803
|
+
|
|
306804
|
+
// Re-export all the properties
|
|
306805
|
+
pg.Client;
|
|
306806
|
+
const Pool = pg.Pool;
|
|
306807
|
+
pg.Connection;
|
|
306808
|
+
pg.types;
|
|
306809
|
+
pg.Query;
|
|
306810
|
+
pg.DatabaseError;
|
|
306811
|
+
pg.escapeIdentifier;
|
|
306812
|
+
pg.escapeLiteral;
|
|
306813
|
+
|
|
306814
|
+
// Also export the defaults
|
|
306815
|
+
pg.defaults;/**
|
|
307242
306816
|
* 2011 Peter 'Pita' Martischka
|
|
307243
306817
|
*
|
|
307244
306818
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -307268,7 +306842,7 @@ class Postgres_db extends AbstractDatabase {
|
|
|
307268
306842
|
this.settings.max = this.settings.max || 20;
|
|
307269
306843
|
this.settings.min = this.settings.min || 4;
|
|
307270
306844
|
this.settings.idleTimeoutMillis = this.settings.idleTimeoutMillis || 1000;
|
|
307271
|
-
this.db = new
|
|
306845
|
+
this.db = new Pool(this.settings);
|
|
307272
306846
|
}
|
|
307273
306847
|
init(callback) {
|
|
307274
306848
|
const testTableExists = "SELECT 1 as exists FROM pg_tables WHERE tablename = 'store'";
|
|
@@ -315472,8 +315046,8 @@ function requireSocket () {
|
|
|
315472
315046
|
};
|
|
315473
315047
|
var _RedisSocket_instances, _a, _RedisSocket_initiateOptions, _RedisSocket_isTlsSocket, _RedisSocket_initiator, _RedisSocket_options, _RedisSocket_socket, _RedisSocket_isOpen, _RedisSocket_isReady, _RedisSocket_writableNeedDrain, _RedisSocket_isSocketUnrefed, _RedisSocket_reconnectStrategy, _RedisSocket_shouldReconnect, _RedisSocket_connect, _RedisSocket_createSocket, _RedisSocket_createNetSocket, _RedisSocket_createTlsSocket, _RedisSocket_onSocketError, _RedisSocket_disconnect, _RedisSocket_isCorked;
|
|
315474
315048
|
Object.defineProperty(socket, "__esModule", { value: true });
|
|
315475
|
-
const events_1 = require$$0$
|
|
315476
|
-
const net = require$$0$
|
|
315049
|
+
const events_1 = require$$0$7;
|
|
315050
|
+
const net = require$$0$8;
|
|
315477
315051
|
const tls = require$$1$1;
|
|
315478
315052
|
const errors_1 = requireErrors$3();
|
|
315479
315053
|
const utils_1 = requireUtils$1();
|
|
@@ -318311,7 +317885,7 @@ function requirePool () {
|
|
|
318311
317885
|
if (hasRequiredPool) return Pool_1;
|
|
318312
317886
|
hasRequiredPool = 1;
|
|
318313
317887
|
|
|
318314
|
-
const EventEmitter = require$$0$
|
|
317888
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
318315
317889
|
|
|
318316
317890
|
const factoryValidator = requireFactoryValidator();
|
|
318317
317891
|
const PoolOptions = requirePoolOptions();
|
|
@@ -319074,72 +318648,9 @@ function requireGenericPool () {
|
|
|
319074
318648
|
}
|
|
319075
318649
|
};
|
|
319076
318650
|
return genericPool;
|
|
319077
|
-
}var
|
|
319078
|
-
var version = "1.5.17";
|
|
319079
|
-
var license = "MIT";
|
|
319080
|
-
var main = "./dist/index.js";
|
|
319081
|
-
var types = "./dist/index.d.ts";
|
|
319082
|
-
var files = [
|
|
319083
|
-
"dist/"
|
|
319084
|
-
];
|
|
319085
|
-
var scripts = {
|
|
319086
|
-
test: "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'",
|
|
319087
|
-
build: "tsc",
|
|
319088
|
-
lint: "eslint ./*.ts ./lib/**/*.ts",
|
|
319089
|
-
documentation: "typedoc"
|
|
319090
|
-
};
|
|
319091
|
-
var dependencies = {
|
|
319092
|
-
"cluster-key-slot": "1.1.2",
|
|
319093
|
-
"generic-pool": "3.9.0",
|
|
319094
|
-
yallist: "4.0.0"
|
|
319095
|
-
};
|
|
319096
|
-
var devDependencies = {
|
|
319097
|
-
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
319098
|
-
"@redis/test-utils": "*",
|
|
319099
|
-
"@types/node": "^20.6.2",
|
|
319100
|
-
"@types/sinon": "^10.0.16",
|
|
319101
|
-
"@types/yallist": "^4.0.1",
|
|
319102
|
-
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
319103
|
-
"@typescript-eslint/parser": "^6.7.2",
|
|
319104
|
-
eslint: "^8.49.0",
|
|
319105
|
-
nyc: "^15.1.0",
|
|
319106
|
-
"release-it": "^16.1.5",
|
|
319107
|
-
sinon: "^16.0.0",
|
|
319108
|
-
"source-map-support": "^0.5.21",
|
|
319109
|
-
"ts-node": "^10.9.1",
|
|
319110
|
-
typedoc: "^0.25.1",
|
|
319111
|
-
typescript: "^5.2.2"
|
|
319112
|
-
};
|
|
319113
|
-
var engines = {
|
|
319114
|
-
node: ">=14"
|
|
319115
|
-
};
|
|
319116
|
-
var repository = {
|
|
319117
|
-
type: "git",
|
|
319118
|
-
url: "git://github.com/redis/node-redis.git"
|
|
319119
|
-
};
|
|
319120
|
-
var bugs = {
|
|
319121
|
-
url: "https://github.com/redis/node-redis/issues"
|
|
319122
|
-
};
|
|
319123
|
-
var homepage = "https://github.com/redis/node-redis/tree/master/packages/client";
|
|
319124
|
-
var keywords = [
|
|
319125
|
-
"redis"
|
|
319126
|
-
];
|
|
318651
|
+
}var version = "1.5.17";
|
|
319127
318652
|
var require$$11 = {
|
|
319128
|
-
|
|
319129
|
-
version: version,
|
|
319130
|
-
license: license,
|
|
319131
|
-
main: main,
|
|
319132
|
-
types: types,
|
|
319133
|
-
files: files,
|
|
319134
|
-
scripts: scripts,
|
|
319135
|
-
dependencies: dependencies,
|
|
319136
|
-
devDependencies: devDependencies,
|
|
319137
|
-
engines: engines,
|
|
319138
|
-
repository: repository,
|
|
319139
|
-
bugs: bugs,
|
|
319140
|
-
homepage: homepage,
|
|
319141
|
-
keywords: keywords
|
|
319142
|
-
};var hasRequiredClient;
|
|
318653
|
+
version: version};var hasRequiredClient;
|
|
319143
318654
|
|
|
319144
318655
|
function requireClient () {
|
|
319145
318656
|
if (hasRequiredClient) return client;
|
|
@@ -319161,7 +318672,7 @@ function requireClient () {
|
|
|
319161
318672
|
const socket_1 = requireSocket();
|
|
319162
318673
|
const commands_queue_1 = requireCommandsQueue();
|
|
319163
318674
|
const multi_command_1 = requireMultiCommand$1();
|
|
319164
|
-
const events_1 = require$$0$
|
|
318675
|
+
const events_1 = require$$0$7;
|
|
319165
318676
|
const command_options_1 = requireCommandOptions();
|
|
319166
318677
|
const commander_1 = requireCommander();
|
|
319167
318678
|
const generic_pool_1 = requireGenericPool();
|
|
@@ -320424,7 +319935,7 @@ function requireCluster () {
|
|
|
320424
319935
|
const commands_1 = requireCommands$6();
|
|
320425
319936
|
const cluster_slots_1 = requireClusterSlots();
|
|
320426
319937
|
const commander_1 = requireCommander();
|
|
320427
|
-
const events_1 = require$$0$
|
|
319938
|
+
const events_1 = require$$0$7;
|
|
320428
319939
|
const multi_command_1 = requireMultiCommand();
|
|
320429
319940
|
const errors_1 = requireErrors$3();
|
|
320430
319941
|
class RedisCluster extends events_1.EventEmitter {
|
|
@@ -327712,7 +327223,7 @@ function requireDebuggability () {
|
|
|
327712
327223
|
};
|
|
327713
327224
|
|
|
327714
327225
|
Promise.prototype._unsetUnhandledRejectionIsNotified = function () {
|
|
327715
|
-
this._bitField = this._bitField & (
|
|
327226
|
+
this._bitField = this._bitField & (-524289);
|
|
327716
327227
|
};
|
|
327717
327228
|
|
|
327718
327229
|
Promise.prototype._isUnhandledRejectionNotified = function () {
|
|
@@ -327724,7 +327235,7 @@ function requireDebuggability () {
|
|
|
327724
327235
|
};
|
|
327725
327236
|
|
|
327726
327237
|
Promise.prototype._unsetRejectionIsUnhandled = function () {
|
|
327727
|
-
this._bitField = this._bitField & (
|
|
327238
|
+
this._bitField = this._bitField & (-2097153);
|
|
327728
327239
|
if (this._isUnhandledRejectionNotified()) {
|
|
327729
327240
|
this._unsetUnhandledRejectionIsNotified();
|
|
327730
327241
|
this._notifyUnhandledRejectionIsHandled();
|
|
@@ -328257,7 +327768,7 @@ function requireBind () {
|
|
|
328257
327768
|
this._bitField = this._bitField | 131072;
|
|
328258
327769
|
this._boundTo = obj;
|
|
328259
327770
|
} else {
|
|
328260
|
-
this._bitField = this._bitField & (
|
|
327771
|
+
this._bitField = this._bitField & (-131073);
|
|
328261
327772
|
}
|
|
328262
327773
|
};
|
|
328263
327774
|
|
|
@@ -329066,7 +328577,7 @@ function requireUsing () {
|
|
|
329066
328577
|
};
|
|
329067
328578
|
|
|
329068
328579
|
Promise.prototype._unsetDisposable = function () {
|
|
329069
|
-
this._bitField = this._bitField & (
|
|
328580
|
+
this._bitField = this._bitField & (-262145);
|
|
329070
328581
|
this._disposer = undefined;
|
|
329071
328582
|
};
|
|
329072
328583
|
|
|
@@ -330630,7 +330141,7 @@ function requirePromise () {
|
|
|
330630
330141
|
};
|
|
330631
330142
|
|
|
330632
330143
|
Promise.prototype._unsetCancellable = function () {
|
|
330633
|
-
this._bitField = this._bitField & (
|
|
330144
|
+
this._bitField = this._bitField & (-67108865);
|
|
330634
330145
|
};
|
|
330635
330146
|
|
|
330636
330147
|
Promise.prototype._setIsMigrated = function () {
|
|
@@ -330638,7 +330149,7 @@ function requirePromise () {
|
|
|
330638
330149
|
};
|
|
330639
330150
|
|
|
330640
330151
|
Promise.prototype._unsetIsMigrated = function () {
|
|
330641
|
-
this._bitField = this._bitField & (
|
|
330152
|
+
this._bitField = this._bitField & (-4194305);
|
|
330642
330153
|
};
|
|
330643
330154
|
|
|
330644
330155
|
Promise.prototype._isMigrated = function () {
|
|
@@ -330969,7 +330480,7 @@ function requirePromise () {
|
|
|
330969
330480
|
};
|
|
330970
330481
|
|
|
330971
330482
|
Promise.prototype._unsetSettlePromisesQueued = function () {
|
|
330972
|
-
this._bitField = this._bitField & (
|
|
330483
|
+
this._bitField = this._bitField & (1073741823);
|
|
330973
330484
|
};
|
|
330974
330485
|
|
|
330975
330486
|
Promise.prototype._queueSettlePromises = function() {
|
|
@@ -331132,7 +330643,7 @@ function requireCursor () {
|
|
|
331132
330643
|
|
|
331133
330644
|
Promise = requireBluebird();
|
|
331134
330645
|
|
|
331135
|
-
EventEmitter = require$$0$
|
|
330646
|
+
EventEmitter = require$$0$7.EventEmitter;
|
|
331136
330647
|
|
|
331137
330648
|
ar = util.ar;
|
|
331138
330649
|
|
|
@@ -337105,11 +336616,11 @@ function requireNet () {
|
|
|
337105
336616
|
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
|
337106
336617
|
hasProp = {}.hasOwnProperty;
|
|
337107
336618
|
|
|
337108
|
-
net = require$$0$
|
|
336619
|
+
net = require$$0$8;
|
|
337109
336620
|
|
|
337110
336621
|
tls = require$$1$1;
|
|
337111
336622
|
|
|
337112
|
-
events = require$$0$
|
|
336623
|
+
events = require$$0$7;
|
|
337113
336624
|
|
|
337114
336625
|
util = requireUtil$1();
|
|
337115
336626
|
|
|
@@ -340792,6 +340303,8 @@ var hasRequiredSender;
|
|
|
340792
340303
|
function requireSender () {
|
|
340793
340304
|
if (hasRequiredSender) return sender$1;
|
|
340794
340305
|
hasRequiredSender = 1;
|
|
340306
|
+
|
|
340307
|
+
const { Duplex } = require$$0$b;
|
|
340795
340308
|
const { randomFillSync } = require$$0$a;
|
|
340796
340309
|
|
|
340797
340310
|
const PerMessageDeflate = requirePermessageDeflate();
|
|
@@ -341802,12 +341315,13 @@ function requireWebsocket () {
|
|
|
341802
341315
|
if (hasRequiredWebsocket) return websocket;
|
|
341803
341316
|
hasRequiredWebsocket = 1;
|
|
341804
341317
|
|
|
341805
|
-
const EventEmitter = require$$0$
|
|
341806
|
-
const https = require$$2$
|
|
341318
|
+
const EventEmitter = require$$0$7;
|
|
341319
|
+
const https = require$$2$2;
|
|
341807
341320
|
const http$1 = http;
|
|
341808
|
-
const net = require$$0$
|
|
341321
|
+
const net = require$$0$8;
|
|
341809
341322
|
const tls = require$$1$1;
|
|
341810
341323
|
const { randomBytes, createHash } = require$$0$a;
|
|
341324
|
+
const { Duplex, Readable } = require$$0$b;
|
|
341811
341325
|
const { URL } = require$$0$f;
|
|
341812
341326
|
|
|
341813
341327
|
const PerMessageDeflate = requirePermessageDeflate();
|
|
@@ -343214,8 +342728,9 @@ function requireWebsocketServer () {
|
|
|
343214
342728
|
if (hasRequiredWebsocketServer) return websocketServer$1;
|
|
343215
342729
|
hasRequiredWebsocketServer = 1;
|
|
343216
342730
|
|
|
343217
|
-
const EventEmitter = require$$0$
|
|
342731
|
+
const EventEmitter = require$$0$7;
|
|
343218
342732
|
const http$1 = http;
|
|
342733
|
+
const { Duplex } = require$$0$b;
|
|
343219
342734
|
const { createHash } = require$$0$a;
|
|
343220
342735
|
|
|
343221
342736
|
const extension = requireExtension();
|
|
@@ -343770,7 +343285,7 @@ var websocketServer = /*@__PURE__*/getDefaultExportFromCjs(websocketServerExport
|
|
|
343770
343285
|
return WebSocket$2;
|
|
343771
343286
|
return WebSocket_;
|
|
343772
343287
|
}
|
|
343773
|
-
})();var __defProp=Object.defineProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0});};var Emitter=class{collectable={};listeners={};interceptors;constructor({interceptors}={}){this.interceptors=interceptors??{};}subscribe(event,listener,historic=!1){if(this.listeners[event]||(this.listeners[event]=[]),!this.isSubscribed(event,listener)&&(this.listeners[event]?.push(listener),historic&&this.collectable[event])){let buffer=this.collectable[event];delete this.collectable[event];for(let args of buffer)listener(...args);}}async subscribeOnce(event,historic=!1){if(historic&&this.collectable[event]){let args=this.collectable[event]?.shift();if(this.collectable[event]?.length===0&&delete this.collectable[event],args)return args}return new Promise(resolve=>{let resolved=!1,listener=(...args)=>{resolved||(resolved=!0,this.unSubscribe(event,listener),resolve(args));};this.subscribe(event,listener,!1);})}unSubscribe(event,listener){if(this.listeners[event]){let index=this.listeners[event]?.findIndex(v=>v===listener);index>=0&&(this.listeners[event]?.splice(index,1),this.listeners[event]?.length===0&&delete this.listeners[event]);}}isSubscribed(event,listener){return !!this.listeners[event]?.includes(listener)}async emit(event,args,collectable=!1){let interceptor=this.interceptors[event],computedArgs=interceptor?await interceptor(...args):args;(collectable&&!this.listeners[event]||this.listeners[event]?.length===0)&&(this.collectable[event]||(this.collectable[event]=[]),this.collectable[event]?.push(args));for(let listener of this.listeners[event]??[])listener(...computedArgs);}reset({collectable,listeners}){if(Array.isArray(collectable))for(let k of collectable)delete this.collectable[k];else typeof collectable=="string"?delete this.collectable[collectable]:collectable!==!1&&(this.collectable={});if(Array.isArray(listeners))for(let k of listeners)delete this.listeners[k];else typeof listeners=="string"?delete this.listeners[listeners]:listeners!==!1&&(this.listeners={});}scanListeners(filter){let listeners=Object.keys(this.listeners);return filter&&(listeners=listeners.filter(filter)),listeners}};var Gap=class{args=[];constructor(...args){this.args=args;}fill(value){return [this,value]}hasDefault(){return this.args.length===1}get default(){return this.args[0]}};var cbor_exports={};__export(cbor_exports,{CborBreak:()=>CborBreak,CborError:()=>CborError,CborFillMissing:()=>CborFillMissing,CborInvalidMajorError:()=>CborInvalidMajorError,CborNumberError:()=>CborNumberError,CborPartialDisabled:()=>CborPartialDisabled,CborRangeError:()=>CborRangeError,Encoded:()=>Encoded,Gap:()=>Gap,POW_2_53:()=>POW_2_53,POW_2_64:()=>POW_2_64,PartiallyEncoded:()=>PartiallyEncoded,Reader:()=>Reader,Tagged:()=>Tagged,Writer:()=>Writer,decode:()=>decode,encode:()=>encode,infiniteBytes:()=>infiniteBytes,partiallyEncodeObject:()=>partiallyEncodeObject});var POW_2_53=9007199254740992,POW_2_64=BigInt(18446744073709552e3);var Encoded=class{constructor(encoded){this.encoded=encoded;}};var SurrealDbError=class extends Error{},NoActiveSocket=class extends SurrealDbError{name="NoActiveSocket";message="No socket is currently connected to a SurrealDB instance. Please call the .connect() method first!"},NoURLProvided=class extends SurrealDbError{name="NoURLProvided";message="Tried to establish a connection while no connection URL was provided"},EngineDisconnected=class extends SurrealDbError{name="EngineDisconnected";message="The engine reported the connection to SurrealDB has dropped"},ReconnectFailed=class extends SurrealDbError{name="ReconnectFailed";message="The engine failed to reconnect to SurrealDB"},ReconnectIterationError=class extends SurrealDbError{name="ReconnectIterationError";message="The reconnect iterator failed to iterate"},UnexpectedServerResponse=class extends SurrealDbError{constructor(response){super();this.response=response;this.message=`${response}`;}name="UnexpectedServerResponse"},UnexpectedConnectionError=class extends SurrealDbError{constructor(error){super();this.error=error;this.message=`${error}`;}name="UnexpectedConnectionError"},UnsupportedEngine=class extends SurrealDbError{constructor(engine){super();this.engine=engine;}name="UnsupportedEngine";message="The engine you are trying to connect to is not supported or configured."},ConnectionUnavailable=class extends SurrealDbError{name="ConnectionUnavailable";message="There is no connection available at this moment."},MissingNamespaceDatabase=class extends SurrealDbError{name="MissingNamespaceDatabase";message="There is no namespace and/or database selected."},HttpConnectionError=class extends SurrealDbError{constructor(message,status,statusText,buffer){super();this.message=message;this.status=status;this.statusText=statusText;this.buffer=buffer;}name="HttpConnectionError"},ResponseError=class extends SurrealDbError{constructor(message){super();this.message=message;}name="ResponseError"},NoNamespaceSpecified=class extends SurrealDbError{name="NoNamespaceSpecified";message="Please specify a namespace to use."},NoDatabaseSpecified=class extends SurrealDbError{name="NoDatabaseSpecified";message="Please specify a database to use."},NoTokenReturned=class extends SurrealDbError{name="NoTokenReturned";message="Did not receive an authentication token."},UnsupportedVersion=class extends SurrealDbError{name="UnsupportedVersion";version;supportedRange;constructor(version,supportedRange){super(),this.version=version,this.supportedRange=supportedRange,this.message=`The version "${version}" reported by the engine is not supported by this library, expected a version that satisfies "${supportedRange}".`;}},VersionRetrievalFailure=class extends SurrealDbError{constructor(error){super();this.error=error;}name="VersionRetrievalFailure";message="Failed to retrieve remote version. If the server is behind a proxy, make sure it's configured correctly."};var CborError=class extends SurrealDbError{message;constructor(message){super(),this.message=message;}},CborNumberError=class extends CborError{name="CborNumberError"},CborRangeError=class extends CborError{name="CborRangeError"},CborInvalidMajorError=class extends CborError{name="CborInvalidMajorError"},CborBreak=class extends CborError{name="CborBreak";constructor(){super("Came across a break which was not intercepted by the decoder");}},CborPartialDisabled=class extends CborError{name="CborPartialDisabled";constructor(){super("Tried to insert a Gap into a CBOR value, while partial mode is not enabled");}},CborFillMissing=class extends CborError{name="CborFillMissing";constructor(){super("Fill for a gap is missing, and gap has no default");}};var Writer=class{constructor(byteLength=256){this.byteLength=byteLength;this._buf=new ArrayBuffer(this.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf);}_chunks=[];_pos=0;_buf;_view;_byte;chunk(gap){this._chunks.push([this._buf.slice(0,this._pos),gap]),this._buf=new ArrayBuffer(this.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._pos=0;}get chunks(){return this._chunks}get buffer(){return this._buf.slice(0,this._pos)}claim(length){let pos=this._pos;if(this._pos+=length,this._pos<=this._buf.byteLength)return pos;let newLen=this._buf.byteLength<<1;for(;newLen<this._pos;)newLen<<=1;if(newLen>this._buf.byteLength){let oldb=this._byte;this._buf=new ArrayBuffer(newLen),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._byte.set(oldb);}return pos}writeUint8(value){let pos=this.claim(1);this._view.setUint8(pos,value);}writeUint16(value){let pos=this.claim(2);this._view.setUint16(pos,value);}writeUint32(value){let pos=this.claim(4);this._view.setUint32(pos,value);}writeUint64(value){let pos=this.claim(8);this._view.setBigUint64(pos,value);}writeUint8Array(data){if(data.byteLength===0)return;let pos=this.claim(data.byteLength);this._byte.set(data,pos);}writeArrayBuffer(data){data.byteLength!==0&&this.writeUint8Array(new Uint8Array(data));}writePartiallyEncoded(data){for(let[buf,gap]of data.chunks)this.writeArrayBuffer(buf),this.chunk(gap);this.writeArrayBuffer(data.end);}writeFloat32(value){let pos=this.claim(4);this._view.setFloat32(pos,value);}writeFloat64(value){let pos=this.claim(8);this._view.setFloat64(pos,value);}writeMajor(type,length){let base=type<<5;length<24?this.writeUint8(base+Number(length)):length<256?(this.writeUint8(base+24),this.writeUint8(Number(length))):length<65536?(this.writeUint8(base+25),this.writeUint16(Number(length))):length<4294967296?(this.writeUint8(base+26),this.writeUint32(Number(length))):(this.writeUint8(base+27),this.writeUint64(BigInt(length)));}output(partial,replacer2){return partial?new PartiallyEncoded(this._chunks,this.buffer,replacer2):this.buffer}};var PartiallyEncoded=class{constructor(chunks,end,replacer2){this.chunks=chunks;this.end=end;this.replacer=replacer2;}build(fills,partial){let writer=new Writer,map=new Map(fills);for(let[buffer,gap]of this.chunks){let hasValue=map.has(gap)||gap.hasDefault();if(!partial&&!hasValue)throw new CborFillMissing;if(writer.writeArrayBuffer(buffer),hasValue){let data=map.get(gap)??gap.default;encode(data,{writer,replacer:this.replacer});}else writer.chunk(gap);}return writer.writeArrayBuffer(this.end),writer.output(!!partial,this.replacer)}};function partiallyEncodeObject(object,options){return Object.fromEntries(Object.entries(object).map(([k,v])=>[k,encode(v,{...options,partial:!0})]))}var Tagged=class{constructor(tag,value){this.tag=tag;this.value=value;}};var textEncoder;function encode(input,options={}){let w=options.writer??new Writer,fillsMap=new Map(options.fills??[]);function inner(input2){let value=options.replacer?options.replacer(input2):input2;if(value===void 0)return w.writeUint8(247);if(value===null)return w.writeUint8(246);if(value===!0)return w.writeUint8(245);if(value===!1)return w.writeUint8(244);switch(typeof value){case"number":{if(Number.isInteger(value))if(value>=0&&value<=9007199254740992)w.writeMajor(0,value);else if(value<0&&value>=-9007199254740992)w.writeMajor(1,-(value+1));else throw new CborNumberError("Number too big to be encoded");else w.writeUint8(251),w.writeFloat64(value);return}case"bigint":{if(value>=0&&value<POW_2_64)w.writeMajor(0,value);else if(value<=0&&value>=-POW_2_64)w.writeMajor(1,-(value+1n));else throw new CborNumberError("BigInt too big to be encoded");return}case"string":{textEncoder??=new TextEncoder;let encoded=textEncoder.encode(value);w.writeMajor(3,encoded.byteLength),w.writeUint8Array(encoded);return}default:{if(Array.isArray(value)){w.writeMajor(4,value.length);for(let v of value)inner(v);return}if(value instanceof Tagged){w.writeMajor(6,value.tag),inner(value.value);return}if(value instanceof Encoded){w.writeArrayBuffer(value.encoded);return}if(value instanceof Gap){if(fillsMap.has(value))inner(fillsMap.get(value));else {if(!options.partial)throw new CborPartialDisabled;w.chunk(value);}return}if(value instanceof PartiallyEncoded){let res=value.build(options.fills??[],options.partial);options.partial?w.writePartiallyEncoded(res):w.writeArrayBuffer(res);return}if(value instanceof Uint8Array||value instanceof Uint16Array||value instanceof Uint32Array||value instanceof Int8Array||value instanceof Int16Array||value instanceof Int32Array||value instanceof Float32Array||value instanceof Float64Array||value instanceof ArrayBuffer){let v=new Uint8Array(value);w.writeMajor(2,v.byteLength),w.writeUint8Array(v);return}let entries=value instanceof Map?Array.from(value.entries()):Object.entries(value);w.writeMajor(5,entries.length);for(let v of entries.flat())inner(v);}}}return inner(input),w.output(!!options.partial,options.replacer)}var Reader=class{_buf;_view;_byte;_pos=0;constructor(buffer){this._buf=new ArrayBuffer(buffer.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._byte.set(new Uint8Array(buffer));}read(amount,res){return this._pos+=amount,res}readUint8(){try{return this.read(1,this._view.getUint8(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint16(){try{return this.read(2,this._view.getUint16(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint32(){try{return this.read(4,this._view.getUint32(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint64(){try{return this.read(8,this._view.getBigUint64(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readFloat16(){let bytes=this.readUint16(),s2=(bytes&32768)>>15,e=(bytes&31744)>>10,f2=bytes&1023;return e===0?(s2?-1:1)*2**-14*(f2/2**10):e===31?f2?Number.NaN:(s2?-1:1)*Number.POSITIVE_INFINITY:(s2?-1:1)*2**(e-15)*(1+f2/2**10)}readFloat32(){try{return this.read(4,this._view.getFloat32(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readFloat64(){try{return this.read(8,this._view.getFloat64(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readBytes(amount){let available=this._byte.length-this._pos;if(available<amount)throw new CborRangeError(`The argument must be between 0 and ${available}`);return this.read(amount,this._byte.slice(this._pos,this._pos+amount))}readMajor(){let byte=this.readUint8(),major=byte>>5;if(major<0||major>7)throw new CborInvalidMajorError("Received invalid major type");return [major,byte&31]}readMajorLength(length){if(length<=23)return length;switch(length){case 24:return this.readUint8();case 25:return this.readUint16();case 26:return this.readUint32();case 27:{let read=this.readUint64();return read>9007199254740992?read:Number(read)}}throw new CborRangeError("Expected a final length")}};function infiniteBytes(r2,forMajor){let w=new Writer;for(;;){let[major,len]=r2.readMajor();if(major===7&&len===31)break;if(major!==forMajor)throw new CborInvalidMajorError(`Expected a resource of the same major (${forMajor}) while processing an infinite resource`);if(len===31)throw new CborRangeError("Expected a finite resource while processing an infinite resource");w.writeUint8Array(r2.readBytes(Number(r2.readMajorLength(len))));}return w.buffer}var textDecoder;function decode(input,options={}){let r2=input instanceof Reader?input:new Reader(input);function inner(){let[major,len]=r2.readMajor();switch(major){case 0:return r2.readMajorLength(len);case 1:{let l=r2.readMajorLength(len);return typeof l=="bigint"?-(l+1n):-(l+1)}case 2:return len===31?infiniteBytes(r2,2):r2.readBytes(Number(r2.readMajorLength(len))).buffer;case 3:{let encoded=len===31?infiniteBytes(r2,3):r2.readBytes(Number(r2.readMajorLength(len)));return textDecoder??=new TextDecoder,textDecoder.decode(encoded)}case 4:{if(len===31){let arr2=[];for(;;)try{arr2.push(decode2());}catch(e){if(e instanceof CborBreak)break;throw e}return arr2}let l=r2.readMajorLength(len),arr=Array(l);for(let i=0;i<l;i++)arr[i]=decode2();return arr}case 5:{let entries=[];if(len===31)for(;;){let key;try{key=decode2();}catch(e){if(e instanceof CborBreak)break;throw e}let value=decode2();entries.push([key,value]);}else {let l=r2.readMajorLength(len);for(let i=0;i<l;i++){let key=decode2(),value=decode2();entries[i]=[key,value];}}return options.map==="map"?new Map(entries):Object.fromEntries(entries)}case 6:{let tag=r2.readMajorLength(len),value=decode2();return new Tagged(tag,value)}case 7:switch(len){case 20:return !1;case 21:return !0;case 22:return null;case 23:return;case 25:return r2.readFloat16();case 26:return r2.readFloat32();case 27:return r2.readFloat64();case 31:throw new CborBreak}}throw new CborInvalidMajorError(`Unable to decode value with major tag ${major}`)}function decode2(){return options.replacer?options.replacer(inner()):inner()}return decode2()}function dateToCborCustomDate(date){let s2=Math.floor(date.getTime()/1e3),ms=date.getTime()-s2*1e3;return [s2,ms*1e6]}function cborCustomDateToDate([s2,ns]){let date=new Date(0);return date.setUTCSeconds(Number(s2)),date.setMilliseconds(Math.floor(Number(ns)/1e6)),date}var Value=class{};var Decimal=class _Decimal extends Value{decimal;constructor(decimal){super(),this.decimal=decimal.toString();}equals(other){return other instanceof _Decimal?this.decimal===other.decimal:!1}toString(){return this.decimal}toJSON(){return this.decimal}};var millisecond=1,microsecond=millisecond/1e3,nanosecond=microsecond/1e3,second=1e3*millisecond,minute=60*second,hour=60*minute,day=24*hour,week=7*day,units=new Map([["ns",nanosecond],["\xB5s",microsecond],["\u03BCs",microsecond],["us",microsecond],["ms",millisecond],["s",second],["m",minute],["h",hour],["d",day],["w",week]]),unitsReverse=Array.from(units).reduce((map,[unit,size])=>(map.set(size,unit),map),new Map),durationPartRegex=new RegExp(`^(\\d+)(${Array.from(units.keys()).join("|")})`),Duration=class _Duration extends Value{_milliseconds;constructor(input){super(),input instanceof _Duration?this._milliseconds=input._milliseconds:typeof input=="string"?this._milliseconds=_Duration.parseString(input):this._milliseconds=input;}static fromCompact([s2,ns]){s2=s2??0,ns=ns??0;let ms=s2*1e3+ns/1e6;return new _Duration(ms)}equals(other){return other instanceof _Duration?this._milliseconds===other._milliseconds:!1}toCompact(){let s2=Math.floor(this._milliseconds/1e3),ns=Math.floor((this._milliseconds-s2*1e3)*1e6);return ns>0?[s2,ns]:s2>0?[s2]:[]}toString(){let left=this._milliseconds,result="";function scrap(size){let num=Math.floor(left/size);return num>0&&(left=left%size),num}for(let[size,unit]of Array.from(unitsReverse).reverse()){let scrapped=scrap(size);scrapped>0&&(result+=`${scrapped}${unit}`);}return result}toJSON(){return this.toString()}static parseString(input){let ms=0,left=input;for(;left!=="";){let match=left.match(durationPartRegex);if(match){let amount=Number.parseInt(match[1]),factor=units.get(match[2]);if(factor===void 0)throw new SurrealDbError(`Invalid duration unit: ${match[2]}`);ms+=amount*factor,left=left.slice(match[0].length);continue}throw new SurrealDbError("Could not match a next duration part")}return ms}static nanoseconds(nanoseconds){return new _Duration(Math.floor(nanoseconds*nanosecond))}static microseconds(microseconds){return new _Duration(Math.floor(microseconds*microsecond))}static milliseconds(milliseconds){return new _Duration(milliseconds)}static seconds(seconds){return new _Duration(seconds*second)}static minutes(minutes){return new _Duration(minutes*minute)}static hours(hours){return new _Duration(hours*hour)}static days(days){return new _Duration(days*day)}static weeks(weeks){return new _Duration(weeks*week)}get microseconds(){return Math.floor(this._milliseconds/microsecond)}get nanoseconds(){return Math.floor(this._milliseconds/nanosecond)}get milliseconds(){return Math.floor(this._milliseconds)}get seconds(){return Math.floor(this._milliseconds/second)}get minutes(){return Math.floor(this._milliseconds/minute)}get hours(){return Math.floor(this._milliseconds/hour)}get days(){return Math.floor(this._milliseconds/day)}get weeks(){return Math.floor(this._milliseconds/week)}};var Future=class _Future extends Value{constructor(inner){super();this.inner=inner;}equals(other){return other instanceof _Future?this.inner===other.inner:!1}toJSON(){return this.toString()}toString(){return `<future> ${this.inner}`}};var Geometry=class _Geometry extends Value{equals(other){return other instanceof _Geometry?this.is(other):!1}toString(){return JSON.stringify(this.toJSON())}};function f(num){return num instanceof Decimal?Number.parseFloat(num.decimal):num}var GeometryPoint=class _GeometryPoint extends Geometry{point;constructor(point){super(),point instanceof _GeometryPoint?this.point=point.clone().point:this.point=[f(point[0]),f(point[1])];}toJSON(){return {type:"Point",coordinates:this.coordinates}}get coordinates(){return this.point}is(geometry){return geometry instanceof _GeometryPoint?this.point[0]===geometry.point[0]&&this.point[1]===geometry.point[1]:!1}clone(){return new _GeometryPoint([...this.point])}},GeometryLine=class _GeometryLine extends Geometry{line;constructor(line){super(),this.line=line instanceof _GeometryLine?line.clone().line:line;}toJSON(){return {type:"LineString",coordinates:this.coordinates}}get coordinates(){return this.line.map(g=>g.coordinates)}close(){this.line[0].is(this.line.at(-1))||this.line.push(this.line[0]);}is(geometry){if(!(geometry instanceof _GeometryLine)||this.line.length!==geometry.line.length)return !1;for(let i=0;i<this.line.length;i++)if(!this.line[i].is(geometry.line[i]))return !1;return !0}clone(){return new _GeometryLine(this.line.map(p=>p.clone()))}},GeometryPolygon=class _GeometryPolygon extends Geometry{polygon;constructor(polygon){super(),this.polygon=polygon instanceof _GeometryPolygon?polygon.clone().polygon:polygon.map(l=>{let line=l.clone();return line.close(),line});}toJSON(){return {type:"Polygon",coordinates:this.coordinates}}get coordinates(){return this.polygon.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryPolygon)||this.polygon.length!==geometry.polygon.length)return !1;for(let i=0;i<this.polygon.length;i++)if(!this.polygon[i].is(geometry.polygon[i]))return !1;return !0}clone(){return new _GeometryPolygon(this.polygon.map(p=>p.clone()))}},GeometryMultiPoint=class _GeometryMultiPoint extends Geometry{points;constructor(points){super(),this.points=points instanceof _GeometryMultiPoint?points.points:points;}toJSON(){return {type:"MultiPoint",coordinates:this.coordinates}}get coordinates(){return this.points.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiPoint)||this.points.length!==geometry.points.length)return !1;for(let i=0;i<this.points.length;i++)if(!this.points[i].is(geometry.points[i]))return !1;return !0}clone(){return new _GeometryMultiPoint(this.points.map(p=>p.clone()))}},GeometryMultiLine=class _GeometryMultiLine extends Geometry{lines;constructor(lines){super(),this.lines=lines instanceof _GeometryMultiLine?lines.lines:lines;}toJSON(){return {type:"MultiLineString",coordinates:this.coordinates}}get coordinates(){return this.lines.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiLine)||this.lines.length!==geometry.lines.length)return !1;for(let i=0;i<this.lines.length;i++)if(!this.lines[i].is(geometry.lines[i]))return !1;return !0}clone(){return new _GeometryMultiLine(this.lines.map(p=>p.clone()))}},GeometryMultiPolygon=class _GeometryMultiPolygon extends Geometry{polygons;constructor(polygons){super(),this.polygons=polygons instanceof _GeometryMultiPolygon?polygons.polygons:polygons;}toJSON(){return {type:"MultiPolygon",coordinates:this.coordinates}}get coordinates(){return this.polygons.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiPolygon)||this.polygons.length!==geometry.polygons.length)return !1;for(let i=0;i<this.polygons.length;i++)if(!this.polygons[i].is(geometry.polygons[i]))return !1;return !0}clone(){return new _GeometryMultiPolygon(this.polygons.map(p=>p.clone()))}},GeometryCollection=class _GeometryCollection extends Geometry{collection;constructor(collection){super(),this.collection=collection instanceof _GeometryCollection?collection.collection:collection;}toJSON(){return {type:"GeometryCollection",geometries:this.geometries}}get geometries(){return this.collection.map(g=>g.toJSON())}is(geometry){if(!(geometry instanceof _GeometryCollection)||this.collection.length!==geometry.collection.length)return !1;for(let i=0;i<this.collection.length;i++)if(!this.collection[i].is(geometry.collection[i]))return !1;return !0}clone(){return new _GeometryCollection(this.collection.map(p=>p.clone()))}};function equals(x,y){if(Object.is(x,y))return !0;if(x instanceof Date&&y instanceof Date)return x.getTime()===y.getTime();if(x instanceof RegExp&&y instanceof RegExp)return x.toString()===y.toString();if(x instanceof Value&&y instanceof Value)return x.equals(y);if(typeof x!="object"||x===null||typeof y!="object"||y===null)return !1;let keysX=Reflect.ownKeys(x),keysY=Reflect.ownKeys(y);if(keysX.length!==keysY.length)return !1;for(let i=0;i<keysX.length;i++)if(!Reflect.has(y,keysX[i])||!equals(x[keysX[i]],y[keysX[i]]))return !1;return !0}var MAX_i64=9223372036854775807n;function escapeIdent(str){if(isOnlyNumbers(str))return `\u27E8${str}\u27E9`;if(str==="")return "\u27E8\u27E9";let code,i,len;for(i=0,len=str.length;i<len;i++)if(code=str.charCodeAt(i),!(code>47&&code<58)&&!(code>64&&code<91)&&!(code>96&&code<123)&&code!==95)return `\u27E8${str.replaceAll("\u27E9","\\\u27E9")}\u27E9`;return str}function escapeNumber(num){return num<=MAX_i64?num.toString():`\u27E8${num}\u27E9`}function isOnlyNumbers(str){return /^\d+$/.test(str.replace(/_/g,""))}var Uuid=class _Uuid extends Value{inner;constructor(uuid){super(),uuid instanceof ArrayBuffer?this.inner=UUID.ofInner(new Uint8Array(uuid)):uuid instanceof Uint8Array?this.inner=UUID.ofInner(uuid):uuid instanceof _Uuid?this.inner=uuid.inner:uuid instanceof UUID?this.inner=uuid:this.inner=UUID.parse(uuid);}equals(other){return other instanceof _Uuid?this.inner.equals(other.inner):!1}toString(){return this.inner.toString()}toJSON(){return this.inner.toString()}toUint8Array(){return this.inner.bytes}toBuffer(){return this.inner.bytes.buffer}static v4(){return new _Uuid(uuidv4obj())}static v7(){return new _Uuid(uuidv7obj())}};var RecordId=class _RecordId extends Value{tb;id;constructor(tb,id2){if(super(),typeof tb!="string")throw new SurrealDbError("TB part is not valid");if(!isValidIdPart(id2))throw new SurrealDbError("ID part is not valid");this.tb=tb,this.id=id2;}equals(other){return other instanceof _RecordId?this.tb===other.tb&&equals(this.id,other.id):!1}toJSON(){return this.toString()}toString(){let tb=escapeIdent(this.tb),id2=escapeIdPart(this.id);return `${tb}:${id2}`}},StringRecordId=class _StringRecordId extends Value{rid;constructor(rid){if(super(),rid instanceof _StringRecordId)this.rid=rid.rid;else if(rid instanceof RecordId)this.rid=rid.toString();else if(typeof rid=="string")this.rid=rid;else throw new SurrealDbError("String Record ID must be a string")}equals(other){return other instanceof _StringRecordId?this.rid===other.rid:!1}toJSON(){return this.rid}toString(){return this.rid}};function isValidIdPart(v){if(v instanceof Uuid)return !0;switch(typeof v){case"string":case"number":case"bigint":return !0;case"object":return Array.isArray(v)||v!==null;default:return !1}}function escapeIdPart(id2){return id2 instanceof Uuid?`u"${id2}"`:typeof id2=="string"?escapeIdent(id2):typeof id2=="bigint"||typeof id2=="number"?escapeNumber(id2):toSurrealqlString(id2)}var Table=class _Table extends Value{tb;constructor(tb){if(super(),typeof tb!="string")throw new SurrealDbError("Table must be a string");this.tb=tb;}equals(other){return other instanceof _Table?this.tb===other.tb:!1}toJSON(){return this.tb}toString(){return this.tb}};function toSurrealqlString(input){if(typeof input=="string")return `s${JSON.stringify(input)}`;if(input===null)return "NULL";if(input===void 0)return "NONE";if(typeof input=="object"){if(input instanceof Date)return `d${JSON.stringify(input.toISOString())}`;if(input instanceof Uuid)return `u${JSON.stringify(input.toString())}`;if(input instanceof RecordId||input instanceof StringRecordId)return `r${JSON.stringify(input.toString())}`;if(input instanceof Geometry)return toSurrealqlString(input.toJSON());if(input instanceof Decimal||input instanceof Duration||input instanceof Future||input instanceof Range||input instanceof Table)return input.toJSON();switch(Object.getPrototypeOf(input)){case Object.prototype:{let output2="{ ",entries=Object.entries(input);for(let[i,[k,v]]of entries.entries())output2+=`${JSON.stringify(k)}: ${toSurrealqlString(v)}`,i<entries.length-1&&(output2+=", ");return output2+=" }",output2}case Map.prototype:{let output2="{ ",entries=Array.from(input.entries());for(let[i,[k,v]]of entries.entries())output2+=`${JSON.stringify(k)}: ${toSurrealqlString(v)}`,i<entries.length-1&&(output2+=", ");return output2+=" }",output2}case Array.prototype:return `[ ${input.map(toSurrealqlString).join(", ")} ]`;case Set.prototype:return `[ ${[...new Set([...input].map(toSurrealqlString))].join(", ")} ]`}}return `${input}`}var Range=class _Range extends Value{constructor(beg,end){super();this.beg=beg;this.end=end;}equals(other){return !(other instanceof _Range)||this.beg?.constructor!==other.beg?.constructor||this.end?.constructor!==other.end?.constructor?!1:equals(this.beg?.value,other.beg?.value)&&equals(this.end?.value,other.end?.value)}toJSON(){return this.toString()}toString(){let beg=escapeRangeBound(this.beg),end=escapeRangeBound(this.end);return `${beg}${getRangeJoin(this.beg,this.end)}${end}`}},BoundIncluded=class{constructor(value){this.value=value;}},BoundExcluded=class{constructor(value){this.value=value;}},RecordIdRange=class _RecordIdRange extends Value{constructor(tb,beg,end){super();this.tb=tb;this.beg=beg;this.end=end;if(typeof tb!="string")throw new SurrealDbError("TB part is not valid");if(!isValidIdBound(beg))throw new SurrealDbError("Beg part is not valid");if(!isValidIdBound(end))throw new SurrealDbError("End part is not valid")}equals(other){return !(other instanceof _RecordIdRange)||this.beg?.constructor!==other.beg?.constructor||this.end?.constructor!==other.end?.constructor?!1:this.tb===other.tb&&equals(this.beg?.value,other.beg?.value)&&equals(this.end?.value,other.end?.value)}toJSON(){return this.toString()}toString(){let tb=escapeIdent(this.tb),beg=escapeIdBound(this.beg),end=escapeIdBound(this.end);return `${tb}:${beg}${getRangeJoin(this.beg,this.end)}${end}`}};function getRangeJoin(beg,end){let output2="";return beg instanceof BoundExcluded&&(output2+=">"),output2+="..",end instanceof BoundIncluded&&(output2+="="),output2}function isValidIdBound(bound){return bound instanceof BoundIncluded||bound instanceof BoundExcluded?isValidIdPart(bound.value):!0}function escapeIdBound(bound){return bound instanceof BoundIncluded||bound instanceof BoundExcluded?escapeIdPart(bound.value):""}function escapeRangeBound(bound){if(bound===void 0)return "";let value=bound.value;return bound instanceof Range?`(${toSurrealqlString(value)})`:toSurrealqlString(value)}function rangeToCbor([beg,end]){function encodeBound(bound){return bound instanceof BoundIncluded?new Tagged(TAG_BOUND_INCLUDED,bound.value):bound instanceof BoundExcluded?new Tagged(TAG_BOUND_EXCLUDED,bound.value):null}return [encodeBound(beg),encodeBound(end)]}function cborToRange(range){function decodeBound(bound){if(bound!==null){if(bound instanceof BoundIncluded||bound instanceof BoundExcluded)return bound;throw new SurrealDbError("Expected the bounds to be decoded already")}}return [decodeBound(range[0]),decodeBound(range[1])]}var TAG_SPEC_DATETIME=0,TAG_SPEC_UUID=37,TAG_NONE=6,TAG_TABLE=7,TAG_RECORDID=8,TAG_STRING_UUID=9,TAG_STRING_DECIMAL=10,TAG_CUSTOM_DATETIME=12,TAG_STRING_DURATION=13,TAG_CUSTOM_DURATION=14,TAG_FUTURE=15,TAG_RANGE=49,TAG_BOUND_INCLUDED=50,TAG_BOUND_EXCLUDED=51,TAG_GEOMETRY_POINT=88,TAG_GEOMETRY_LINE=89,TAG_GEOMETRY_POLYGON=90,TAG_GEOMETRY_MULTIPOINT=91,TAG_GEOMETRY_MULTILINE=92,TAG_GEOMETRY_MULTIPOLYGON=93,TAG_GEOMETRY_COLLECTION=94,replacer={encode(v){return v instanceof Date?new Tagged(TAG_CUSTOM_DATETIME,dateToCborCustomDate(v)):v===void 0?new Tagged(TAG_NONE,null):v instanceof Uuid?new Tagged(TAG_SPEC_UUID,v.toBuffer()):v instanceof Decimal?new Tagged(TAG_STRING_DECIMAL,v.toString()):v instanceof Duration?new Tagged(TAG_CUSTOM_DURATION,v.toCompact()):v instanceof RecordId?new Tagged(TAG_RECORDID,[v.tb,v.id]):v instanceof StringRecordId?new Tagged(TAG_RECORDID,v.rid):v instanceof RecordIdRange?new Tagged(TAG_RECORDID,[v.tb,new Tagged(TAG_RANGE,rangeToCbor([v.beg,v.end]))]):v instanceof Table?new Tagged(TAG_TABLE,v.tb):v instanceof Future?new Tagged(TAG_FUTURE,v.inner):v instanceof Range?new Tagged(TAG_RANGE,rangeToCbor([v.beg,v.end])):v instanceof GeometryPoint?new Tagged(TAG_GEOMETRY_POINT,v.point):v instanceof GeometryLine?new Tagged(TAG_GEOMETRY_LINE,v.line):v instanceof GeometryPolygon?new Tagged(TAG_GEOMETRY_POLYGON,v.polygon):v instanceof GeometryMultiPoint?new Tagged(TAG_GEOMETRY_MULTIPOINT,v.points):v instanceof GeometryMultiLine?new Tagged(TAG_GEOMETRY_MULTILINE,v.lines):v instanceof GeometryMultiPolygon?new Tagged(TAG_GEOMETRY_MULTIPOLYGON,v.polygons):v instanceof GeometryCollection?new Tagged(TAG_GEOMETRY_COLLECTION,v.collection):v},decode(v){if(!(v instanceof Tagged))return v;switch(v.tag){case TAG_SPEC_DATETIME:return new Date(v.value);case TAG_SPEC_UUID:case TAG_STRING_UUID:return new Uuid(v.value);case TAG_CUSTOM_DATETIME:return cborCustomDateToDate(v.value);case TAG_NONE:return;case TAG_STRING_DECIMAL:return new Decimal(v.value);case TAG_STRING_DURATION:return new Duration(v.value);case TAG_CUSTOM_DURATION:return Duration.fromCompact(v.value);case TAG_TABLE:return new Table(v.value);case TAG_FUTURE:return new Future(v.value);case TAG_RANGE:return new Range(...cborToRange(v.value));case TAG_BOUND_INCLUDED:return new BoundIncluded(v.value);case TAG_BOUND_EXCLUDED:return new BoundExcluded(v.value);case TAG_RECORDID:return v.value[1]instanceof Range?new RecordIdRange(v.value[0],v.value[1].beg,v.value[1].end):new RecordId(v.value[0],v.value[1]);case TAG_GEOMETRY_POINT:return new GeometryPoint(v.value);case TAG_GEOMETRY_LINE:return new GeometryLine(v.value);case TAG_GEOMETRY_POLYGON:return new GeometryPolygon(v.value);case TAG_GEOMETRY_MULTIPOINT:return new GeometryMultiPoint(v.value);case TAG_GEOMETRY_MULTILINE:return new GeometryMultiLine(v.value);case TAG_GEOMETRY_MULTIPOLYGON:return new GeometryMultiPolygon(v.value);case TAG_GEOMETRY_COLLECTION:return new GeometryCollection(v.value)}}};Object.freeze(replacer);function encodeCbor(data){return encode(data,{replacer:replacer.encode})}function decodeCbor(data){return decode(data,{replacer:replacer.decode})}var textEncoder2,PreparedQuery=class{_query;_bindings;length;constructor(query,bindings){textEncoder2??=new TextEncoder,this._query=textEncoder2.encode(query),this._bindings=partiallyEncodeObject(bindings??{},{replacer:replacer.encode}),this.length=Object.keys(this._bindings).length;}get query(){let w=new Writer(this._query.byteLength+9);return w.writeMajor(3,this._query.byteLength),w.writeUint8Array(this._query),new Encoded(w.output(!1))}get bindings(){return this._bindings}build(fills){return encode([this.query,this.bindings],{fills})}append(query_raw,...values){let base=this.length;this.length+=values.length;let reused=0,gaps=new Map,mapped_bindings=values.map((v,i)=>{if(v instanceof Gap){let index=gaps.get(v);if(index!==void 0)return reused++,[`bind___${index}`,v];gaps.set(v,i-reused);}return [`bind___${base+i-reused}`,v]});for(let[k,v]of mapped_bindings)this._bindings[k]=encode(v,{replacer:replacer.encode,partial:!0});let query=query_raw.flatMap((segment,i)=>{let variable=mapped_bindings[i]?.[0];return [segment,...variable?[`$${variable}`]:[]]}).join("");textEncoder2??=new TextEncoder;let current=new Uint8Array(this._query),added=textEncoder2.encode(query);return this._query=new Uint8Array(current.byteLength+added.byteLength),this._query.set(current),this._query.set(added,current.byteLength),this}};function convertAuth(params){let result={},convertString=(a,b,optional)=>{if(a in params)result[b]=`${params[a]}`,delete result[a];else if(optional!==!0)throw new SurrealDbError(`Key ${a} is missing from the authentication parameters`)};return "scope"in params?(result={...params},convertString("scope","sc"),convertString("namespace","ns"),convertString("database","db")):"variables"in params?(result={...params.variables},convertString("access","ac"),convertString("namespace","ns"),convertString("database","db")):(convertString("access","ac",!0),convertString("database","db",!0),convertString("namespace","ns",!("database"in params)),convertString("username","user"),convertString("password","pass")),result}var liveActions=["CREATE","UPDATE","DELETE"];function isLiveResult(v){return !(typeof v!="object"||v===null||!("id"in v&&"action"in v&&"result"in v)||!(v.id instanceof Uuid)||!liveActions.includes(v.action)||typeof v.result!="object"||v.result===null)}var DEFAULT_RECONNECT_OPTIONS={enabled:!0,attempts:5,retryDelay:1e3,retryDelayMax:6e4,retryDelayMultiplier:2,retryDelayJitter:.1};var defaultVersionCheckTimeout=5e3,supportedSurrealDbVersionMin="1.4.2",supportedSurrealDbVersionUntil="3.0.0";function versionCheck(version,min=supportedSurrealDbVersionMin,until=supportedSurrealDbVersionUntil){if(!isVersionSupported(version,min,until))throw new UnsupportedVersion(version,`>= ${min} < ${until}`);return !0}function isVersionSupported(version,min=supportedSurrealDbVersionMin,until=supportedSurrealDbVersionUntil){return min.localeCompare(version,void 0,{numeric:!0})<=0&&until.localeCompare(version,void 0,{numeric:!0})===1}async function retrieveRemoteVersion(url,timeout){let protocol={"ws:":"http:","wss:":"https:","http:":"http:","https:":"https:"}[url.protocol];if(protocol){let basepath=url.pathname.slice(0,-4);url=new URL(url),url.pathname=`${basepath}/version`,url.protocol=protocol;let controller=new AbortController,id2=setTimeout(()=>controller.abort(),timeout??defaultVersionCheckTimeout),versionPrefix="surrealdb-";return await fetch(url,{signal:controller.signal}).then(res=>res.text()).then(version2=>version2.slice(versionPrefix.length)).catch(e=>{throw new VersionRetrievalFailure(e)}).finally(()=>{clearTimeout(id2);})}throw new VersionRetrievalFailure}var id=0;function getIncrementalID(){return id=(id+1)%Number.MAX_SAFE_INTEGER,id.toString()}var RetryMessage=Symbol("RetryMessage"),ConnectionStatus=(ConnectionStatus2=>(ConnectionStatus2.Disconnected="disconnected",ConnectionStatus2.Connecting="connecting",ConnectionStatus2.Reconnecting="reconnecting",ConnectionStatus2.Connected="connected",ConnectionStatus2.Error="error",ConnectionStatus2))(ConnectionStatus||{}),EngineContext=class{emitter;encodeCbor;decodeCbor;reconnect;prepare;constructor({emitter,encodeCbor:encodeCbor2,decodeCbor:decodeCbor2,reconnect,prepare}){this.emitter=emitter,this.encodeCbor=encodeCbor2,this.decodeCbor=decodeCbor2,this.reconnect=reconnect,this.prepare=prepare;}},AbstractEngine=class{context;ready;status="disconnected";connection={url:void 0,namespace:void 0,database:void 0,token:void 0};constructor(context){this.context=context;}get emitter(){return this.context.emitter}get encodeCbor(){return this.context.encodeCbor}get decodeCbor(){return this.context.decodeCbor}};function processAuthVars(vars,fallback){if("scope"in vars||"access"in vars&&"variables"in vars&&vars.variables){if(!vars.namespace){if(!fallback?.namespace)throw new NoNamespaceSpecified;vars.namespace=fallback.namespace;}if(!vars.database){if(!fallback?.database)throw new NoDatabaseSpecified;vars.database=fallback.database;}}return vars}var AuthController=class{async signup(vars){if(!this.connection)throw new NoActiveSocket;let parsed=processAuthVars(vars,this.connection.connection),converted=convertAuth(parsed),res=await this.rpc("signup",[converted]);if(res.error)throw new ResponseError(res.error.message);if(!res.result)throw new NoTokenReturned;return res.result}async signin(vars){if(!this.connection)throw new NoActiveSocket;let parsed=processAuthVars(vars,this.connection.connection),converted=convertAuth(parsed),res=await this.rpc("signin",[converted]);if(res.error)throw new ResponseError(res.error.message);if(!res.result)throw new NoTokenReturned;return res.result}async authenticate(token){let res=await this.rpc("authenticate",[token]);if(res.error)throw new ResponseError(res.error.message);return !0}async invalidate(){let res=await this.rpc("invalidate");if(res.error)throw new ResponseError(res.error.message);return !0}},EngineAuth=class extends AuthController{constructor(connection){super();this.connection=connection;}rpc(method,params){if(!this.connection)throw new NoActiveSocket;return this.connection.rpc({method,params},!0)}};var AbstractRemoteEngine=class extends AbstractEngine{async req_post(body,url,headers_){let headers={"Content-Type":"application/cbor",Accept:"application/cbor",...headers_};this.connection.namespace&&(headers["Surreal-NS"]=this.connection.namespace),this.connection.database&&(headers["Surreal-DB"]=this.connection.database),this.connection.token&&(headers.Authorization=`Bearer ${this.connection.token}`);let raw=await fetch(`${url??this.connection.url}`,{method:"POST",headers,body:this.encodeCbor(body)}),buffer=await raw.arrayBuffer();if(raw.status===200)return buffer;let dec=new TextDecoder("utf-8");throw new HttpConnectionError(dec.decode(buffer),raw.status,raw.statusText,buffer)}};var ALWAYS_ALLOW=new Set(["signin","signup","authenticate","invalidate","version","use","let","unset","query"]),HttpEngine=class extends AbstractRemoteEngine{connection={url:void 0,namespace:void 0,database:void 0,token:void 0,variables:{}};setStatus(status,...args){this.status=status,this.emitter.emit(status,args);}version(url,timeout){return retrieveRemoteVersion(url,timeout)}async connect(url){return this.setStatus("connecting"),this.connection.url=url,await this.context.prepare?.(new EngineAuth(this)),this.setStatus("connected"),this.ready=new Promise(r2=>r2()),this.ready}disconnect(){return this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0,variables:{}},this.ready=void 0,this.setStatus("disconnected"),new Promise(r2=>r2())}async rpc(request,force){if(force||await this.ready,!this.connection.url)throw new ConnectionUnavailable;if((!this.connection.namespace||!this.connection.database)&&!ALWAYS_ALLOW.has(request.method))throw new MissingNamespaceDatabase;if(request.method==="use"){let[ns,db]=request.params;return ns===null&&(this.connection.namespace=void 0),db===null&&(this.connection.database=void 0),ns&&(this.connection.namespace=ns),db&&(this.connection.database=db),{result:!0}}if(request.method==="let"){let[key,value]=request.params;return this.connection.variables[key]=value,{result:!0}}if(request.method==="unset"){let[key]=request.params;return delete this.connection.variables[key],{result:!0}}request.method==="query"&&(request.params=[request.params?.[0],{...this.connection.variables,...request.params?.[1]??{}}]);let id2=getIncrementalID(),buffer=await this.req_post({id:id2,...request}),response=this.decodeCbor(buffer);if("result"in response)switch(request.method){case"signin":case"signup":{this.connection.token=response.result;break}case"authenticate":{let[token]=request.params;this.connection.token=token;break}case"invalidate":{this.connection.token=void 0;break}}return this.emitter.emit(`rpc-${id2}`,[response]),response}get connected(){return !!this.connection.url}async export(options){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.pathname=`${basepath}/export`;let buffer=await this.req_post(options??{},url,{Accept:"plain/text"});return new TextDecoder("utf-8").decode(buffer)}async import(data){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.pathname=`${basepath}/import`,await this.req_post(data,url,{Accept:"application/json"});}};function newCompletable(){let out={completed:!1};return out.promise=new Promise((resolve_,reject_)=>{out.resolve=arg=>{out.completed=!0,resolve_(arg);},out.reject=reason=>{out.completed=!0,reject_(reason);};}),out}var WebsocketEngine=class extends AbstractRemoteEngine{pinger;socket;disconnected;constructor(ctx){super(ctx),this.disconnected=newCompletable();}setStatus(status,...args){this.connection.url&&status==="disconnected"||status==="error"?(this.disconnected.resolve(),this.disconnected=newCompletable()):(this.status=status,this.emitter.emit(status,args));}async requireStatus(status){return this.status!==status&&await this.emitter.subscribeOnce(status),!0}version(url,timeout){return retrieveRemoteVersion(url,timeout)}async connect(url){this.connection.url=url,(async()=>{let initial=!0,controls;for(;this.connection.url;)if(initial)initial=!1,this.setStatus("connecting"),this.ready=this.createSocket(),await this.disconnected.promise;else {if(!this.context.reconnect.enabled)break;if(!controls){let{promise,resolve:resolve2,reject:reject2}=newCompletable();this.ready=promise,controls=[resolve2,reject2];}let[resolve,reject]=controls;if(!this.context.reconnect.allowed){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},this.socket=void 0,reject(new ReconnectFailed),this.emitter.emit("error",[new ReconnectFailed]),this.setStatus("disconnected");break}this.setStatus("reconnecting"),await this.context.reconnect.iterate();try{await this.createSocket();}catch{continue}try{if(this.connection.namespace||this.connection.database){let res=await this.rpc({method:"use",params:[this.connection.namespace,this.connection.database]},!0);if(res.error)throw new ResponseError(res.error.message)}if(this.connection.token){let res=await this.rpc({method:"authenticate",params:[this.connection.token]},!0);if(res.error)throw new ResponseError(res.error.message)}}catch(e){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},this.socket=void 0,reject(e),this.emitter.emit("error",[e]),this.setStatus("disconnected");break}this.context.reconnect.reset(),resolve(),this.emitter.scanListeners(k=>k.startsWith("rpc-")).map(k=>this.emitter.emit(k,[RetryMessage])),this.status==="connected"&&await this.disconnected.promise;}})(),await this.ready;}async createSocket(){let{promise,resolve,reject}=newCompletable();if(!this.connection.url)throw new NoURLProvided;let socket=new WebSocket$1(this.connection.url.toString(),"cbor");socket.addEventListener("open",async()=>{this.socket=socket,await this.context.prepare?.(new EngineAuth(this)),this.setStatus("connected"),this.pinger?.stop(),this.pinger=new Pinger(3e4),this.pinger.start(()=>{try{this.rpc({method:"ping"});}catch{}}),resolve();}),socket.addEventListener("error",e=>{let error=new UnexpectedConnectionError("detail"in e&&e.detail?e.detail:"message"in e&&e.message?e.message:"error"in e&&e.error?e.error:"An unexpected error occurred");this.setStatus("error",error),reject(error);}),socket.addEventListener("close",()=>{this.setStatus("disconnected"),this.pinger?.stop();}),socket.addEventListener("message",async({data})=>{try{let decoded=this.decodeCbor(data instanceof ArrayBuffer?data:data instanceof Blob?await data.arrayBuffer():data.buffer.slice(data.byteOffset,data.byteOffset+data.byteLength));if(typeof decoded=="object"&&decoded!=null&&Object.getPrototypeOf(decoded)===Object.prototype)this.handleRpcResponse(decoded);else throw new UnexpectedServerResponse(decoded)}catch(detail){socket.dispatchEvent(new CustomEvent("error",{detail}));}}),await promise;}async disconnect(){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},await this.ready?.catch(()=>{}),this.socket?.close(),this.ready=void 0,this.socket=void 0,this.disconnected.resolve(),await Promise.any([this.requireStatus("disconnected"),this.requireStatus("error")]);}async rpc(request,force){if(force||await this.ready,!this.socket)throw new ConnectionUnavailable;let res;for(;!res;){let id2=getIncrementalID(),response=this.emitter.subscribeOnce(`rpc-${id2}`);if(this.socket.send(this.encodeCbor({id:id2,...request})),force&&this.socket.readyState===WebSocket$1.CLOSED)throw new EngineDisconnected;let[raw]=await response;if(raw instanceof EngineDisconnected)throw raw;raw!==RetryMessage&&(res=raw);}if("result"in res)switch(request.method){case"use":{let[ns,db]=request.params;ns===null&&(this.connection.namespace=void 0),db===null&&(this.connection.database=void 0),ns&&(this.connection.namespace=ns),db&&(this.connection.database=db);break}case"signin":case"signup":{this.connection.token=res.result;break}case"authenticate":{let[token]=request.params;this.connection.token=token;break}case"invalidate":{this.connection.token=void 0;break}}return res}handleRpcResponse({id:id2,...res}){if(id2)this.emitter.emit(`rpc-${id2}`,[res]);else if(res.error)this.setStatus("error",new ResponseError(res.error));else if(isLiveResult(res.result)){let{id:id3,action,result}=res.result;this.emitter.emit(`live-${id3}`,[action,result],!0);}else this.setStatus("error",new UnexpectedServerResponse({id:id2,...res}));}get connected(){return !!this.socket}async export(options){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.protocol=url.protocol.replace("ws","http"),url.pathname=`${basepath}/export`;let buffer=await this.req_post(options??{},url,{Accept:"plain/text"});return new TextDecoder("utf-8").decode(buffer)}async import(data){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.protocol=url.protocol.replace("ws","http"),url.pathname=`${basepath}/import`,await this.req_post(data,url,{Accept:"application/json"});}},Pinger=class{pinger;interval;constructor(interval=3e4){this.interval=interval;}start(callback){this.pinger=setInterval(callback,this.interval);}stop(){clearInterval(this.pinger);}};function rand(min,max){return Math.random()*(max-min)+min}var ReconnectContext=class{_attempts=0;options;surreal;constructor(input,surreal){this.surreal=surreal,input?input===!0?this.options=DEFAULT_RECONNECT_OPTIONS:this.options={...DEFAULT_RECONNECT_OPTIONS,...input}:this.options={...DEFAULT_RECONNECT_OPTIONS,enabled:!1};}get attempts(){return this._attempts}get enabled(){return this.options.enabled}get allowed(){return !(!this.options.enabled||this.options.attempts!==-1&&this._attempts>=this.options.attempts)}reset(){this._attempts=0;}async iterate(){if(!this.allowed)throw new ReconnectIterationError;this._attempts++;let multiplier=this.options.retryDelayMultiplier**this.attempts,adjustedDelay=this.options.retryDelay*multiplier,jitterModifier=rand(-this.options.retryDelayJitter,this.options.retryDelayJitter),nextDelay=Math.min(adjustedDelay*(1+jitterModifier),this.options.retryDelayMax);await new Promise(r2=>setTimeout(r2,nextDelay));}};var Surreal=class extends AuthController{connection;emitter;engines={ws:WebsocketEngine,wss:WebsocketEngine,http:HttpEngine,https:HttpEngine};_ready;constructor({engines}={}){super(),this.emitter=new Emitter,engines&&(this.engines={...this.engines,...engines});}async connect(url,opts={}){return this._ready=this.connectInner(url,opts),await this._ready,!0}async connectInner(url,opts={}){let endpoint=parseUrl(url),engineName=endpoint.protocol.slice(0,-1),engine=this.engines[engineName];if(!engine)throw new UnsupportedEngine(engineName);let{prepare,auth,namespace,database,reconnect}=opts;await this.close();let context=new EngineContext({emitter:this.emitter,encodeCbor,decodeCbor,reconnect:new ReconnectContext(reconnect,this),prepare}),connection=new engine(context);if(opts.versionCheck!==!1){let version=await connection.version(endpoint,opts.versionCheckTimeout);versionCheck(version);}this.connection=connection,await connection.connect(endpoint),(namespace||database)&&await this.use({namespace,database}),typeof auth=="string"?await this.authenticate(auth):auth&&await this.signin(auth);}async close(){return this.clean(),await this.connection?.disconnect(),!0}clean(){let pending=this.emitter.scanListeners(k=>k.startsWith("rpc-"));pending.map(k=>this.emitter.emit(k,[new EngineDisconnected]));let live=this.emitter.scanListeners(k=>k.startsWith("live-"));live.map(k=>this.emitter.emit(k,["CLOSE","disconnected"])),this.emitter.reset({collectable:!0,listeners:[...pending,...live]});}get status(){return this.connection?.status??"disconnected"}get ready(){return Promise.all([this._ready,this.connection?.ready]).then(()=>{})}async ping(){let{error}=await this.rpc("ping");if(error)throw new ResponseError(error.message);return !0}async use({namespace,database}){if(!this.connection)throw new NoActiveSocket;if(namespace===null&&database!==null)throw new SurrealDbError("Cannot unset namespace without unsetting database");let{error}=await this.rpc("use",[namespace,database]);if(error)throw new ResponseError(error.message);return !0}async info(){await this.ready;let res=await this.rpc("info");if(res.error)throw new ResponseError(res.error.message);return res.result??void 0}async let(variable,value){let res=await this.rpc("let",[variable,value]);if(res.error)throw new ResponseError(res.error.message);return !0}async unset(variable){let res=await this.rpc("unset",[variable]);if(res.error)throw new ResponseError(res.error.message);return !0}async live(table,callback,diff){await this.ready;let res=await this.rpc("live",[table,diff]);if(res.error)throw new ResponseError(res.error.message);return callback&&this.subscribeLive(res.result,callback),res.result}async subscribeLive(queryUuid,callback){if(await this.ready,!this.connection)throw new NoActiveSocket;this.connection.emitter.subscribe(`live-${queryUuid}`,callback,!0);}async unSubscribeLive(queryUuid,callback){if(await this.ready,!this.connection)throw new NoActiveSocket;this.connection.emitter.unSubscribe(`live-${queryUuid}`,callback);}async kill(queryUuid){if(await this.ready,!this.connection)throw new NoActiveSocket;if(Array.isArray(queryUuid)){await Promise.all(queryUuid.map(u2=>this.rpc("kill",[u2])));let toBeKilled=queryUuid.map(u2=>`live-${u2}`);toBeKilled.map(k=>this.emitter.emit(k,["CLOSE","killed"])),this.connection.emitter.reset({collectable:toBeKilled,listeners:toBeKilled});}else await this.rpc("kill",[queryUuid]),this.emitter.emit(`live-${queryUuid}`,["CLOSE","killed"]),this.connection.emitter.reset({collectable:`live-${queryUuid}`,listeners:`live-${queryUuid}`});}async query(...args){return (await this.queryRaw(...args)).map(({status,result})=>{if(status==="ERR")throw new ResponseError(result);return result})}async queryRaw(...[q,b]){let params=q instanceof PreparedQuery?[q.query,partiallyEncodeObject(q.bindings,{fills:b,replacer:replacer.encode})]:[q,b];await this.ready;let res=await this.rpc("query",params);if(res.error)throw new ResponseError(res.error.message);return res.result}async query_raw(...args){return this.queryRaw(...args)}async select(thing){await this.ready;let res=await this.rpc("select",[thing]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async create(thing,data){await this.ready;let res=await this.rpc("create",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async insert(arg1,arg2){await this.ready;let[table,data]=typeof arg1=="string"||arg1 instanceof Table?[arg1,arg2]:[void 0,arg1],res=await this.rpc("insert",[table,data]);if(res.error)throw new ResponseError(res.error.message);return res.result}async insertRelation(arg1,arg2){await this.ready;let[table,data]=typeof arg1=="string"||arg1 instanceof Table?[arg1,arg2]:[void 0,arg1],res=await this.rpc("insert_relation",[table,data]);if(res.error)throw new ResponseError(res.error.message);return res.result}async insert_relation(arg1,arg2){return arg1 instanceof Table||typeof arg1=="string"?this.insertRelation(arg1,arg2):this.insertRelation(arg1)}async update(thing,data){await this.ready;let res=await this.rpc("update",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async upsert(thing,data){await this.ready;let res=await this.rpc("upsert",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async merge(thing,data){await this.ready;let res=await this.rpc("merge",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async patch(thing,data,diff){await this.ready;let res=await this.rpc("patch",[thing,data,diff]);if(res.error)throw new ResponseError(res.error.message);return diff?res.result:output(thing,res.result)}async delete(thing){await this.ready;let res=await this.rpc("delete",[thing]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async version(){await this.ready;let res=await this.rpc("version");if(res.error)throw new ResponseError(res.error.message);return res.result}async run(name,arg2,arg3){await this.ready;let[version,args]=Array.isArray(arg2)?[void 0,arg2]:[arg2,arg3],res=await this.rpc("run",[name,version,args]);if(res.error)throw new ResponseError(res.error.message);return res.result}async relate(from,thing,to,data){await this.ready;let res=await this.rpc("relate",[from,thing,to,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}rpc(method,params){if(!this.connection)throw new NoActiveSocket;return this.connection.rpc({method,params})}async export(options){if(await this.ready,!this.connection)throw new NoActiveSocket;return this.connection.export(options)}async import(input){if(await this.ready,!this.connection)throw new NoActiveSocket;return this.connection.import(input)}};function output(subject,input){return subject instanceof RecordId||subject instanceof StringRecordId?Array.isArray(input)?input[0]:input:Array.isArray(input)?input:[input]}function parseUrl(value){let url=new URL(value);return url.pathname.endsWith("/rpc")||(url.pathname.endsWith("/")||(url.pathname+="/"),url.pathname+="rpc"),url}/**
|
|
343288
|
+
})();var __defProp=Object.defineProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true});};var Emitter=class{collectable={};listeners={};interceptors;constructor({interceptors}={}){this.interceptors=interceptors??{};}subscribe(event,listener,historic=false){if(this.listeners[event]||(this.listeners[event]=[]),!this.isSubscribed(event,listener)&&(this.listeners[event]?.push(listener),historic&&this.collectable[event])){let buffer=this.collectable[event];delete this.collectable[event];for(let args of buffer)listener(...args);}}async subscribeOnce(event,historic=false){if(historic&&this.collectable[event]){let args=this.collectable[event]?.shift();if(this.collectable[event]?.length===0&&delete this.collectable[event],args)return args}return new Promise(resolve=>{let resolved=false,listener=(...args)=>{resolved||(resolved=true,this.unSubscribe(event,listener),resolve(args));};this.subscribe(event,listener,false);})}unSubscribe(event,listener){if(this.listeners[event]){let index=this.listeners[event]?.findIndex(v=>v===listener);index>=0&&(this.listeners[event]?.splice(index,1),this.listeners[event]?.length===0&&delete this.listeners[event]);}}isSubscribed(event,listener){return !!this.listeners[event]?.includes(listener)}async emit(event,args,collectable=false){let interceptor=this.interceptors[event],computedArgs=interceptor?await interceptor(...args):args;(collectable&&!this.listeners[event]||this.listeners[event]?.length===0)&&(this.collectable[event]||(this.collectable[event]=[]),this.collectable[event]?.push(args));for(let listener of this.listeners[event]??[])listener(...computedArgs);}reset({collectable,listeners}){if(Array.isArray(collectable))for(let k of collectable)delete this.collectable[k];else typeof collectable=="string"?delete this.collectable[collectable]:collectable!==false&&(this.collectable={});if(Array.isArray(listeners))for(let k of listeners)delete this.listeners[k];else typeof listeners=="string"?delete this.listeners[listeners]:listeners!==false&&(this.listeners={});}scanListeners(filter){let listeners=Object.keys(this.listeners);return filter&&(listeners=listeners.filter(filter)),listeners}};var Gap=class{args=[];constructor(...args){this.args=args;}fill(value){return [this,value]}hasDefault(){return this.args.length===1}get default(){return this.args[0]}};var cbor_exports={};__export(cbor_exports,{CborBreak:()=>CborBreak,CborError:()=>CborError,CborFillMissing:()=>CborFillMissing,CborInvalidMajorError:()=>CborInvalidMajorError,CborNumberError:()=>CborNumberError,CborPartialDisabled:()=>CborPartialDisabled,CborRangeError:()=>CborRangeError,Encoded:()=>Encoded,Gap:()=>Gap,POW_2_53:()=>POW_2_53,POW_2_64:()=>POW_2_64,PartiallyEncoded:()=>PartiallyEncoded,Reader:()=>Reader,Tagged:()=>Tagged,Writer:()=>Writer,decode:()=>decode,encode:()=>encode,infiniteBytes:()=>infiniteBytes,partiallyEncodeObject:()=>partiallyEncodeObject});var POW_2_53=9007199254740992,POW_2_64=BigInt(18446744073709552e3);var Encoded=class{constructor(encoded){this.encoded=encoded;}};var SurrealDbError=class extends Error{},NoActiveSocket=class extends SurrealDbError{name="NoActiveSocket";message="No socket is currently connected to a SurrealDB instance. Please call the .connect() method first!"},NoURLProvided=class extends SurrealDbError{name="NoURLProvided";message="Tried to establish a connection while no connection URL was provided"},EngineDisconnected=class extends SurrealDbError{name="EngineDisconnected";message="The engine reported the connection to SurrealDB has dropped"},ReconnectFailed=class extends SurrealDbError{name="ReconnectFailed";message="The engine failed to reconnect to SurrealDB"},ReconnectIterationError=class extends SurrealDbError{name="ReconnectIterationError";message="The reconnect iterator failed to iterate"},UnexpectedServerResponse=class extends SurrealDbError{constructor(response){super();this.response=response;this.message=`${response}`;}name="UnexpectedServerResponse"},UnexpectedConnectionError=class extends SurrealDbError{constructor(error){super();this.error=error;this.message=`${error}`;}name="UnexpectedConnectionError"},UnsupportedEngine=class extends SurrealDbError{constructor(engine){super();this.engine=engine;}name="UnsupportedEngine";message="The engine you are trying to connect to is not supported or configured."},ConnectionUnavailable=class extends SurrealDbError{name="ConnectionUnavailable";message="There is no connection available at this moment."},MissingNamespaceDatabase=class extends SurrealDbError{name="MissingNamespaceDatabase";message="There is no namespace and/or database selected."},HttpConnectionError=class extends SurrealDbError{constructor(message,status,statusText,buffer){super();this.message=message;this.status=status;this.statusText=statusText;this.buffer=buffer;}name="HttpConnectionError"},ResponseError=class extends SurrealDbError{constructor(message){super();this.message=message;}name="ResponseError"},NoNamespaceSpecified=class extends SurrealDbError{name="NoNamespaceSpecified";message="Please specify a namespace to use."},NoDatabaseSpecified=class extends SurrealDbError{name="NoDatabaseSpecified";message="Please specify a database to use."},NoTokenReturned=class extends SurrealDbError{name="NoTokenReturned";message="Did not receive an authentication token."},UnsupportedVersion=class extends SurrealDbError{name="UnsupportedVersion";version;supportedRange;constructor(version,supportedRange){super(),this.version=version,this.supportedRange=supportedRange,this.message=`The version "${version}" reported by the engine is not supported by this library, expected a version that satisfies "${supportedRange}".`;}},VersionRetrievalFailure=class extends SurrealDbError{constructor(error){super();this.error=error;}name="VersionRetrievalFailure";message="Failed to retrieve remote version. If the server is behind a proxy, make sure it's configured correctly."};var CborError=class extends SurrealDbError{message;constructor(message){super(),this.message=message;}},CborNumberError=class extends CborError{name="CborNumberError"},CborRangeError=class extends CborError{name="CborRangeError"},CborInvalidMajorError=class extends CborError{name="CborInvalidMajorError"},CborBreak=class extends CborError{name="CborBreak";constructor(){super("Came across a break which was not intercepted by the decoder");}},CborPartialDisabled=class extends CborError{name="CborPartialDisabled";constructor(){super("Tried to insert a Gap into a CBOR value, while partial mode is not enabled");}},CborFillMissing=class extends CborError{name="CborFillMissing";constructor(){super("Fill for a gap is missing, and gap has no default");}};var Writer=class{constructor(byteLength=256){this.byteLength=byteLength;this._buf=new ArrayBuffer(this.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf);}_chunks=[];_pos=0;_buf;_view;_byte;chunk(gap){this._chunks.push([this._buf.slice(0,this._pos),gap]),this._buf=new ArrayBuffer(this.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._pos=0;}get chunks(){return this._chunks}get buffer(){return this._buf.slice(0,this._pos)}claim(length){let pos=this._pos;if(this._pos+=length,this._pos<=this._buf.byteLength)return pos;let newLen=this._buf.byteLength<<1;for(;newLen<this._pos;)newLen<<=1;if(newLen>this._buf.byteLength){let oldb=this._byte;this._buf=new ArrayBuffer(newLen),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._byte.set(oldb);}return pos}writeUint8(value){let pos=this.claim(1);this._view.setUint8(pos,value);}writeUint16(value){let pos=this.claim(2);this._view.setUint16(pos,value);}writeUint32(value){let pos=this.claim(4);this._view.setUint32(pos,value);}writeUint64(value){let pos=this.claim(8);this._view.setBigUint64(pos,value);}writeUint8Array(data){if(data.byteLength===0)return;let pos=this.claim(data.byteLength);this._byte.set(data,pos);}writeArrayBuffer(data){data.byteLength!==0&&this.writeUint8Array(new Uint8Array(data));}writePartiallyEncoded(data){for(let[buf,gap]of data.chunks)this.writeArrayBuffer(buf),this.chunk(gap);this.writeArrayBuffer(data.end);}writeFloat32(value){let pos=this.claim(4);this._view.setFloat32(pos,value);}writeFloat64(value){let pos=this.claim(8);this._view.setFloat64(pos,value);}writeMajor(type,length){let base=type<<5;length<24?this.writeUint8(base+Number(length)):length<256?(this.writeUint8(base+24),this.writeUint8(Number(length))):length<65536?(this.writeUint8(base+25),this.writeUint16(Number(length))):length<4294967296?(this.writeUint8(base+26),this.writeUint32(Number(length))):(this.writeUint8(base+27),this.writeUint64(BigInt(length)));}output(partial,replacer2){return partial?new PartiallyEncoded(this._chunks,this.buffer,replacer2):this.buffer}};var PartiallyEncoded=class{constructor(chunks,end,replacer2){this.chunks=chunks;this.end=end;this.replacer=replacer2;}build(fills,partial){let writer=new Writer,map=new Map(fills);for(let[buffer,gap]of this.chunks){let hasValue=map.has(gap)||gap.hasDefault();if(!partial&&!hasValue)throw new CborFillMissing;if(writer.writeArrayBuffer(buffer),hasValue){let data=map.get(gap)??gap.default;encode(data,{writer,replacer:this.replacer});}else writer.chunk(gap);}return writer.writeArrayBuffer(this.end),writer.output(!!partial,this.replacer)}};function partiallyEncodeObject(object,options){return Object.fromEntries(Object.entries(object).map(([k,v])=>[k,encode(v,{...options,partial:true})]))}var Tagged=class{constructor(tag,value){this.tag=tag;this.value=value;}};var textEncoder;function encode(input,options={}){let w=options.writer??new Writer,fillsMap=new Map(options.fills??[]);function inner(input2){let value=options.replacer?options.replacer(input2):input2;if(value===void 0)return w.writeUint8(247);if(value===null)return w.writeUint8(246);if(value===true)return w.writeUint8(245);if(value===false)return w.writeUint8(244);switch(typeof value){case "number":{if(Number.isInteger(value))if(value>=0&&value<=9007199254740992)w.writeMajor(0,value);else if(value<0&&value>=-9007199254740992)w.writeMajor(1,-(value+1));else throw new CborNumberError("Number too big to be encoded");else w.writeUint8(251),w.writeFloat64(value);return}case "bigint":{if(value>=0&&value<POW_2_64)w.writeMajor(0,value);else if(value<=0&&value>=-POW_2_64)w.writeMajor(1,-(value+1n));else throw new CborNumberError("BigInt too big to be encoded");return}case "string":{textEncoder??=new TextEncoder;let encoded=textEncoder.encode(value);w.writeMajor(3,encoded.byteLength),w.writeUint8Array(encoded);return}default:{if(Array.isArray(value)){w.writeMajor(4,value.length);for(let v of value)inner(v);return}if(value instanceof Tagged){w.writeMajor(6,value.tag),inner(value.value);return}if(value instanceof Encoded){w.writeArrayBuffer(value.encoded);return}if(value instanceof Gap){if(fillsMap.has(value))inner(fillsMap.get(value));else {if(!options.partial)throw new CborPartialDisabled;w.chunk(value);}return}if(value instanceof PartiallyEncoded){let res=value.build(options.fills??[],options.partial);options.partial?w.writePartiallyEncoded(res):w.writeArrayBuffer(res);return}if(value instanceof Uint8Array||value instanceof Uint16Array||value instanceof Uint32Array||value instanceof Int8Array||value instanceof Int16Array||value instanceof Int32Array||value instanceof Float32Array||value instanceof Float64Array||value instanceof ArrayBuffer){let v=new Uint8Array(value);w.writeMajor(2,v.byteLength),w.writeUint8Array(v);return}let entries=value instanceof Map?Array.from(value.entries()):Object.entries(value);w.writeMajor(5,entries.length);for(let v of entries.flat())inner(v);}}}return inner(input),w.output(!!options.partial,options.replacer)}var Reader=class{_buf;_view;_byte;_pos=0;constructor(buffer){this._buf=new ArrayBuffer(buffer.byteLength),this._view=new DataView(this._buf),this._byte=new Uint8Array(this._buf),this._byte.set(new Uint8Array(buffer));}read(amount,res){return this._pos+=amount,res}readUint8(){try{return this.read(1,this._view.getUint8(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint16(){try{return this.read(2,this._view.getUint16(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint32(){try{return this.read(4,this._view.getUint32(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readUint64(){try{return this.read(8,this._view.getBigUint64(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readFloat16(){let bytes=this.readUint16(),s2=(bytes&32768)>>15,e=(bytes&31744)>>10,f2=bytes&1023;return e===0?(s2?-1:1)*2**-14*(f2/2**10):e===31?f2?Number.NaN:(s2?-1:1)*Number.POSITIVE_INFINITY:(s2?-1:1)*2**(e-15)*(1+f2/2**10)}readFloat32(){try{return this.read(4,this._view.getFloat32(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readFloat64(){try{return this.read(8,this._view.getFloat64(this._pos))}catch(e){throw e instanceof RangeError?new CborRangeError(e.message):e}}readBytes(amount){let available=this._byte.length-this._pos;if(available<amount)throw new CborRangeError(`The argument must be between 0 and ${available}`);return this.read(amount,this._byte.slice(this._pos,this._pos+amount))}readMajor(){let byte=this.readUint8(),major=byte>>5;if(major<0||major>7)throw new CborInvalidMajorError("Received invalid major type");return [major,byte&31]}readMajorLength(length){if(length<=23)return length;switch(length){case 24:return this.readUint8();case 25:return this.readUint16();case 26:return this.readUint32();case 27:{let read=this.readUint64();return read>9007199254740992?read:Number(read)}}throw new CborRangeError("Expected a final length")}};function infiniteBytes(r2,forMajor){let w=new Writer;for(;;){let[major,len]=r2.readMajor();if(major===7&&len===31)break;if(major!==forMajor)throw new CborInvalidMajorError(`Expected a resource of the same major (${forMajor}) while processing an infinite resource`);if(len===31)throw new CborRangeError("Expected a finite resource while processing an infinite resource");w.writeUint8Array(r2.readBytes(Number(r2.readMajorLength(len))));}return w.buffer}var textDecoder;function decode(input,options={}){let r2=input instanceof Reader?input:new Reader(input);function inner(){let[major,len]=r2.readMajor();switch(major){case 0:return r2.readMajorLength(len);case 1:{let l=r2.readMajorLength(len);return typeof l=="bigint"?-(l+1n):-(l+1)}case 2:return len===31?infiniteBytes(r2,2):r2.readBytes(Number(r2.readMajorLength(len))).buffer;case 3:{let encoded=len===31?infiniteBytes(r2,3):r2.readBytes(Number(r2.readMajorLength(len)));return textDecoder??=new TextDecoder,textDecoder.decode(encoded)}case 4:{if(len===31){let arr2=[];for(;;)try{arr2.push(decode2());}catch(e){if(e instanceof CborBreak)break;throw e}return arr2}let l=r2.readMajorLength(len),arr=Array(l);for(let i=0;i<l;i++)arr[i]=decode2();return arr}case 5:{let entries=[];if(len===31)for(;;){let key;try{key=decode2();}catch(e){if(e instanceof CborBreak)break;throw e}let value=decode2();entries.push([key,value]);}else {let l=r2.readMajorLength(len);for(let i=0;i<l;i++){let key=decode2(),value=decode2();entries[i]=[key,value];}}return options.map==="map"?new Map(entries):Object.fromEntries(entries)}case 6:{let tag=r2.readMajorLength(len),value=decode2();return new Tagged(tag,value)}case 7:switch(len){case 20:return false;case 21:return true;case 22:return null;case 23:return;case 25:return r2.readFloat16();case 26:return r2.readFloat32();case 27:return r2.readFloat64();case 31:throw new CborBreak}}throw new CborInvalidMajorError(`Unable to decode value with major tag ${major}`)}function decode2(){return options.replacer?options.replacer(inner()):inner()}return decode2()}function dateToCborCustomDate(date){let s2=Math.floor(date.getTime()/1e3),ms=date.getTime()-s2*1e3;return [s2,ms*1e6]}function cborCustomDateToDate([s2,ns]){let date=new Date(0);return date.setUTCSeconds(Number(s2)),date.setMilliseconds(Math.floor(Number(ns)/1e6)),date}var Value=class{};var Decimal=class _Decimal extends Value{decimal;constructor(decimal){super(),this.decimal=decimal.toString();}equals(other){return other instanceof _Decimal?this.decimal===other.decimal:false}toString(){return this.decimal}toJSON(){return this.decimal}};var millisecond=1,microsecond=millisecond/1e3,nanosecond=microsecond/1e3,second=1e3*millisecond,minute=60*second,hour=60*minute,day=24*hour,week=7*day,units=new Map([["ns",nanosecond],["\xB5s",microsecond],["\u03BCs",microsecond],["us",microsecond],["ms",millisecond],["s",second],["m",minute],["h",hour],["d",day],["w",week]]),unitsReverse=Array.from(units).reduce((map,[unit,size])=>(map.set(size,unit),map),new Map),durationPartRegex=new RegExp(`^(\\d+)(${Array.from(units.keys()).join("|")})`),Duration=class _Duration extends Value{_milliseconds;constructor(input){super(),input instanceof _Duration?this._milliseconds=input._milliseconds:typeof input=="string"?this._milliseconds=_Duration.parseString(input):this._milliseconds=input;}static fromCompact([s2,ns]){s2=s2??0,ns=ns??0;let ms=s2*1e3+ns/1e6;return new _Duration(ms)}equals(other){return other instanceof _Duration?this._milliseconds===other._milliseconds:false}toCompact(){let s2=Math.floor(this._milliseconds/1e3),ns=Math.floor((this._milliseconds-s2*1e3)*1e6);return ns>0?[s2,ns]:s2>0?[s2]:[]}toString(){let left=this._milliseconds,result="";function scrap(size){let num=Math.floor(left/size);return num>0&&(left=left%size),num}for(let[size,unit]of Array.from(unitsReverse).reverse()){let scrapped=scrap(size);scrapped>0&&(result+=`${scrapped}${unit}`);}return result}toJSON(){return this.toString()}static parseString(input){let ms=0,left=input;for(;left!=="";){let match=left.match(durationPartRegex);if(match){let amount=Number.parseInt(match[1]),factor=units.get(match[2]);if(factor===void 0)throw new SurrealDbError(`Invalid duration unit: ${match[2]}`);ms+=amount*factor,left=left.slice(match[0].length);continue}throw new SurrealDbError("Could not match a next duration part")}return ms}static nanoseconds(nanoseconds){return new _Duration(Math.floor(nanoseconds*nanosecond))}static microseconds(microseconds){return new _Duration(Math.floor(microseconds*microsecond))}static milliseconds(milliseconds){return new _Duration(milliseconds)}static seconds(seconds){return new _Duration(seconds*second)}static minutes(minutes){return new _Duration(minutes*minute)}static hours(hours){return new _Duration(hours*hour)}static days(days){return new _Duration(days*day)}static weeks(weeks){return new _Duration(weeks*week)}get microseconds(){return Math.floor(this._milliseconds/microsecond)}get nanoseconds(){return Math.floor(this._milliseconds/nanosecond)}get milliseconds(){return Math.floor(this._milliseconds)}get seconds(){return Math.floor(this._milliseconds/second)}get minutes(){return Math.floor(this._milliseconds/minute)}get hours(){return Math.floor(this._milliseconds/hour)}get days(){return Math.floor(this._milliseconds/day)}get weeks(){return Math.floor(this._milliseconds/week)}};var Future=class _Future extends Value{constructor(inner){super();this.inner=inner;}equals(other){return other instanceof _Future?this.inner===other.inner:false}toJSON(){return this.toString()}toString(){return `<future> ${this.inner}`}};var Geometry=class _Geometry extends Value{equals(other){return other instanceof _Geometry?this.is(other):false}toString(){return JSON.stringify(this.toJSON())}};function f(num){return num instanceof Decimal?Number.parseFloat(num.decimal):num}var GeometryPoint=class _GeometryPoint extends Geometry{point;constructor(point){super(),point instanceof _GeometryPoint?this.point=point.clone().point:this.point=[f(point[0]),f(point[1])];}toJSON(){return {type:"Point",coordinates:this.coordinates}}get coordinates(){return this.point}is(geometry){return geometry instanceof _GeometryPoint?this.point[0]===geometry.point[0]&&this.point[1]===geometry.point[1]:false}clone(){return new _GeometryPoint([...this.point])}},GeometryLine=class _GeometryLine extends Geometry{line;constructor(line){super(),this.line=line instanceof _GeometryLine?line.clone().line:line;}toJSON(){return {type:"LineString",coordinates:this.coordinates}}get coordinates(){return this.line.map(g=>g.coordinates)}close(){this.line[0].is(this.line.at(-1))||this.line.push(this.line[0]);}is(geometry){if(!(geometry instanceof _GeometryLine)||this.line.length!==geometry.line.length)return false;for(let i=0;i<this.line.length;i++)if(!this.line[i].is(geometry.line[i]))return false;return true}clone(){return new _GeometryLine(this.line.map(p=>p.clone()))}},GeometryPolygon=class _GeometryPolygon extends Geometry{polygon;constructor(polygon){super(),this.polygon=polygon instanceof _GeometryPolygon?polygon.clone().polygon:polygon.map(l=>{let line=l.clone();return line.close(),line});}toJSON(){return {type:"Polygon",coordinates:this.coordinates}}get coordinates(){return this.polygon.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryPolygon)||this.polygon.length!==geometry.polygon.length)return false;for(let i=0;i<this.polygon.length;i++)if(!this.polygon[i].is(geometry.polygon[i]))return false;return true}clone(){return new _GeometryPolygon(this.polygon.map(p=>p.clone()))}},GeometryMultiPoint=class _GeometryMultiPoint extends Geometry{points;constructor(points){super(),this.points=points instanceof _GeometryMultiPoint?points.points:points;}toJSON(){return {type:"MultiPoint",coordinates:this.coordinates}}get coordinates(){return this.points.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiPoint)||this.points.length!==geometry.points.length)return false;for(let i=0;i<this.points.length;i++)if(!this.points[i].is(geometry.points[i]))return false;return true}clone(){return new _GeometryMultiPoint(this.points.map(p=>p.clone()))}},GeometryMultiLine=class _GeometryMultiLine extends Geometry{lines;constructor(lines){super(),this.lines=lines instanceof _GeometryMultiLine?lines.lines:lines;}toJSON(){return {type:"MultiLineString",coordinates:this.coordinates}}get coordinates(){return this.lines.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiLine)||this.lines.length!==geometry.lines.length)return false;for(let i=0;i<this.lines.length;i++)if(!this.lines[i].is(geometry.lines[i]))return false;return true}clone(){return new _GeometryMultiLine(this.lines.map(p=>p.clone()))}},GeometryMultiPolygon=class _GeometryMultiPolygon extends Geometry{polygons;constructor(polygons){super(),this.polygons=polygons instanceof _GeometryMultiPolygon?polygons.polygons:polygons;}toJSON(){return {type:"MultiPolygon",coordinates:this.coordinates}}get coordinates(){return this.polygons.map(g=>g.coordinates)}is(geometry){if(!(geometry instanceof _GeometryMultiPolygon)||this.polygons.length!==geometry.polygons.length)return false;for(let i=0;i<this.polygons.length;i++)if(!this.polygons[i].is(geometry.polygons[i]))return false;return true}clone(){return new _GeometryMultiPolygon(this.polygons.map(p=>p.clone()))}},GeometryCollection=class _GeometryCollection extends Geometry{collection;constructor(collection){super(),this.collection=collection instanceof _GeometryCollection?collection.collection:collection;}toJSON(){return {type:"GeometryCollection",geometries:this.geometries}}get geometries(){return this.collection.map(g=>g.toJSON())}is(geometry){if(!(geometry instanceof _GeometryCollection)||this.collection.length!==geometry.collection.length)return false;for(let i=0;i<this.collection.length;i++)if(!this.collection[i].is(geometry.collection[i]))return false;return true}clone(){return new _GeometryCollection(this.collection.map(p=>p.clone()))}};function equals(x,y){if(Object.is(x,y))return true;if(x instanceof Date&&y instanceof Date)return x.getTime()===y.getTime();if(x instanceof RegExp&&y instanceof RegExp)return x.toString()===y.toString();if(x instanceof Value&&y instanceof Value)return x.equals(y);if(typeof x!="object"||x===null||typeof y!="object"||y===null)return false;let keysX=Reflect.ownKeys(x),keysY=Reflect.ownKeys(y);if(keysX.length!==keysY.length)return false;for(let i=0;i<keysX.length;i++)if(!Reflect.has(y,keysX[i])||!equals(x[keysX[i]],y[keysX[i]]))return false;return true}var MAX_i64=9223372036854775807n;function escapeIdent(str){if(isOnlyNumbers(str))return `\u27E8${str}\u27E9`;if(str==="")return "\u27E8\u27E9";let code,i,len;for(i=0,len=str.length;i<len;i++)if(code=str.charCodeAt(i),!(code>47&&code<58)&&!(code>64&&code<91)&&!(code>96&&code<123)&&code!==95)return `\u27E8${str.replaceAll("\u27E9","\\\u27E9")}\u27E9`;return str}function escapeNumber(num){return num<=MAX_i64?num.toString():`\u27E8${num}\u27E9`}function isOnlyNumbers(str){return /^\d+$/.test(str.replace(/_/g,""))}var Uuid=class _Uuid extends Value{inner;constructor(uuid){super(),uuid instanceof ArrayBuffer?this.inner=UUID.ofInner(new Uint8Array(uuid)):uuid instanceof Uint8Array?this.inner=UUID.ofInner(uuid):uuid instanceof _Uuid?this.inner=uuid.inner:uuid instanceof UUID?this.inner=uuid:this.inner=UUID.parse(uuid);}equals(other){return other instanceof _Uuid?this.inner.equals(other.inner):false}toString(){return this.inner.toString()}toJSON(){return this.inner.toString()}toUint8Array(){return this.inner.bytes}toBuffer(){return this.inner.bytes.buffer}static v4(){return new _Uuid(uuidv4obj())}static v7(){return new _Uuid(uuidv7obj())}};var RecordId=class _RecordId extends Value{tb;id;constructor(tb,id2){if(super(),typeof tb!="string")throw new SurrealDbError("TB part is not valid");if(!isValidIdPart(id2))throw new SurrealDbError("ID part is not valid");this.tb=tb,this.id=id2;}equals(other){return other instanceof _RecordId?this.tb===other.tb&&equals(this.id,other.id):false}toJSON(){return this.toString()}toString(){let tb=escapeIdent(this.tb),id2=escapeIdPart(this.id);return `${tb}:${id2}`}},StringRecordId=class _StringRecordId extends Value{rid;constructor(rid){if(super(),rid instanceof _StringRecordId)this.rid=rid.rid;else if(rid instanceof RecordId)this.rid=rid.toString();else if(typeof rid=="string")this.rid=rid;else throw new SurrealDbError("String Record ID must be a string")}equals(other){return other instanceof _StringRecordId?this.rid===other.rid:false}toJSON(){return this.rid}toString(){return this.rid}};function isValidIdPart(v){if(v instanceof Uuid)return true;switch(typeof v){case "string":case "number":case "bigint":return true;case "object":return Array.isArray(v)||v!==null;default:return false}}function escapeIdPart(id2){return id2 instanceof Uuid?`u"${id2}"`:typeof id2=="string"?escapeIdent(id2):typeof id2=="bigint"||typeof id2=="number"?escapeNumber(id2):toSurrealqlString(id2)}var Table=class _Table extends Value{tb;constructor(tb){if(super(),typeof tb!="string")throw new SurrealDbError("Table must be a string");this.tb=tb;}equals(other){return other instanceof _Table?this.tb===other.tb:false}toJSON(){return this.tb}toString(){return this.tb}};function toSurrealqlString(input){if(typeof input=="string")return `s${JSON.stringify(input)}`;if(input===null)return "NULL";if(input===void 0)return "NONE";if(typeof input=="object"){if(input instanceof Date)return `d${JSON.stringify(input.toISOString())}`;if(input instanceof Uuid)return `u${JSON.stringify(input.toString())}`;if(input instanceof RecordId||input instanceof StringRecordId)return `r${JSON.stringify(input.toString())}`;if(input instanceof Geometry)return toSurrealqlString(input.toJSON());if(input instanceof Decimal||input instanceof Duration||input instanceof Future||input instanceof Range||input instanceof Table)return input.toJSON();switch(Object.getPrototypeOf(input)){case Object.prototype:{let output2="{ ",entries=Object.entries(input);for(let[i,[k,v]]of entries.entries())output2+=`${JSON.stringify(k)}: ${toSurrealqlString(v)}`,i<entries.length-1&&(output2+=", ");return output2+=" }",output2}case Map.prototype:{let output2="{ ",entries=Array.from(input.entries());for(let[i,[k,v]]of entries.entries())output2+=`${JSON.stringify(k)}: ${toSurrealqlString(v)}`,i<entries.length-1&&(output2+=", ");return output2+=" }",output2}case Array.prototype:return `[ ${input.map(toSurrealqlString).join(", ")} ]`;case Set.prototype:return `[ ${[...new Set([...input].map(toSurrealqlString))].join(", ")} ]`}}return `${input}`}var Range=class _Range extends Value{constructor(beg,end){super();this.beg=beg;this.end=end;}equals(other){return !(other instanceof _Range)||this.beg?.constructor!==other.beg?.constructor||this.end?.constructor!==other.end?.constructor?false:equals(this.beg?.value,other.beg?.value)&&equals(this.end?.value,other.end?.value)}toJSON(){return this.toString()}toString(){let beg=escapeRangeBound(this.beg),end=escapeRangeBound(this.end);return `${beg}${getRangeJoin(this.beg,this.end)}${end}`}},BoundIncluded=class{constructor(value){this.value=value;}},BoundExcluded=class{constructor(value){this.value=value;}},RecordIdRange=class _RecordIdRange extends Value{constructor(tb,beg,end){super();this.tb=tb;this.beg=beg;this.end=end;if(typeof tb!="string")throw new SurrealDbError("TB part is not valid");if(!isValidIdBound(beg))throw new SurrealDbError("Beg part is not valid");if(!isValidIdBound(end))throw new SurrealDbError("End part is not valid")}equals(other){return !(other instanceof _RecordIdRange)||this.beg?.constructor!==other.beg?.constructor||this.end?.constructor!==other.end?.constructor?false:this.tb===other.tb&&equals(this.beg?.value,other.beg?.value)&&equals(this.end?.value,other.end?.value)}toJSON(){return this.toString()}toString(){let tb=escapeIdent(this.tb),beg=escapeIdBound(this.beg),end=escapeIdBound(this.end);return `${tb}:${beg}${getRangeJoin(this.beg,this.end)}${end}`}};function getRangeJoin(beg,end){let output2="";return beg instanceof BoundExcluded&&(output2+=">"),output2+="..",end instanceof BoundIncluded&&(output2+="="),output2}function isValidIdBound(bound){return bound instanceof BoundIncluded||bound instanceof BoundExcluded?isValidIdPart(bound.value):true}function escapeIdBound(bound){return bound instanceof BoundIncluded||bound instanceof BoundExcluded?escapeIdPart(bound.value):""}function escapeRangeBound(bound){if(bound===void 0)return "";let value=bound.value;return bound instanceof Range?`(${toSurrealqlString(value)})`:toSurrealqlString(value)}function rangeToCbor([beg,end]){function encodeBound(bound){return bound instanceof BoundIncluded?new Tagged(TAG_BOUND_INCLUDED,bound.value):bound instanceof BoundExcluded?new Tagged(TAG_BOUND_EXCLUDED,bound.value):null}return [encodeBound(beg),encodeBound(end)]}function cborToRange(range){function decodeBound(bound){if(bound!==null){if(bound instanceof BoundIncluded||bound instanceof BoundExcluded)return bound;throw new SurrealDbError("Expected the bounds to be decoded already")}}return [decodeBound(range[0]),decodeBound(range[1])]}var TAG_SPEC_DATETIME=0,TAG_SPEC_UUID=37,TAG_NONE=6,TAG_TABLE=7,TAG_RECORDID=8,TAG_STRING_UUID=9,TAG_STRING_DECIMAL=10,TAG_CUSTOM_DATETIME=12,TAG_STRING_DURATION=13,TAG_CUSTOM_DURATION=14,TAG_FUTURE=15,TAG_RANGE=49,TAG_BOUND_INCLUDED=50,TAG_BOUND_EXCLUDED=51,TAG_GEOMETRY_POINT=88,TAG_GEOMETRY_LINE=89,TAG_GEOMETRY_POLYGON=90,TAG_GEOMETRY_MULTIPOINT=91,TAG_GEOMETRY_MULTILINE=92,TAG_GEOMETRY_MULTIPOLYGON=93,TAG_GEOMETRY_COLLECTION=94,replacer={encode(v){return v instanceof Date?new Tagged(TAG_CUSTOM_DATETIME,dateToCborCustomDate(v)):v===void 0?new Tagged(TAG_NONE,null):v instanceof Uuid?new Tagged(TAG_SPEC_UUID,v.toBuffer()):v instanceof Decimal?new Tagged(TAG_STRING_DECIMAL,v.toString()):v instanceof Duration?new Tagged(TAG_CUSTOM_DURATION,v.toCompact()):v instanceof RecordId?new Tagged(TAG_RECORDID,[v.tb,v.id]):v instanceof StringRecordId?new Tagged(TAG_RECORDID,v.rid):v instanceof RecordIdRange?new Tagged(TAG_RECORDID,[v.tb,new Tagged(TAG_RANGE,rangeToCbor([v.beg,v.end]))]):v instanceof Table?new Tagged(TAG_TABLE,v.tb):v instanceof Future?new Tagged(TAG_FUTURE,v.inner):v instanceof Range?new Tagged(TAG_RANGE,rangeToCbor([v.beg,v.end])):v instanceof GeometryPoint?new Tagged(TAG_GEOMETRY_POINT,v.point):v instanceof GeometryLine?new Tagged(TAG_GEOMETRY_LINE,v.line):v instanceof GeometryPolygon?new Tagged(TAG_GEOMETRY_POLYGON,v.polygon):v instanceof GeometryMultiPoint?new Tagged(TAG_GEOMETRY_MULTIPOINT,v.points):v instanceof GeometryMultiLine?new Tagged(TAG_GEOMETRY_MULTILINE,v.lines):v instanceof GeometryMultiPolygon?new Tagged(TAG_GEOMETRY_MULTIPOLYGON,v.polygons):v instanceof GeometryCollection?new Tagged(TAG_GEOMETRY_COLLECTION,v.collection):v},decode(v){if(!(v instanceof Tagged))return v;switch(v.tag){case TAG_SPEC_DATETIME:return new Date(v.value);case TAG_SPEC_UUID:case TAG_STRING_UUID:return new Uuid(v.value);case TAG_CUSTOM_DATETIME:return cborCustomDateToDate(v.value);case TAG_NONE:return;case TAG_STRING_DECIMAL:return new Decimal(v.value);case TAG_STRING_DURATION:return new Duration(v.value);case TAG_CUSTOM_DURATION:return Duration.fromCompact(v.value);case TAG_TABLE:return new Table(v.value);case TAG_FUTURE:return new Future(v.value);case TAG_RANGE:return new Range(...cborToRange(v.value));case TAG_BOUND_INCLUDED:return new BoundIncluded(v.value);case TAG_BOUND_EXCLUDED:return new BoundExcluded(v.value);case TAG_RECORDID:return v.value[1]instanceof Range?new RecordIdRange(v.value[0],v.value[1].beg,v.value[1].end):new RecordId(v.value[0],v.value[1]);case TAG_GEOMETRY_POINT:return new GeometryPoint(v.value);case TAG_GEOMETRY_LINE:return new GeometryLine(v.value);case TAG_GEOMETRY_POLYGON:return new GeometryPolygon(v.value);case TAG_GEOMETRY_MULTIPOINT:return new GeometryMultiPoint(v.value);case TAG_GEOMETRY_MULTILINE:return new GeometryMultiLine(v.value);case TAG_GEOMETRY_MULTIPOLYGON:return new GeometryMultiPolygon(v.value);case TAG_GEOMETRY_COLLECTION:return new GeometryCollection(v.value)}}};Object.freeze(replacer);function encodeCbor(data){return encode(data,{replacer:replacer.encode})}function decodeCbor(data){return decode(data,{replacer:replacer.decode})}var textEncoder2,PreparedQuery=class{_query;_bindings;length;constructor(query,bindings){textEncoder2??=new TextEncoder,this._query=textEncoder2.encode(query),this._bindings=partiallyEncodeObject(bindings??{},{replacer:replacer.encode}),this.length=Object.keys(this._bindings).length;}get query(){let w=new Writer(this._query.byteLength+9);return w.writeMajor(3,this._query.byteLength),w.writeUint8Array(this._query),new Encoded(w.output(false))}get bindings(){return this._bindings}build(fills){return encode([this.query,this.bindings],{fills})}append(query_raw,...values){let base=this.length;this.length+=values.length;let reused=0,gaps=new Map,mapped_bindings=values.map((v,i)=>{if(v instanceof Gap){let index=gaps.get(v);if(index!==void 0)return reused++,[`bind___${index}`,v];gaps.set(v,i-reused);}return [`bind___${base+i-reused}`,v]});for(let[k,v]of mapped_bindings)this._bindings[k]=encode(v,{replacer:replacer.encode,partial:true});let query=query_raw.flatMap((segment,i)=>{let variable=mapped_bindings[i]?.[0];return [segment,...variable?[`$${variable}`]:[]]}).join("");textEncoder2??=new TextEncoder;let current=new Uint8Array(this._query),added=textEncoder2.encode(query);return this._query=new Uint8Array(current.byteLength+added.byteLength),this._query.set(current),this._query.set(added,current.byteLength),this}};function convertAuth(params){let result={},convertString=(a,b,optional)=>{if(a in params)result[b]=`${params[a]}`,delete result[a];else if(optional!==true)throw new SurrealDbError(`Key ${a} is missing from the authentication parameters`)};return "scope"in params?(result={...params},convertString("scope","sc"),convertString("namespace","ns"),convertString("database","db")):"variables"in params?(result={...params.variables},convertString("access","ac"),convertString("namespace","ns"),convertString("database","db")):(convertString("access","ac",true),convertString("database","db",true),convertString("namespace","ns",!("database"in params)),convertString("username","user"),convertString("password","pass")),result}var liveActions=["CREATE","UPDATE","DELETE"];function isLiveResult(v){return !(typeof v!="object"||v===null||!("id"in v&&"action"in v&&"result"in v)||!(v.id instanceof Uuid)||!liveActions.includes(v.action)||typeof v.result!="object"||v.result===null)}var DEFAULT_RECONNECT_OPTIONS={enabled:true,attempts:5,retryDelay:1e3,retryDelayMax:6e4,retryDelayMultiplier:2,retryDelayJitter:.1};var defaultVersionCheckTimeout=5e3,supportedSurrealDbVersionMin="1.4.2",supportedSurrealDbVersionUntil="3.0.0";function versionCheck(version,min=supportedSurrealDbVersionMin,until=supportedSurrealDbVersionUntil){if(!isVersionSupported(version,min,until))throw new UnsupportedVersion(version,`>= ${min} < ${until}`);return true}function isVersionSupported(version,min=supportedSurrealDbVersionMin,until=supportedSurrealDbVersionUntil){return min.localeCompare(version,void 0,{numeric:true})<=0&&until.localeCompare(version,void 0,{numeric:true})===1}async function retrieveRemoteVersion(url,timeout){let protocol={"ws:":"http:","wss:":"https:","http:":"http:","https:":"https:"}[url.protocol];if(protocol){let basepath=url.pathname.slice(0,-4);url=new URL(url),url.pathname=`${basepath}/version`,url.protocol=protocol;let controller=new AbortController,id2=setTimeout(()=>controller.abort(),timeout??defaultVersionCheckTimeout),versionPrefix="surrealdb-";return await fetch(url,{signal:controller.signal}).then(res=>res.text()).then(version2=>version2.slice(versionPrefix.length)).catch(e=>{throw new VersionRetrievalFailure(e)}).finally(()=>{clearTimeout(id2);})}throw new VersionRetrievalFailure}var id=0;function getIncrementalID(){return id=(id+1)%Number.MAX_SAFE_INTEGER,id.toString()}var RetryMessage=Symbol("RetryMessage"),ConnectionStatus=(ConnectionStatus2=>(ConnectionStatus2.Disconnected="disconnected",ConnectionStatus2.Connecting="connecting",ConnectionStatus2.Reconnecting="reconnecting",ConnectionStatus2.Connected="connected",ConnectionStatus2.Error="error",ConnectionStatus2))(ConnectionStatus||{}),EngineContext=class{emitter;encodeCbor;decodeCbor;reconnect;prepare;constructor({emitter,encodeCbor:encodeCbor2,decodeCbor:decodeCbor2,reconnect,prepare}){this.emitter=emitter,this.encodeCbor=encodeCbor2,this.decodeCbor=decodeCbor2,this.reconnect=reconnect,this.prepare=prepare;}},AbstractEngine=class{context;ready;status="disconnected";connection={url:void 0,namespace:void 0,database:void 0,token:void 0};constructor(context){this.context=context;}get emitter(){return this.context.emitter}get encodeCbor(){return this.context.encodeCbor}get decodeCbor(){return this.context.decodeCbor}};function processAuthVars(vars,fallback){if("scope"in vars||"access"in vars&&"variables"in vars&&vars.variables){if(!vars.namespace){if(!fallback?.namespace)throw new NoNamespaceSpecified;vars.namespace=fallback.namespace;}if(!vars.database){if(!fallback?.database)throw new NoDatabaseSpecified;vars.database=fallback.database;}}return vars}var AuthController=class{async signup(vars){if(!this.connection)throw new NoActiveSocket;let parsed=processAuthVars(vars,this.connection.connection),converted=convertAuth(parsed),res=await this.rpc("signup",[converted]);if(res.error)throw new ResponseError(res.error.message);if(!res.result)throw new NoTokenReturned;return res.result}async signin(vars){if(!this.connection)throw new NoActiveSocket;let parsed=processAuthVars(vars,this.connection.connection),converted=convertAuth(parsed),res=await this.rpc("signin",[converted]);if(res.error)throw new ResponseError(res.error.message);if(!res.result)throw new NoTokenReturned;return res.result}async authenticate(token){let res=await this.rpc("authenticate",[token]);if(res.error)throw new ResponseError(res.error.message);return true}async invalidate(){let res=await this.rpc("invalidate");if(res.error)throw new ResponseError(res.error.message);return true}},EngineAuth=class extends AuthController{constructor(connection){super();this.connection=connection;}rpc(method,params){if(!this.connection)throw new NoActiveSocket;return this.connection.rpc({method,params},true)}};var AbstractRemoteEngine=class extends AbstractEngine{async req_post(body,url,headers_){let headers={"Content-Type":"application/cbor",Accept:"application/cbor",...headers_};this.connection.namespace&&(headers["Surreal-NS"]=this.connection.namespace),this.connection.database&&(headers["Surreal-DB"]=this.connection.database),this.connection.token&&(headers.Authorization=`Bearer ${this.connection.token}`);let raw=await fetch(`${url??this.connection.url}`,{method:"POST",headers,body:this.encodeCbor(body)}),buffer=await raw.arrayBuffer();if(raw.status===200)return buffer;let dec=new TextDecoder("utf-8");throw new HttpConnectionError(dec.decode(buffer),raw.status,raw.statusText,buffer)}};var ALWAYS_ALLOW=new Set(["signin","signup","authenticate","invalidate","version","use","let","unset","query"]),HttpEngine=class extends AbstractRemoteEngine{connection={url:void 0,namespace:void 0,database:void 0,token:void 0,variables:{}};setStatus(status,...args){this.status=status,this.emitter.emit(status,args);}version(url,timeout){return retrieveRemoteVersion(url,timeout)}async connect(url){return this.setStatus("connecting"),this.connection.url=url,await this.context.prepare?.(new EngineAuth(this)),this.setStatus("connected"),this.ready=new Promise(r2=>r2()),this.ready}disconnect(){return this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0,variables:{}},this.ready=void 0,this.setStatus("disconnected"),new Promise(r2=>r2())}async rpc(request,force){if(force||await this.ready,!this.connection.url)throw new ConnectionUnavailable;if((!this.connection.namespace||!this.connection.database)&&!ALWAYS_ALLOW.has(request.method))throw new MissingNamespaceDatabase;if(request.method==="use"){let[ns,db]=request.params;return ns===null&&(this.connection.namespace=void 0),db===null&&(this.connection.database=void 0),ns&&(this.connection.namespace=ns),db&&(this.connection.database=db),{result:true}}if(request.method==="let"){let[key,value]=request.params;return this.connection.variables[key]=value,{result:true}}if(request.method==="unset"){let[key]=request.params;return delete this.connection.variables[key],{result:true}}request.method==="query"&&(request.params=[request.params?.[0],{...this.connection.variables,...request.params?.[1]??{}}]);let id2=getIncrementalID(),buffer=await this.req_post({id:id2,...request}),response=this.decodeCbor(buffer);if("result"in response)switch(request.method){case "signin":case "signup":{this.connection.token=response.result;break}case "authenticate":{let[token]=request.params;this.connection.token=token;break}case "invalidate":{this.connection.token=void 0;break}}return this.emitter.emit(`rpc-${id2}`,[response]),response}get connected(){return !!this.connection.url}async export(options){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.pathname=`${basepath}/export`;let buffer=await this.req_post(options??{},url,{Accept:"plain/text"});return new TextDecoder("utf-8").decode(buffer)}async import(data){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.pathname=`${basepath}/import`,await this.req_post(data,url,{Accept:"application/json"});}};function newCompletable(){let out={completed:false};return out.promise=new Promise((resolve_,reject_)=>{out.resolve=arg=>{out.completed=true,resolve_(arg);},out.reject=reason=>{out.completed=true,reject_(reason);};}),out}var WebsocketEngine=class extends AbstractRemoteEngine{pinger;socket;disconnected;constructor(ctx){super(ctx),this.disconnected=newCompletable();}setStatus(status,...args){this.connection.url&&status==="disconnected"||status==="error"?(this.disconnected.resolve(),this.disconnected=newCompletable()):(this.status=status,this.emitter.emit(status,args));}async requireStatus(status){return this.status!==status&&await this.emitter.subscribeOnce(status),true}version(url,timeout){return retrieveRemoteVersion(url,timeout)}async connect(url){this.connection.url=url,(async()=>{let initial=true,controls;for(;this.connection.url;)if(initial)initial=false,this.setStatus("connecting"),this.ready=this.createSocket(),await this.disconnected.promise;else {if(!this.context.reconnect.enabled)break;if(!controls){let{promise,resolve:resolve2,reject:reject2}=newCompletable();this.ready=promise,controls=[resolve2,reject2];}let[resolve,reject]=controls;if(!this.context.reconnect.allowed){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},this.socket=void 0,reject(new ReconnectFailed),this.emitter.emit("error",[new ReconnectFailed]),this.setStatus("disconnected");break}this.setStatus("reconnecting"),await this.context.reconnect.iterate();try{await this.createSocket();}catch{continue}try{if(this.connection.namespace||this.connection.database){let res=await this.rpc({method:"use",params:[this.connection.namespace,this.connection.database]},!0);if(res.error)throw new ResponseError(res.error.message)}if(this.connection.token){let res=await this.rpc({method:"authenticate",params:[this.connection.token]},!0);if(res.error)throw new ResponseError(res.error.message)}}catch(e){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},this.socket=void 0,reject(e),this.emitter.emit("error",[e]),this.setStatus("disconnected");break}this.context.reconnect.reset(),resolve(),this.emitter.scanListeners(k=>k.startsWith("rpc-")).map(k=>this.emitter.emit(k,[RetryMessage])),this.status==="connected"&&await this.disconnected.promise;}})(),await this.ready;}async createSocket(){let{promise,resolve,reject}=newCompletable();if(!this.connection.url)throw new NoURLProvided;let socket=new WebSocket$1(this.connection.url.toString(),"cbor");socket.addEventListener("open",async()=>{this.socket=socket,await this.context.prepare?.(new EngineAuth(this)),this.setStatus("connected"),this.pinger?.stop(),this.pinger=new Pinger(3e4),this.pinger.start(()=>{try{this.rpc({method:"ping"});}catch{}}),resolve();}),socket.addEventListener("error",e=>{let error=new UnexpectedConnectionError("detail"in e&&e.detail?e.detail:"message"in e&&e.message?e.message:"error"in e&&e.error?e.error:"An unexpected error occurred");this.setStatus("error",error),reject(error);}),socket.addEventListener("close",()=>{this.setStatus("disconnected"),this.pinger?.stop();}),socket.addEventListener("message",async({data})=>{try{let decoded=this.decodeCbor(data instanceof ArrayBuffer?data:data instanceof Blob?await data.arrayBuffer():data.buffer.slice(data.byteOffset,data.byteOffset+data.byteLength));if(typeof decoded=="object"&&decoded!=null&&Object.getPrototypeOf(decoded)===Object.prototype)this.handleRpcResponse(decoded);else throw new UnexpectedServerResponse(decoded)}catch(detail){socket.dispatchEvent(new CustomEvent("error",{detail}));}}),await promise;}async disconnect(){this.connection={url:void 0,namespace:void 0,database:void 0,token:void 0},await this.ready?.catch(()=>{}),this.socket?.close(),this.ready=void 0,this.socket=void 0,this.disconnected.resolve(),await Promise.any([this.requireStatus("disconnected"),this.requireStatus("error")]);}async rpc(request,force){if(force||await this.ready,!this.socket)throw new ConnectionUnavailable;let res;for(;!res;){let id2=getIncrementalID(),response=this.emitter.subscribeOnce(`rpc-${id2}`);if(this.socket.send(this.encodeCbor({id:id2,...request})),force&&this.socket.readyState===WebSocket$1.CLOSED)throw new EngineDisconnected;let[raw]=await response;if(raw instanceof EngineDisconnected)throw raw;raw!==RetryMessage&&(res=raw);}if("result"in res)switch(request.method){case "use":{let[ns,db]=request.params;ns===null&&(this.connection.namespace=void 0),db===null&&(this.connection.database=void 0),ns&&(this.connection.namespace=ns),db&&(this.connection.database=db);break}case "signin":case "signup":{this.connection.token=res.result;break}case "authenticate":{let[token]=request.params;this.connection.token=token;break}case "invalidate":{this.connection.token=void 0;break}}return res}handleRpcResponse({id:id2,...res}){if(id2)this.emitter.emit(`rpc-${id2}`,[res]);else if(res.error)this.setStatus("error",new ResponseError(res.error));else if(isLiveResult(res.result)){let{id:id3,action,result}=res.result;this.emitter.emit(`live-${id3}`,[action,result],true);}else this.setStatus("error",new UnexpectedServerResponse({id:id2,...res}));}get connected(){return !!this.socket}async export(options){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.protocol=url.protocol.replace("ws","http"),url.pathname=`${basepath}/export`;let buffer=await this.req_post(options??{},url,{Accept:"plain/text"});return new TextDecoder("utf-8").decode(buffer)}async import(data){if(!this.connection.url)throw new ConnectionUnavailable;let url=new URL(this.connection.url),basepath=url.pathname.slice(0,-4);url.protocol=url.protocol.replace("ws","http"),url.pathname=`${basepath}/import`,await this.req_post(data,url,{Accept:"application/json"});}},Pinger=class{pinger;interval;constructor(interval=3e4){this.interval=interval;}start(callback){this.pinger=setInterval(callback,this.interval);}stop(){clearInterval(this.pinger);}};function rand(min,max){return Math.random()*(max-min)+min}var ReconnectContext=class{_attempts=0;options;surreal;constructor(input,surreal){this.surreal=surreal,input?input===true?this.options=DEFAULT_RECONNECT_OPTIONS:this.options={...DEFAULT_RECONNECT_OPTIONS,...input}:this.options={...DEFAULT_RECONNECT_OPTIONS,enabled:false};}get attempts(){return this._attempts}get enabled(){return this.options.enabled}get allowed(){return !(!this.options.enabled||this.options.attempts!==-1&&this._attempts>=this.options.attempts)}reset(){this._attempts=0;}async iterate(){if(!this.allowed)throw new ReconnectIterationError;this._attempts++;let multiplier=this.options.retryDelayMultiplier**this.attempts,adjustedDelay=this.options.retryDelay*multiplier,jitterModifier=rand(-this.options.retryDelayJitter,this.options.retryDelayJitter),nextDelay=Math.min(adjustedDelay*(1+jitterModifier),this.options.retryDelayMax);await new Promise(r2=>setTimeout(r2,nextDelay));}};var Surreal=class extends AuthController{connection;emitter;engines={ws:WebsocketEngine,wss:WebsocketEngine,http:HttpEngine,https:HttpEngine};_ready;constructor({engines}={}){super(),this.emitter=new Emitter,engines&&(this.engines={...this.engines,...engines});}async connect(url,opts={}){return this._ready=this.connectInner(url,opts),await this._ready,true}async connectInner(url,opts={}){let endpoint=parseUrl(url),engineName=endpoint.protocol.slice(0,-1),engine=this.engines[engineName];if(!engine)throw new UnsupportedEngine(engineName);let{prepare,auth,namespace,database,reconnect}=opts;await this.close();let context=new EngineContext({emitter:this.emitter,encodeCbor,decodeCbor,reconnect:new ReconnectContext(reconnect,this),prepare}),connection=new engine(context);if(opts.versionCheck!==false){let version=await connection.version(endpoint,opts.versionCheckTimeout);versionCheck(version);}this.connection=connection,await connection.connect(endpoint),(namespace||database)&&await this.use({namespace,database}),typeof auth=="string"?await this.authenticate(auth):auth&&await this.signin(auth);}async close(){return this.clean(),await this.connection?.disconnect(),true}clean(){let pending=this.emitter.scanListeners(k=>k.startsWith("rpc-"));pending.map(k=>this.emitter.emit(k,[new EngineDisconnected]));let live=this.emitter.scanListeners(k=>k.startsWith("live-"));live.map(k=>this.emitter.emit(k,["CLOSE","disconnected"])),this.emitter.reset({collectable:true,listeners:[...pending,...live]});}get status(){return this.connection?.status??"disconnected"}get ready(){return Promise.all([this._ready,this.connection?.ready]).then(()=>{})}async ping(){let{error}=await this.rpc("ping");if(error)throw new ResponseError(error.message);return true}async use({namespace,database}){if(!this.connection)throw new NoActiveSocket;if(namespace===null&&database!==null)throw new SurrealDbError("Cannot unset namespace without unsetting database");let{error}=await this.rpc("use",[namespace,database]);if(error)throw new ResponseError(error.message);return true}async info(){await this.ready;let res=await this.rpc("info");if(res.error)throw new ResponseError(res.error.message);return res.result??void 0}async let(variable,value){let res=await this.rpc("let",[variable,value]);if(res.error)throw new ResponseError(res.error.message);return true}async unset(variable){let res=await this.rpc("unset",[variable]);if(res.error)throw new ResponseError(res.error.message);return true}async live(table,callback,diff){await this.ready;let res=await this.rpc("live",[table,diff]);if(res.error)throw new ResponseError(res.error.message);return callback&&this.subscribeLive(res.result,callback),res.result}async subscribeLive(queryUuid,callback){if(await this.ready,!this.connection)throw new NoActiveSocket;this.connection.emitter.subscribe(`live-${queryUuid}`,callback,true);}async unSubscribeLive(queryUuid,callback){if(await this.ready,!this.connection)throw new NoActiveSocket;this.connection.emitter.unSubscribe(`live-${queryUuid}`,callback);}async kill(queryUuid){if(await this.ready,!this.connection)throw new NoActiveSocket;if(Array.isArray(queryUuid)){await Promise.all(queryUuid.map(u2=>this.rpc("kill",[u2])));let toBeKilled=queryUuid.map(u2=>`live-${u2}`);toBeKilled.map(k=>this.emitter.emit(k,["CLOSE","killed"])),this.connection.emitter.reset({collectable:toBeKilled,listeners:toBeKilled});}else await this.rpc("kill",[queryUuid]),this.emitter.emit(`live-${queryUuid}`,["CLOSE","killed"]),this.connection.emitter.reset({collectable:`live-${queryUuid}`,listeners:`live-${queryUuid}`});}async query(...args){return (await this.queryRaw(...args)).map(({status,result})=>{if(status==="ERR")throw new ResponseError(result);return result})}async queryRaw(...[q,b]){let params=q instanceof PreparedQuery?[q.query,partiallyEncodeObject(q.bindings,{fills:b,replacer:replacer.encode})]:[q,b];await this.ready;let res=await this.rpc("query",params);if(res.error)throw new ResponseError(res.error.message);return res.result}async query_raw(...args){return this.queryRaw(...args)}async select(thing){await this.ready;let res=await this.rpc("select",[thing]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async create(thing,data){await this.ready;let res=await this.rpc("create",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async insert(arg1,arg2){await this.ready;let[table,data]=typeof arg1=="string"||arg1 instanceof Table?[arg1,arg2]:[void 0,arg1],res=await this.rpc("insert",[table,data]);if(res.error)throw new ResponseError(res.error.message);return res.result}async insertRelation(arg1,arg2){await this.ready;let[table,data]=typeof arg1=="string"||arg1 instanceof Table?[arg1,arg2]:[void 0,arg1],res=await this.rpc("insert_relation",[table,data]);if(res.error)throw new ResponseError(res.error.message);return res.result}async insert_relation(arg1,arg2){return arg1 instanceof Table||typeof arg1=="string"?this.insertRelation(arg1,arg2):this.insertRelation(arg1)}async update(thing,data){await this.ready;let res=await this.rpc("update",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async upsert(thing,data){await this.ready;let res=await this.rpc("upsert",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async merge(thing,data){await this.ready;let res=await this.rpc("merge",[thing,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async patch(thing,data,diff){await this.ready;let res=await this.rpc("patch",[thing,data,diff]);if(res.error)throw new ResponseError(res.error.message);return diff?res.result:output(thing,res.result)}async delete(thing){await this.ready;let res=await this.rpc("delete",[thing]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}async version(){await this.ready;let res=await this.rpc("version");if(res.error)throw new ResponseError(res.error.message);return res.result}async run(name,arg2,arg3){await this.ready;let[version,args]=Array.isArray(arg2)?[void 0,arg2]:[arg2,arg3],res=await this.rpc("run",[name,version,args]);if(res.error)throw new ResponseError(res.error.message);return res.result}async relate(from,thing,to,data){await this.ready;let res=await this.rpc("relate",[from,thing,to,data]);if(res.error)throw new ResponseError(res.error.message);return output(thing,res.result)}rpc(method,params){if(!this.connection)throw new NoActiveSocket;return this.connection.rpc({method,params})}async export(options){if(await this.ready,!this.connection)throw new NoActiveSocket;return this.connection.export(options)}async import(input){if(await this.ready,!this.connection)throw new NoActiveSocket;return this.connection.import(input)}};function output(subject,input){return subject instanceof RecordId||subject instanceof StringRecordId?Array.isArray(input)?input[0]:input:Array.isArray(input)?input:[input]}function parseUrl(value){let url=new URL(value);return url.pathname.endsWith("/rpc")||(url.pathname.endsWith("/")||(url.pathname+="/"),url.pathname+="rpc"),url}/**
|
|
343774
343289
|
* 2023 Samuel Schwanzer
|
|
343775
343290
|
*
|
|
343776
343291
|
* Licensed under the Apache License, Version 2.0 (the "License");
|