ueberdb2 5.0.14 → 5.0.15
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 +842 -1333
- 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
|
*
|
|
@@ -1117,8 +1117,8 @@ function requireUtils$c () {
|
|
|
1117
1117
|
hasRequiredUtils$c = 1;
|
|
1118
1118
|
|
|
1119
1119
|
const util = require$$0$6;
|
|
1120
|
-
const net = require$$0$
|
|
1121
|
-
const { EventEmitter } = require$$0$
|
|
1120
|
+
const net = require$$0$8;
|
|
1121
|
+
const { EventEmitter } = require$$0$7;
|
|
1122
1122
|
|
|
1123
1123
|
const errors = requireErrors$c();
|
|
1124
1124
|
const promiseUtils = requirePromiseUtils();
|
|
@@ -2330,7 +2330,7 @@ function requireAddressResolution () {
|
|
|
2330
2330
|
addressResolution.AddressTranslator = AddressTranslator;
|
|
2331
2331
|
addressResolution.EC2MultiRegionTranslator = EC2MultiRegionTranslator;
|
|
2332
2332
|
return addressResolution;
|
|
2333
|
-
}var types$
|
|
2333
|
+
}var types$2 = {};var umd = {exports: {}};var hasRequiredUmd;
|
|
2334
2334
|
|
|
2335
2335
|
function requireUmd () {
|
|
2336
2336
|
if (hasRequiredUmd) return umd.exports;
|
|
@@ -3329,7 +3329,7 @@ function requireUmd () {
|
|
|
3329
3329
|
// guard against signed division overflow: the largest
|
|
3330
3330
|
// negative number / -1 would be 1 larger than the largest
|
|
3331
3331
|
// positive number, due to two's complement.
|
|
3332
|
-
if (!this.unsigned && this.high === -
|
|
3332
|
+
if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) {
|
|
3333
3333
|
// be consistent with non-wasm code path
|
|
3334
3334
|
return this;
|
|
3335
3335
|
}
|
|
@@ -5363,7 +5363,7 @@ function requireInteger () {
|
|
|
5363
5363
|
} else if (diff.isZero()) {
|
|
5364
5364
|
return 0;
|
|
5365
5365
|
} else {
|
|
5366
|
-
return
|
|
5366
|
+
return 1;
|
|
5367
5367
|
}
|
|
5368
5368
|
};
|
|
5369
5369
|
|
|
@@ -5868,7 +5868,7 @@ function requireBigDecimal () {
|
|
|
5868
5868
|
if (diff.isZero()) {
|
|
5869
5869
|
return 0;
|
|
5870
5870
|
}
|
|
5871
|
-
return
|
|
5871
|
+
return 1;
|
|
5872
5872
|
};
|
|
5873
5873
|
|
|
5874
5874
|
/**
|
|
@@ -7363,7 +7363,7 @@ function requireLocalTime () {
|
|
|
7363
7363
|
throw new Error('Not a valid date');
|
|
7364
7364
|
}
|
|
7365
7365
|
//Use the local representation, only the milliseconds portion
|
|
7366
|
-
const millis = (date.getTime() + date.getTimezoneOffset() * -
|
|
7366
|
+
const millis = (date.getTime() + date.getTimezoneOffset() * -6e4) % millisInDay;
|
|
7367
7367
|
return LocalTime.fromMilliseconds(millis, nanoseconds);
|
|
7368
7368
|
};
|
|
7369
7369
|
|
|
@@ -8178,7 +8178,7 @@ function requireTuple () {
|
|
|
8178
8178
|
var hasRequiredTypes$2;
|
|
8179
8179
|
|
|
8180
8180
|
function requireTypes$2 () {
|
|
8181
|
-
if (hasRequiredTypes$2) return types$
|
|
8181
|
+
if (hasRequiredTypes$2) return types$2;
|
|
8182
8182
|
hasRequiredTypes$2 = 1;
|
|
8183
8183
|
const util = require$$0$6;
|
|
8184
8184
|
|
|
@@ -8761,39 +8761,39 @@ function requireTypes$2 () {
|
|
|
8761
8761
|
}
|
|
8762
8762
|
util.inherits(TimeoutError, errors.DriverError);
|
|
8763
8763
|
|
|
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$
|
|
8764
|
+
types$2.opcodes = opcodes;
|
|
8765
|
+
types$2.consistencies = consistencies;
|
|
8766
|
+
types$2.consistencyToString = consistencyToString;
|
|
8767
|
+
types$2.dataTypes = dataTypes;
|
|
8768
|
+
types$2.getDataTypeNameByCode = getDataTypeNameByCode;
|
|
8769
|
+
types$2.distance = distance;
|
|
8770
|
+
types$2.frameFlags = frameFlags;
|
|
8771
|
+
types$2.protocolEvents = protocolEvents;
|
|
8772
|
+
types$2.protocolVersion = protocolVersion;
|
|
8773
|
+
types$2.responseErrorCodes = responseErrorCodes;
|
|
8774
|
+
types$2.resultKind = resultKind;
|
|
8775
|
+
types$2.timeuuid = timeuuid;
|
|
8776
|
+
types$2.uuid = uuid;
|
|
8777
|
+
types$2.BigDecimal = requireBigDecimal();
|
|
8778
|
+
types$2.Duration = requireDuration();
|
|
8779
|
+
types$2.FrameHeader = FrameHeader;
|
|
8780
|
+
types$2.InetAddress = requireInetAddress();
|
|
8781
|
+
types$2.Integer = requireInteger();
|
|
8782
|
+
types$2.LocalDate = requireLocalDate();
|
|
8783
|
+
types$2.LocalTime = requireLocalTime();
|
|
8784
|
+
types$2.Long = Long;
|
|
8785
|
+
types$2.ResultSet = requireResultSet$1();
|
|
8786
|
+
types$2.ResultStream = requireResultStream();
|
|
8787
|
+
types$2.Row = requireRow();
|
|
8788
8788
|
//export DriverError for backward-compatibility
|
|
8789
|
-
types$
|
|
8790
|
-
types$
|
|
8791
|
-
types$
|
|
8792
|
-
types$
|
|
8793
|
-
types$
|
|
8794
|
-
types$
|
|
8795
|
-
types$
|
|
8796
|
-
return types$
|
|
8789
|
+
types$2.DriverError = errors.DriverError;
|
|
8790
|
+
types$2.TimeoutError = TimeoutError;
|
|
8791
|
+
types$2.TimeUuid = TimeUuid;
|
|
8792
|
+
types$2.Tuple = requireTuple();
|
|
8793
|
+
types$2.Uuid = Uuid;
|
|
8794
|
+
types$2.unset = unset;
|
|
8795
|
+
types$2.generateTimestamp = generateTimestamp;
|
|
8796
|
+
return types$2;
|
|
8797
8797
|
}/*
|
|
8798
8798
|
* Copyright DataStax, Inc.
|
|
8799
8799
|
*
|
|
@@ -10647,7 +10647,7 @@ function requireRequestLogger () {
|
|
|
10647
10647
|
if (hasRequiredRequestLogger) return requestLogger;
|
|
10648
10648
|
hasRequiredRequestLogger = 1;
|
|
10649
10649
|
|
|
10650
|
-
const events = require$$0$
|
|
10650
|
+
const events = require$$0$7;
|
|
10651
10651
|
const RequestTracker = requireRequestTracker();
|
|
10652
10652
|
const errors = requireErrors$c();
|
|
10653
10653
|
const { format } = require$$0$6;
|
|
@@ -11113,7 +11113,7 @@ function requireDefaultMetrics () {
|
|
|
11113
11113
|
hasRequiredDefaultMetrics = 1;
|
|
11114
11114
|
|
|
11115
11115
|
const ClientMetrics = requireClientMetrics();
|
|
11116
|
-
const EventEmitter = require$$0$
|
|
11116
|
+
const EventEmitter = require$$0$7;
|
|
11117
11117
|
|
|
11118
11118
|
/**
|
|
11119
11119
|
* A default implementation of [ClientMetrics]{@link module:metrics~ClientMetrics} that exposes the driver events as
|
|
@@ -12882,7 +12882,7 @@ var hasRequiredWriters;
|
|
|
12882
12882
|
function requireWriters () {
|
|
12883
12883
|
if (hasRequiredWriters) return writers;
|
|
12884
12884
|
hasRequiredWriters = 1;
|
|
12885
|
-
const events = require$$0$
|
|
12885
|
+
const events = require$$0$7;
|
|
12886
12886
|
|
|
12887
12887
|
const types = requireTypes$2();
|
|
12888
12888
|
const utils = requireUtils$c();
|
|
@@ -13802,77 +13802,11 @@ function requireExecutionOptions () {
|
|
|
13802
13802
|
|
|
13803
13803
|
executionOptions = { ExecutionOptions, DefaultExecutionOptions, proxyExecuteKey };
|
|
13804
13804
|
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
|
-
};
|
|
13805
|
+
}var version$9 = "4.7.2";
|
|
13806
|
+
var description = "DataStax Node.js Driver for Apache Cassandra";
|
|
13861
13807
|
var require$$17 = {
|
|
13862
|
-
name: name$9,
|
|
13863
13808
|
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
|
-
};/*
|
|
13809
|
+
description: description};/*
|
|
13876
13810
|
* Copyright DataStax, Inc.
|
|
13877
13811
|
*
|
|
13878
13812
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -13907,16 +13841,12 @@ function requireRequests () {
|
|
|
13907
13841
|
*/
|
|
13908
13842
|
const queryFlag = {
|
|
13909
13843
|
values: 0x01,
|
|
13910
|
-
skipMetadata: 0x02,
|
|
13911
13844
|
pageSize: 0x04,
|
|
13912
13845
|
withPagingState: 0x08,
|
|
13913
13846
|
withSerialConsistency: 0x10,
|
|
13914
13847
|
withDefaultTimestamp: 0x20,
|
|
13915
13848
|
withNameForValues: 0x40,
|
|
13916
|
-
withKeyspace: 0x80
|
|
13917
|
-
withPageSizeBytes: 0x40000000,
|
|
13918
|
-
withContinuousPaging: 0x80000000
|
|
13919
|
-
};
|
|
13849
|
+
withKeyspace: 0x80};
|
|
13920
13850
|
|
|
13921
13851
|
/**
|
|
13922
13852
|
* Options for the execution of a batch request from protocol v3 and above
|
|
@@ -13925,7 +13855,6 @@ function requireRequests () {
|
|
|
13925
13855
|
const batchFlag = {
|
|
13926
13856
|
withSerialConsistency: 0x10,
|
|
13927
13857
|
withDefaultTimestamp: 0x20,
|
|
13928
|
-
withNameForValues: 0x40,
|
|
13929
13858
|
withKeyspace: 0x80
|
|
13930
13859
|
};
|
|
13931
13860
|
|
|
@@ -18571,7 +18500,6 @@ function requireReaders () {
|
|
|
18571
18500
|
const resultFlag = {
|
|
18572
18501
|
globalTablesSpec: 0x0001,
|
|
18573
18502
|
hasMorePages: 0x0002,
|
|
18574
|
-
noMetadata: 0x0004,
|
|
18575
18503
|
metadataChanged: 0x0008,
|
|
18576
18504
|
continuousPaging: 0x40000000,
|
|
18577
18505
|
lastContinuousPage: 0x80000000,
|
|
@@ -20073,10 +20001,10 @@ function requireConnection$6 () {
|
|
|
20073
20001
|
if (hasRequiredConnection$6) return connection$6;
|
|
20074
20002
|
hasRequiredConnection$6 = 1;
|
|
20075
20003
|
|
|
20076
|
-
const events = require$$0$
|
|
20004
|
+
const events = require$$0$7;
|
|
20077
20005
|
const util = require$$0$6;
|
|
20078
20006
|
const tls = require$$1$1;
|
|
20079
|
-
const net = require$$0$
|
|
20007
|
+
const net = require$$0$8;
|
|
20080
20008
|
|
|
20081
20009
|
const Encoder = requireEncoder$1();
|
|
20082
20010
|
const { WriteQueue } = requireWriters();
|
|
@@ -20869,7 +20797,7 @@ function requireHostConnectionPool () {
|
|
|
20869
20797
|
if (hasRequiredHostConnectionPool) return hostConnectionPool;
|
|
20870
20798
|
hasRequiredHostConnectionPool = 1;
|
|
20871
20799
|
const util = require$$0$6;
|
|
20872
|
-
const events = require$$0$
|
|
20800
|
+
const events = require$$0$7;
|
|
20873
20801
|
|
|
20874
20802
|
const Connection = requireConnection$6();
|
|
20875
20803
|
const utils = requireUtils$c();
|
|
@@ -21702,7 +21630,7 @@ function requireHost () {
|
|
|
21702
21630
|
if (hasRequiredHost) return host;
|
|
21703
21631
|
hasRequiredHost = 1;
|
|
21704
21632
|
|
|
21705
|
-
const events = require$$0$
|
|
21633
|
+
const events = require$$0$7;
|
|
21706
21634
|
|
|
21707
21635
|
const utils = requireUtils$c();
|
|
21708
21636
|
const types = requireTypes$2();
|
|
@@ -22956,7 +22884,7 @@ function requireDataCollection () {
|
|
|
22956
22884
|
if (hasRequiredDataCollection) return dataCollection;
|
|
22957
22885
|
hasRequiredDataCollection = 1;
|
|
22958
22886
|
const util = require$$0$6;
|
|
22959
|
-
const events = require$$0$
|
|
22887
|
+
const events = require$$0$7;
|
|
22960
22888
|
/**
|
|
22961
22889
|
* Creates a new instance of DataCollection
|
|
22962
22890
|
* @param {String} name Name of the data object.
|
|
@@ -23619,7 +23547,7 @@ function requireSchemaParser () {
|
|
|
23619
23547
|
if (hasRequiredSchemaParser) return schemaParser;
|
|
23620
23548
|
hasRequiredSchemaParser = 1;
|
|
23621
23549
|
const util = require$$0$6;
|
|
23622
|
-
const events = require$$0$
|
|
23550
|
+
const events = require$$0$7;
|
|
23623
23551
|
const types = requireTypes$2();
|
|
23624
23552
|
const utils = requireUtils$c();
|
|
23625
23553
|
const errors = requireErrors$c();
|
|
@@ -24802,7 +24730,7 @@ function requireMetadata () {
|
|
|
24802
24730
|
if (hasRequiredMetadata) return metadata;
|
|
24803
24731
|
hasRequiredMetadata = 1;
|
|
24804
24732
|
|
|
24805
|
-
const events = require$$0$
|
|
24733
|
+
const events = require$$0$7;
|
|
24806
24734
|
const util = require$$0$6;
|
|
24807
24735
|
|
|
24808
24736
|
/**
|
|
@@ -26002,9 +25930,9 @@ var hasRequiredControlConnection;
|
|
|
26002
25930
|
function requireControlConnection () {
|
|
26003
25931
|
if (hasRequiredControlConnection) return controlConnection;
|
|
26004
25932
|
hasRequiredControlConnection = 1;
|
|
26005
|
-
const events = require$$0$
|
|
25933
|
+
const events = require$$0$7;
|
|
26006
25934
|
const util = require$$0$6;
|
|
26007
|
-
const net = require$$0$
|
|
25935
|
+
const net = require$$0$8;
|
|
26008
25936
|
const dns = require$$0$9;
|
|
26009
25937
|
|
|
26010
25938
|
const errors = requireErrors$c();
|
|
@@ -26023,8 +25951,6 @@ function requireControlConnection () {
|
|
|
26023
25951
|
const newNodeDelay = 1000;
|
|
26024
25952
|
const metadataQueryAbortTimeout = 2000;
|
|
26025
25953
|
const schemaChangeTypes = {
|
|
26026
|
-
created: 'CREATED',
|
|
26027
|
-
updated: 'UPDATED',
|
|
26028
25954
|
dropped: 'DROPPED'
|
|
26029
25955
|
};
|
|
26030
25956
|
const supportedProductTypeKey = 'PRODUCT_TYPE';
|
|
@@ -28778,7 +28704,7 @@ function requireUtils$b () {
|
|
|
28778
28704
|
if (!crcTable.length) genCRCTable();
|
|
28779
28705
|
|
|
28780
28706
|
let len = buf.length;
|
|
28781
|
-
let crc =
|
|
28707
|
+
let crc = -1;
|
|
28782
28708
|
for (let off = 0; off < len; ) crc = Utils.crc32update(crc, buf[off++]);
|
|
28783
28709
|
// xor and cast as uint32 number
|
|
28784
28710
|
return ~crc >>> 0;
|
|
@@ -31237,7 +31163,7 @@ function requireCloud () {
|
|
|
31237
31163
|
if (hasRequiredCloud) return cloud;
|
|
31238
31164
|
hasRequiredCloud = 1;
|
|
31239
31165
|
|
|
31240
|
-
const https = require$$2$
|
|
31166
|
+
const https = require$$2$2;
|
|
31241
31167
|
const fs = require$$0$d;
|
|
31242
31168
|
const util = require$$0$6;
|
|
31243
31169
|
const AdmZip = requireAdmZip();
|
|
@@ -33953,7 +33879,7 @@ function requireClient$6 () {
|
|
|
33953
33879
|
if (hasRequiredClient$6) return client$6;
|
|
33954
33880
|
hasRequiredClient$6 = 1;
|
|
33955
33881
|
|
|
33956
|
-
const events = require$$0$
|
|
33882
|
+
const events = require$$0$7;
|
|
33957
33883
|
const util = require$$0$6;
|
|
33958
33884
|
|
|
33959
33885
|
const utils = requireUtils$c();
|
|
@@ -35140,7 +35066,7 @@ function requireTree () {
|
|
|
35140
35066
|
if (hasRequiredTree) return tree;
|
|
35141
35067
|
hasRequiredTree = 1;
|
|
35142
35068
|
|
|
35143
|
-
const EventEmitter = require$$0$
|
|
35069
|
+
const EventEmitter = require$$0$7;
|
|
35144
35070
|
|
|
35145
35071
|
/**
|
|
35146
35072
|
* Represents a tree node where the key is composed by 1 or more strings.
|
|
@@ -39179,16 +39105,16 @@ function requireSyntax () {
|
|
|
39179
39105
|
/** @type {import('./syntax')} */
|
|
39180
39106
|
syntax = SyntaxError;
|
|
39181
39107
|
return syntax;
|
|
39182
|
-
}var type
|
|
39108
|
+
}var type;
|
|
39183
39109
|
var hasRequiredType;
|
|
39184
39110
|
|
|
39185
39111
|
function requireType () {
|
|
39186
|
-
if (hasRequiredType) return type
|
|
39112
|
+
if (hasRequiredType) return type;
|
|
39187
39113
|
hasRequiredType = 1;
|
|
39188
39114
|
|
|
39189
39115
|
/** @type {import('./type')} */
|
|
39190
|
-
type
|
|
39191
|
-
return type
|
|
39116
|
+
type = TypeError;
|
|
39117
|
+
return type;
|
|
39192
39118
|
}var uri;
|
|
39193
39119
|
var hasRequiredUri;
|
|
39194
39120
|
|
|
@@ -40076,7 +40002,7 @@ function requireObjectInspect () {
|
|
|
40076
40002
|
num === Infinity
|
|
40077
40003
|
|| num === -Infinity
|
|
40078
40004
|
|| num !== num
|
|
40079
|
-
|| (num && num > -
|
|
40005
|
+
|| (num && num > -1e3 && num < 1000)
|
|
40080
40006
|
|| $test.call(/e/, str)
|
|
40081
40007
|
) {
|
|
40082
40008
|
return str;
|
|
@@ -53373,7 +53299,7 @@ function requireForm_data () {
|
|
|
53373
53299
|
var util = require$$0$6;
|
|
53374
53300
|
var path = require$$1$2;
|
|
53375
53301
|
var http$1 = http;
|
|
53376
|
-
var https = require$$2$
|
|
53302
|
+
var https = require$$2$2;
|
|
53377
53303
|
var parseUrl = require$$0$f.parse;
|
|
53378
53304
|
var fs = require$$0$d;
|
|
53379
53305
|
var Stream = require$$0$b.Stream;
|
|
@@ -54977,7 +54903,7 @@ function requireFollowRedirects () {
|
|
|
54977
54903
|
var url = require$$0$f;
|
|
54978
54904
|
var URL = url.URL;
|
|
54979
54905
|
var http$1 = http;
|
|
54980
|
-
var https = require$$2$
|
|
54906
|
+
var https = require$$2$2;
|
|
54981
54907
|
var Writable = require$$0$b.Writable;
|
|
54982
54908
|
var assert = require$$0$i;
|
|
54983
54909
|
var debug = requireDebug$2();
|
|
@@ -55658,12 +55584,12 @@ function requireAxios () {
|
|
|
55658
55584
|
const url = require$$0$f;
|
|
55659
55585
|
const proxyFromEnv = requireProxyFromEnv();
|
|
55660
55586
|
const http$1 = http;
|
|
55661
|
-
const https = require$$2$
|
|
55587
|
+
const https = require$$2$2;
|
|
55662
55588
|
const util = require$$0$6;
|
|
55663
55589
|
const followRedirects = requireFollowRedirects();
|
|
55664
55590
|
const zlib = require$$0$e;
|
|
55665
55591
|
const stream = require$$0$b;
|
|
55666
|
-
const events = require$$0$
|
|
55592
|
+
const events = require$$0$7;
|
|
55667
55593
|
|
|
55668
55594
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
55669
55595
|
|
|
@@ -57125,7 +57051,7 @@ function requireAxios () {
|
|
|
57125
57051
|
}
|
|
57126
57052
|
}
|
|
57127
57053
|
|
|
57128
|
-
return (
|
|
57054
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
57129
57055
|
}
|
|
57130
57056
|
|
|
57131
57057
|
const defaults = {
|
|
@@ -60395,76 +60321,17 @@ function requireAxios () {
|
|
|
60395
60321
|
axios_1 = axios;
|
|
60396
60322
|
|
|
60397
60323
|
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";
|
|
60324
|
+
}var name$2 = "nano";
|
|
60403
60325
|
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
60326
|
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;
|
|
60327
|
+
name: name$2,
|
|
60328
|
+
version: version$8};var nodeAbortController;
|
|
60462
60329
|
var hasRequiredNodeAbortController;
|
|
60463
60330
|
|
|
60464
60331
|
function requireNodeAbortController () {
|
|
60465
60332
|
if (hasRequiredNodeAbortController) return nodeAbortController;
|
|
60466
60333
|
hasRequiredNodeAbortController = 1;
|
|
60467
|
-
const { EventEmitter } = require$$0$
|
|
60334
|
+
const { EventEmitter } = require$$0$7;
|
|
60468
60335
|
|
|
60469
60336
|
class AbortSignal {
|
|
60470
60337
|
constructor() {
|
|
@@ -60539,7 +60406,7 @@ var hasRequiredChangesreader;
|
|
|
60539
60406
|
function requireChangesreader () {
|
|
60540
60407
|
if (hasRequiredChangesreader) return changesreader;
|
|
60541
60408
|
hasRequiredChangesreader = 1;
|
|
60542
|
-
const EventEmitter = require$$0$
|
|
60409
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
60543
60410
|
const AbortController = commonjsGlobal.AbortController || requireNodeAbortController().AbortController;
|
|
60544
60411
|
const stream = require$$0$b;
|
|
60545
60412
|
const EVENT_BATCH = 'batch';
|
|
@@ -61054,7 +60921,7 @@ function requireNano () {
|
|
|
61054
60921
|
|
|
61055
60922
|
const { URL } = require$$0$f;
|
|
61056
60923
|
const http$1 = http;
|
|
61057
|
-
const https = require$$2$
|
|
60924
|
+
const https = require$$2$2;
|
|
61058
60925
|
const assert = require$$0$i;
|
|
61059
60926
|
const querystring = /*@__PURE__*/ requireLib$a();
|
|
61060
60927
|
const axios = /*@__PURE__*/ requireAxios();
|
|
@@ -62506,7 +62373,7 @@ function requireDirty$1 () {
|
|
|
62506
62373
|
hasRequiredDirty$1 = 1;
|
|
62507
62374
|
Object.defineProperty(dirty, "__esModule", { value: true });
|
|
62508
62375
|
const fs_1 = require$$0$d;
|
|
62509
|
-
const events_1 = require$$0$
|
|
62376
|
+
const events_1 = require$$0$7;
|
|
62510
62377
|
class Dirty extends events_1.EventEmitter {
|
|
62511
62378
|
path;
|
|
62512
62379
|
_data;
|
|
@@ -62784,7 +62651,7 @@ class Dirty_db extends AbstractDatabase {
|
|
|
62784
62651
|
if (callback)
|
|
62785
62652
|
callback();
|
|
62786
62653
|
}
|
|
62787
|
-
}var dist$
|
|
62654
|
+
}var dist$e = {};var src$3 = {};var src$2 = {exports: {}};var browser$1 = {exports: {}};/**
|
|
62788
62655
|
* Helpers.
|
|
62789
62656
|
*/
|
|
62790
62657
|
|
|
@@ -63859,11 +63726,11 @@ function requireSrc$1 () {
|
|
|
63859
63726
|
|
|
63860
63727
|
} (src$3));
|
|
63861
63728
|
return src$3;
|
|
63862
|
-
}var hasRequiredDist$
|
|
63729
|
+
}var hasRequiredDist$e;
|
|
63863
63730
|
|
|
63864
|
-
function requireDist$
|
|
63865
|
-
if (hasRequiredDist$
|
|
63866
|
-
hasRequiredDist$
|
|
63731
|
+
function requireDist$e () {
|
|
63732
|
+
if (hasRequiredDist$e) return dist$e;
|
|
63733
|
+
hasRequiredDist$e = 1;
|
|
63867
63734
|
(function (exports) {
|
|
63868
63735
|
function __export(m) {
|
|
63869
63736
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
@@ -63871,16 +63738,16 @@ function requireDist$d () {
|
|
|
63871
63738
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63872
63739
|
__export(requireSrc$1());
|
|
63873
63740
|
|
|
63874
|
-
} (dist$
|
|
63875
|
-
return dist$
|
|
63876
|
-
}var distExports$4 = requireDist$
|
|
63877
|
-
var debug$1 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);var dist$
|
|
63741
|
+
} (dist$e));
|
|
63742
|
+
return dist$e;
|
|
63743
|
+
}var distExports$4 = requireDist$e();var srcExports = requireSrc$2();
|
|
63744
|
+
var debug$1 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);var dist$d = {};var hasRequiredDist$d;
|
|
63878
63745
|
|
|
63879
|
-
function requireDist$
|
|
63880
|
-
if (hasRequiredDist$
|
|
63881
|
-
hasRequiredDist$
|
|
63882
|
-
Object.defineProperty(dist$
|
|
63883
|
-
dist$
|
|
63746
|
+
function requireDist$d () {
|
|
63747
|
+
if (hasRequiredDist$d) return dist$d;
|
|
63748
|
+
hasRequiredDist$d = 1;
|
|
63749
|
+
Object.defineProperty(dist$d, "__esModule", { value: true });
|
|
63750
|
+
dist$d.createDeferred = dist$d.deferred = void 0;
|
|
63884
63751
|
/**
|
|
63885
63752
|
* Creates a new `DeferredPromise`
|
|
63886
63753
|
*
|
|
@@ -63918,7 +63785,7 @@ function requireDist$c () {
|
|
|
63918
63785
|
},
|
|
63919
63786
|
};
|
|
63920
63787
|
}
|
|
63921
|
-
dist$
|
|
63788
|
+
dist$d.deferred = deferred;
|
|
63922
63789
|
/**
|
|
63923
63790
|
* Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the
|
|
63924
63791
|
* local variable name rather than the factory import name, without needing to rename on import.
|
|
@@ -63927,7 +63794,7 @@ function requireDist$c () {
|
|
|
63927
63794
|
import {createDeferred} from '@kwsites/promise-deferred`;
|
|
63928
63795
|
```
|
|
63929
63796
|
*/
|
|
63930
|
-
dist$
|
|
63797
|
+
dist$d.createDeferred = deferred;
|
|
63931
63798
|
/**
|
|
63932
63799
|
* Default export allows use as:
|
|
63933
63800
|
*
|
|
@@ -63935,10 +63802,10 @@ function requireDist$c () {
|
|
|
63935
63802
|
import deferred from '@kwsites/promise-deferred`;
|
|
63936
63803
|
```
|
|
63937
63804
|
*/
|
|
63938
|
-
dist$
|
|
63805
|
+
dist$d.default = deferred;
|
|
63939
63806
|
|
|
63940
|
-
return dist$
|
|
63941
|
-
}var distExports$3 = requireDist$
|
|
63807
|
+
return dist$d;
|
|
63808
|
+
}var distExports$3 = requireDist$d();var __defProp$1 = Object.defineProperty;
|
|
63942
63809
|
var __defProps = Object.defineProperties;
|
|
63943
63810
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
63944
63811
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -68906,7 +68773,7 @@ function requireDiagnostic () {
|
|
|
68906
68773
|
*/
|
|
68907
68774
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68908
68775
|
exports.events = void 0;
|
|
68909
|
-
const events_1 = require$$0$
|
|
68776
|
+
const events_1 = require$$0$7;
|
|
68910
68777
|
const errors_1 = requireErrors$a();
|
|
68911
68778
|
var events;
|
|
68912
68779
|
(function (events) {
|
|
@@ -70474,99 +70341,9 @@ function requireSerializer$1 () {
|
|
|
70474
70341
|
_a = symbols_1.kJsonOptions;
|
|
70475
70342
|
|
|
70476
70343
|
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
|
-
};
|
|
70344
|
+
}var version$7 = "8.4.1";
|
|
70552
70345
|
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;
|
|
70346
|
+
version: version$7};var hasRequiredTransport$1;
|
|
70570
70347
|
|
|
70571
70348
|
function requireTransport$1 () {
|
|
70572
70349
|
if (hasRequiredTransport$1) return Transport;
|
|
@@ -71441,7 +71218,7 @@ function requireHpagent () {
|
|
|
71441
71218
|
if (hasRequiredHpagent) return hpagent;
|
|
71442
71219
|
hasRequiredHpagent = 1;
|
|
71443
71220
|
|
|
71444
|
-
const https = require$$2$
|
|
71221
|
+
const https = require$$2$2;
|
|
71445
71222
|
const http$1 = http;
|
|
71446
71223
|
const { URL } = require$$0$f;
|
|
71447
71224
|
|
|
@@ -71594,7 +71371,7 @@ function requireHttpConnection () {
|
|
|
71594
71371
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
71595
71372
|
const hpagent_1 = tslib_1.__importDefault(requireHpagent());
|
|
71596
71373
|
const http_1 = tslib_1.__importDefault(http);
|
|
71597
|
-
const https_1 = tslib_1.__importDefault(require$$2$
|
|
71374
|
+
const https_1 = tslib_1.__importDefault(require$$2$2);
|
|
71598
71375
|
const debug_1 = tslib_1.__importDefault(requireSrc());
|
|
71599
71376
|
const buffer_1 = tslib_1.__importDefault(require$$0$k);
|
|
71600
71377
|
const BaseConnection_1 = tslib_1.__importStar(requireBaseConnection());
|
|
@@ -72390,7 +72167,7 @@ function requireUtil$9 () {
|
|
|
72390
72167
|
const { kDestroyed, kBodyUsed } = requireSymbols$4();
|
|
72391
72168
|
const { IncomingMessage } = http;
|
|
72392
72169
|
const stream = require$$0$b;
|
|
72393
|
-
const net = require$$0$
|
|
72170
|
+
const net = require$$0$8;
|
|
72394
72171
|
const { InvalidArgumentError } = requireErrors$9();
|
|
72395
72172
|
const { Blob } = require$$0$k;
|
|
72396
72173
|
const nodeUtil = require$$0$6;
|
|
@@ -73010,7 +72787,7 @@ function requireTimers$1 () {
|
|
|
73010
72787
|
}
|
|
73011
72788
|
};
|
|
73012
72789
|
return timers$1;
|
|
73013
|
-
}var main
|
|
72790
|
+
}var main = {exports: {}};var sbmh;
|
|
73014
72791
|
var hasRequiredSbmh;
|
|
73015
72792
|
|
|
73016
72793
|
function requireSbmh () {
|
|
@@ -74524,7 +74301,7 @@ function requireUrlencoded$1 () {
|
|
|
74524
74301
|
}var hasRequiredMain;
|
|
74525
74302
|
|
|
74526
74303
|
function requireMain () {
|
|
74527
|
-
if (hasRequiredMain) return main
|
|
74304
|
+
if (hasRequiredMain) return main.exports;
|
|
74528
74305
|
hasRequiredMain = 1;
|
|
74529
74306
|
|
|
74530
74307
|
const WritableStream = require$$0$l.Writable;
|
|
@@ -74605,12 +74382,12 @@ function requireMain () {
|
|
|
74605
74382
|
this._parser.write(chunk, cb);
|
|
74606
74383
|
};
|
|
74607
74384
|
|
|
74608
|
-
main
|
|
74609
|
-
main
|
|
74610
|
-
main
|
|
74385
|
+
main.exports = Busboy;
|
|
74386
|
+
main.exports.default = Busboy;
|
|
74387
|
+
main.exports.Busboy = Busboy;
|
|
74611
74388
|
|
|
74612
|
-
main
|
|
74613
|
-
return main
|
|
74389
|
+
main.exports.Dicer = Dicer;
|
|
74390
|
+
return main.exports;
|
|
74614
74391
|
}var constants$7;
|
|
74615
74392
|
var hasRequiredConstants$7;
|
|
74616
74393
|
|
|
@@ -74823,7 +74600,7 @@ function requireUtil$8 () {
|
|
|
74823
74600
|
|
|
74824
74601
|
const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = requireConstants$7();
|
|
74825
74602
|
const { getGlobalOrigin } = requireGlobal$1();
|
|
74826
|
-
const { performance } = require$$2$
|
|
74603
|
+
const { performance } = require$$2$3;
|
|
74827
74604
|
const { isBlobLike, toUSVString, ReadableStreamFrom } = requireUtil$9();
|
|
74828
74605
|
const assert = require$$0$i;
|
|
74829
74606
|
const { isUint8Array } = require$$5$2;
|
|
@@ -79017,7 +78794,7 @@ function requireDispatcher () {
|
|
|
79017
78794
|
if (hasRequiredDispatcher) return dispatcher;
|
|
79018
78795
|
hasRequiredDispatcher = 1;
|
|
79019
78796
|
|
|
79020
|
-
const EventEmitter = require$$0$
|
|
78797
|
+
const EventEmitter = require$$0$7;
|
|
79021
78798
|
|
|
79022
78799
|
class Dispatcher extends EventEmitter {
|
|
79023
78800
|
dispatch () {
|
|
@@ -79240,7 +79017,7 @@ function requireConnect$1 () {
|
|
|
79240
79017
|
if (hasRequiredConnect$1) return connect$1;
|
|
79241
79018
|
hasRequiredConnect$1 = 1;
|
|
79242
79019
|
|
|
79243
|
-
const net = require$$0$
|
|
79020
|
+
const net = require$$0$8;
|
|
79244
79021
|
const assert = require$$0$i;
|
|
79245
79022
|
const util = requireUtil$9();
|
|
79246
79023
|
const { InvalidArgumentError, ConnectTimeoutError } = requireErrors$9();
|
|
@@ -79738,7 +79515,7 @@ function requireRedirectHandler () {
|
|
|
79738
79515
|
const { kBodyUsed } = requireSymbols$4();
|
|
79739
79516
|
const assert = require$$0$i;
|
|
79740
79517
|
const { InvalidArgumentError } = requireErrors$9();
|
|
79741
|
-
const EE = require$$0$
|
|
79518
|
+
const EE = require$$0$7;
|
|
79742
79519
|
|
|
79743
79520
|
const redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
|
|
79744
79521
|
|
|
@@ -79989,7 +79766,7 @@ function requireClient$5 () {
|
|
|
79989
79766
|
/* global WebAssembly */
|
|
79990
79767
|
|
|
79991
79768
|
const assert = require$$0$i;
|
|
79992
|
-
const net = require$$0$
|
|
79769
|
+
const net = require$$0$8;
|
|
79993
79770
|
const http$1 = http;
|
|
79994
79771
|
const { pipeline } = require$$0$b;
|
|
79995
79772
|
const util = requireUtil$9();
|
|
@@ -87314,7 +87091,7 @@ function requireRequest$3 () {
|
|
|
87314
87091
|
const { URLSerializer } = requireDataURL();
|
|
87315
87092
|
const { kHeadersList, kConstruct } = requireSymbols$4();
|
|
87316
87093
|
const assert = require$$0$i;
|
|
87317
|
-
const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$
|
|
87094
|
+
const { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require$$0$7;
|
|
87318
87095
|
|
|
87319
87096
|
let TransformStream = globalThis.TransformStream;
|
|
87320
87097
|
|
|
@@ -88288,7 +88065,7 @@ function requireFetch () {
|
|
|
88288
88065
|
DOMException
|
|
88289
88066
|
} = requireConstants$7();
|
|
88290
88067
|
const { kHeadersList } = requireSymbols$4();
|
|
88291
|
-
const EE = require$$0$
|
|
88068
|
+
const EE = require$$0$7;
|
|
88292
88069
|
const { Readable, pipeline } = require$$0$b;
|
|
88293
88070
|
const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = requireUtil$9();
|
|
88294
88071
|
const { dataURLProcessor, serializeAMimeType } = requireDataURL();
|
|
@@ -95480,7 +95257,7 @@ function requireUndiciConnection () {
|
|
|
95480
95257
|
Object.defineProperty(UndiciConnection, "__esModule", { value: true });
|
|
95481
95258
|
const tslib_1 = require$$0$4;
|
|
95482
95259
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
|
95483
|
-
const events_1 = require$$0$
|
|
95260
|
+
const events_1 = require$$0$7;
|
|
95484
95261
|
const debug_1 = tslib_1.__importDefault(requireSrc());
|
|
95485
95262
|
const buffer_1 = tslib_1.__importDefault(require$$0$k);
|
|
95486
95263
|
const BaseConnection_1 = tslib_1.__importStar(requireBaseConnection());
|
|
@@ -103132,10 +102909,10 @@ function requireKnn_search () {
|
|
|
103132
102909
|
knn_search.default = KnnSearchApi;
|
|
103133
102910
|
|
|
103134
102911
|
return knn_search;
|
|
103135
|
-
}var license
|
|
102912
|
+
}var license = {};var hasRequiredLicense;
|
|
103136
102913
|
|
|
103137
102914
|
function requireLicense () {
|
|
103138
|
-
if (hasRequiredLicense) return license
|
|
102915
|
+
if (hasRequiredLicense) return license;
|
|
103139
102916
|
hasRequiredLicense = 1;
|
|
103140
102917
|
/*
|
|
103141
102918
|
* Licensed to Elasticsearch B.V. under one or more contributor
|
|
@@ -103155,7 +102932,7 @@ function requireLicense () {
|
|
|
103155
102932
|
* specific language governing permissions and limitations
|
|
103156
102933
|
* under the License.
|
|
103157
102934
|
*/
|
|
103158
|
-
Object.defineProperty(license
|
|
102935
|
+
Object.defineProperty(license, "__esModule", { value: true });
|
|
103159
102936
|
class License {
|
|
103160
102937
|
constructor(transport) {
|
|
103161
102938
|
Object.defineProperty(this, "transport", {
|
|
@@ -103307,9 +103084,9 @@ function requireLicense () {
|
|
|
103307
103084
|
return await this.transport.request({ path, method, querystring, body }, options);
|
|
103308
103085
|
}
|
|
103309
103086
|
}
|
|
103310
|
-
license
|
|
103087
|
+
license.default = License;
|
|
103311
103088
|
|
|
103312
|
-
return license
|
|
103089
|
+
return license;
|
|
103313
103090
|
}var logstash = {};var hasRequiredLogstash;
|
|
103314
103091
|
|
|
103315
103092
|
function requireLogstash () {
|
|
@@ -111787,120 +111564,9 @@ function requireApi () {
|
|
|
111787
111564
|
});
|
|
111788
111565
|
|
|
111789
111566
|
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
|
-
};
|
|
111567
|
+
}var version$6 = "8.13.1";
|
|
111884
111568
|
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;
|
|
111569
|
+
version: version$6};var hasRequiredClient$4;
|
|
111904
111570
|
|
|
111905
111571
|
function requireClient$4 () {
|
|
111906
111572
|
if (hasRequiredClient$4) return client$4;
|
|
@@ -112548,7 +112214,7 @@ class Elasticsearch_db extends AbstractDatabase {
|
|
|
112548
112214
|
set(key, value) {
|
|
112549
112215
|
this._data.set(key, value);
|
|
112550
112216
|
}
|
|
112551
|
-
}class Mock_db extends require$$0$
|
|
112217
|
+
}class Mock_db extends require$$0$7.EventEmitter {
|
|
112552
112218
|
settings;
|
|
112553
112219
|
mock;
|
|
112554
112220
|
constructor(settings) {
|
|
@@ -122538,7 +122204,7 @@ function requireMongo_types () {
|
|
|
122538
122204
|
hasRequiredMongo_types = 1;
|
|
122539
122205
|
Object.defineProperty(mongo_types, "__esModule", { value: true });
|
|
122540
122206
|
mongo_types.CancellationToken = mongo_types.TypedEventEmitter = void 0;
|
|
122541
|
-
const events_1 = require$$0$
|
|
122207
|
+
const events_1 = require$$0$7;
|
|
122542
122208
|
const mongo_logger_1 = requireMongo_logger();
|
|
122543
122209
|
const utils_1 = requireUtils$8();
|
|
122544
122210
|
/**
|
|
@@ -128811,7 +128477,7 @@ function requireLib$9 () {
|
|
|
128811
128477
|
// (where n is a non-negative integer)
|
|
128812
128478
|
//
|
|
128813
128479
|
// Branch here for cases 1 and 4
|
|
128814
|
-
if ((x > 0 && (x % 1) ===
|
|
128480
|
+
if ((x > 0 && (x % 1) === 0.5 && (x & 1) === 0) ||
|
|
128815
128481
|
(x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) {
|
|
128816
128482
|
return censorNegativeZero(Math.floor(x));
|
|
128817
128483
|
}
|
|
@@ -129902,7 +129568,7 @@ function requireRegexes () {
|
|
|
129902
129568
|
bidiS6
|
|
129903
129569
|
};
|
|
129904
129570
|
return regexes;
|
|
129905
|
-
}var require$$2$
|
|
129571
|
+
}var require$$2$1 = [
|
|
129906
129572
|
[
|
|
129907
129573
|
[
|
|
129908
129574
|
0,
|
|
@@ -178518,7 +178184,7 @@ function requireTr46 () {
|
|
|
178518
178184
|
|
|
178519
178185
|
const punycode = require$$0$3;
|
|
178520
178186
|
const regexes = requireRegexes();
|
|
178521
|
-
const mappingTable = require$$2$
|
|
178187
|
+
const mappingTable = require$$2$1;
|
|
178522
178188
|
const { STATUS_MAPPING } = requireStatusMapping();
|
|
178523
178189
|
|
|
178524
178190
|
function containsNonASCII(str) {
|
|
@@ -182234,203 +181900,9 @@ function requireLib$8 () {
|
|
|
182234
181900
|
|
|
182235
181901
|
} (lib$8));
|
|
182236
181902
|
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
|
-
};
|
|
181903
|
+
}var client_metadata = {};var version$5 = "6.15.0";
|
|
182413
181904
|
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;
|
|
181905
|
+
version: version$5};var hasRequiredClient_metadata;
|
|
182434
181906
|
|
|
182435
181907
|
function requireClient_metadata () {
|
|
182436
181908
|
if (hasRequiredClient_metadata) return client_metadata;
|
|
@@ -183985,7 +183457,7 @@ function requireState_machine () {
|
|
|
183985
183457
|
Object.defineProperty(state_machine, "__esModule", { value: true });
|
|
183986
183458
|
state_machine.StateMachine = void 0;
|
|
183987
183459
|
const fs = require$$0$p;
|
|
183988
|
-
const net = require$$0$
|
|
183460
|
+
const net = require$$0$8;
|
|
183989
183461
|
const tls = require$$1$1;
|
|
183990
183462
|
const bson_1 = requireBson();
|
|
183991
183463
|
const abstract_cursor_1 = requireAbstract_cursor();
|
|
@@ -185118,7 +184590,7 @@ function requireAuto_encrypter () {
|
|
|
185118
184590
|
var _a;
|
|
185119
184591
|
Object.defineProperty(auto_encrypter, "__esModule", { value: true });
|
|
185120
184592
|
auto_encrypter.AutoEncrypter = auto_encrypter.AutoEncryptionLoggerLevel = void 0;
|
|
185121
|
-
const net = require$$0$
|
|
184593
|
+
const net = require$$0$8;
|
|
185122
184594
|
const bson_1 = requireBson();
|
|
185123
184595
|
const constants_1 = requireConstants$2();
|
|
185124
184596
|
const deps_1 = requireDeps();
|
|
@@ -188182,7 +187654,7 @@ function requireConnect () {
|
|
|
188182
187654
|
exports.performInitialHandshake = performInitialHandshake;
|
|
188183
187655
|
exports.prepareHandshakeDocument = prepareHandshakeDocument;
|
|
188184
187656
|
exports.makeSocket = makeSocket;
|
|
188185
|
-
const net = require$$0$
|
|
187657
|
+
const net = require$$0$8;
|
|
188186
187658
|
const tls = require$$1$1;
|
|
188187
187659
|
const constants_1 = requireConstants$2();
|
|
188188
187660
|
const deps_1 = requireDeps();
|
|
@@ -192634,12 +192106,12 @@ function requirePlain () {
|
|
|
192634
192106
|
plain.Plain = Plain;
|
|
192635
192107
|
|
|
192636
192108
|
return plain;
|
|
192637
|
-
}var scram = {};var dist$
|
|
192638
|
-
var hasRequiredDist$
|
|
192109
|
+
}var scram = {};var dist$c;
|
|
192110
|
+
var hasRequiredDist$c;
|
|
192639
192111
|
|
|
192640
|
-
function requireDist$
|
|
192641
|
-
if (hasRequiredDist$
|
|
192642
|
-
hasRequiredDist$
|
|
192112
|
+
function requireDist$c () {
|
|
192113
|
+
if (hasRequiredDist$c) return dist$c;
|
|
192114
|
+
hasRequiredDist$c = 1;
|
|
192643
192115
|
const getCodePoint = (character) => character.codePointAt(0);
|
|
192644
192116
|
const first = (x) => x[0];
|
|
192645
192117
|
const last = (x) => x[x.length - 1];
|
|
@@ -192702,9 +192174,9 @@ function requireDist$b () {
|
|
|
192702
192174
|
}
|
|
192703
192175
|
saslprep.saslprep = saslprep;
|
|
192704
192176
|
saslprep.default = saslprep;
|
|
192705
|
-
dist$
|
|
192177
|
+
dist$c = saslprep;
|
|
192706
192178
|
|
|
192707
|
-
return dist$
|
|
192179
|
+
return dist$c;
|
|
192708
192180
|
}var memoryCodePoints = {};var memoryPager;
|
|
192709
192181
|
var hasRequiredMemoryPager;
|
|
192710
192182
|
|
|
@@ -193031,7 +192503,7 @@ function requireNode () {
|
|
|
193031
192503
|
var __importDefault = (node && node.__importDefault) || function (mod) {
|
|
193032
192504
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
193033
192505
|
};
|
|
193034
|
-
const index_1 = __importDefault(requireDist$
|
|
192506
|
+
const index_1 = __importDefault(requireDist$c());
|
|
193035
192507
|
const memory_code_points_1 = requireMemoryCodePoints();
|
|
193036
192508
|
const code_points_data_1 = __importDefault(requireCodePointsData());
|
|
193037
192509
|
const codePoints = (0, memory_code_points_1.createMemoryCodePoints)(code_points_data_1.default);
|
|
@@ -204714,7 +204186,7 @@ function requireLib$6 () {
|
|
|
204714
204186
|
|
|
204715
204187
|
} (lib$6));
|
|
204716
204188
|
return lib$6;
|
|
204717
|
-
}var tarn = {exports: {}};var Pool = {};var PendingOperation = {};var TimeoutError = {};var hasRequiredTimeoutError$1;
|
|
204189
|
+
}var tarn = {exports: {}};var Pool$1 = {};var PendingOperation = {};var TimeoutError = {};var hasRequiredTimeoutError$1;
|
|
204718
204190
|
|
|
204719
204191
|
function requireTimeoutError$1 () {
|
|
204720
204192
|
if (hasRequiredTimeoutError$1) return TimeoutError;
|
|
@@ -204895,15 +204367,15 @@ function requireResource () {
|
|
|
204895
204367
|
}var hasRequiredPool$2;
|
|
204896
204368
|
|
|
204897
204369
|
function requirePool$2 () {
|
|
204898
|
-
if (hasRequiredPool$2) return Pool;
|
|
204370
|
+
if (hasRequiredPool$2) return Pool$1;
|
|
204899
204371
|
hasRequiredPool$2 = 1;
|
|
204900
|
-
Object.defineProperty(Pool, "__esModule", { value: true });
|
|
204372
|
+
Object.defineProperty(Pool$1, "__esModule", { value: true });
|
|
204901
204373
|
const PendingOperation_1 = requirePendingOperation();
|
|
204902
204374
|
const Resource_1 = requireResource();
|
|
204903
204375
|
const utils_1 = requireUtils$6();
|
|
204904
|
-
const events_1 = require$$0$
|
|
204376
|
+
const events_1 = require$$0$7;
|
|
204905
204377
|
const timers_1 = require$$1$7;
|
|
204906
|
-
|
|
204378
|
+
class Pool {
|
|
204907
204379
|
constructor(opt) {
|
|
204908
204380
|
this.destroyed = false;
|
|
204909
204381
|
this.emitter = new events_1.EventEmitter();
|
|
@@ -205376,8 +204848,8 @@ function requirePool$2 () {
|
|
|
205376
204848
|
}
|
|
205377
204849
|
});
|
|
205378
204850
|
}
|
|
205379
|
-
}
|
|
205380
|
-
Pool.Pool = Pool
|
|
204851
|
+
}
|
|
204852
|
+
Pool$1.Pool = Pool;
|
|
205381
204853
|
function remove(arr, item) {
|
|
205382
204854
|
const idx = arr.indexOf(item);
|
|
205383
204855
|
if (idx === -1) {
|
|
@@ -205412,7 +204884,7 @@ function requirePool$2 () {
|
|
|
205412
204884
|
});
|
|
205413
204885
|
});
|
|
205414
204886
|
}
|
|
205415
|
-
return Pool;
|
|
204887
|
+
return Pool$1;
|
|
205416
204888
|
}var hasRequiredTarn;
|
|
205417
204889
|
|
|
205418
204890
|
function requireTarn () {
|
|
@@ -209334,7 +208806,7 @@ function requireBulkLoad () {
|
|
|
209334
208806
|
value: true
|
|
209335
208807
|
});
|
|
209336
208808
|
exports.default = void 0;
|
|
209337
|
-
var _events = require$$0$
|
|
208809
|
+
var _events = require$$0$7;
|
|
209338
208810
|
var _writableTrackingBuffer = _interopRequireDefault(requireWritableTrackingBuffer());
|
|
209339
208811
|
var _stream = require$$0$b;
|
|
209340
208812
|
var _token = requireToken();
|
|
@@ -209344,19 +208816,7 @@ function requireBulkLoad () {
|
|
|
209344
208816
|
*/
|
|
209345
208817
|
const FLAGS = {
|
|
209346
208818
|
nullable: 1 << 0,
|
|
209347
|
-
caseSen: 1 << 1,
|
|
209348
208819
|
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
208820
|
// introduced in TDS 7.2
|
|
209361
208821
|
nullableUnknown: 1 << 15 // introduced in TDS 7.2
|
|
209362
208822
|
};
|
|
@@ -209365,14 +208825,7 @@ function requireBulkLoad () {
|
|
|
209365
208825
|
* @private
|
|
209366
208826
|
*/
|
|
209367
208827
|
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
|
-
};
|
|
208828
|
+
FINAL: 0x00};
|
|
209376
208829
|
|
|
209377
208830
|
/**
|
|
209378
208831
|
* @private
|
|
@@ -212077,7 +211530,7 @@ async function prepareFormData(formData, request) {
|
|
|
212077
211530
|
}
|
|
212078
211531
|
}
|
|
212079
211532
|
request.multipartBody = { parts };
|
|
212080
|
-
}var dist$
|
|
211533
|
+
}var dist$b = {};var dist$a = {};var helpers$2 = {};var hasRequiredHelpers$2;
|
|
212081
211534
|
|
|
212082
211535
|
function requireHelpers$2 () {
|
|
212083
211536
|
if (hasRequiredHelpers$2) return helpers$2;
|
|
@@ -212108,7 +211561,7 @@ function requireHelpers$2 () {
|
|
|
212108
211561
|
Object.defineProperty(helpers$2, "__esModule", { value: true });
|
|
212109
211562
|
helpers$2.req = helpers$2.json = helpers$2.toBuffer = void 0;
|
|
212110
211563
|
const http$1 = __importStar(http);
|
|
212111
|
-
const https = __importStar(require$$2$
|
|
211564
|
+
const https = __importStar(require$$2$2);
|
|
212112
211565
|
async function toBuffer(stream) {
|
|
212113
211566
|
let length = 0;
|
|
212114
211567
|
const chunks = [];
|
|
@@ -212148,13 +211601,13 @@ function requireHelpers$2 () {
|
|
|
212148
211601
|
helpers$2.req = req;
|
|
212149
211602
|
|
|
212150
211603
|
return helpers$2;
|
|
212151
|
-
}var hasRequiredDist$
|
|
211604
|
+
}var hasRequiredDist$b;
|
|
212152
211605
|
|
|
212153
|
-
function requireDist$
|
|
212154
|
-
if (hasRequiredDist$
|
|
212155
|
-
hasRequiredDist$
|
|
211606
|
+
function requireDist$b () {
|
|
211607
|
+
if (hasRequiredDist$b) return dist$a;
|
|
211608
|
+
hasRequiredDist$b = 1;
|
|
212156
211609
|
(function (exports) {
|
|
212157
|
-
var __createBinding = (dist$
|
|
211610
|
+
var __createBinding = (dist$a && dist$a.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212158
211611
|
if (k2 === undefined) k2 = k;
|
|
212159
211612
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212160
211613
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212165,26 +211618,26 @@ function requireDist$a () {
|
|
|
212165
211618
|
if (k2 === undefined) k2 = k;
|
|
212166
211619
|
o[k2] = m[k];
|
|
212167
211620
|
}));
|
|
212168
|
-
var __setModuleDefault = (dist$
|
|
211621
|
+
var __setModuleDefault = (dist$a && dist$a.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212169
211622
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212170
211623
|
}) : function(o, v) {
|
|
212171
211624
|
o["default"] = v;
|
|
212172
211625
|
});
|
|
212173
|
-
var __importStar = (dist$
|
|
211626
|
+
var __importStar = (dist$a && dist$a.__importStar) || function (mod) {
|
|
212174
211627
|
if (mod && mod.__esModule) return mod;
|
|
212175
211628
|
var result = {};
|
|
212176
211629
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212177
211630
|
__setModuleDefault(result, mod);
|
|
212178
211631
|
return result;
|
|
212179
211632
|
};
|
|
212180
|
-
var __exportStar = (dist$
|
|
211633
|
+
var __exportStar = (dist$a && dist$a.__exportStar) || function(m, exports) {
|
|
212181
211634
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
212182
211635
|
};
|
|
212183
211636
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
212184
211637
|
exports.Agent = void 0;
|
|
212185
|
-
const net = __importStar(require$$0$
|
|
211638
|
+
const net = __importStar(require$$0$8);
|
|
212186
211639
|
const http$1 = __importStar(http);
|
|
212187
|
-
const https_1 = require$$2$
|
|
211640
|
+
const https_1 = require$$2$2;
|
|
212188
211641
|
__exportStar(requireHelpers$2(), exports);
|
|
212189
211642
|
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
212190
211643
|
class Agent extends http$1.Agent {
|
|
@@ -212328,8 +211781,8 @@ function requireDist$a () {
|
|
|
212328
211781
|
}
|
|
212329
211782
|
exports.Agent = Agent;
|
|
212330
211783
|
|
|
212331
|
-
} (dist$
|
|
212332
|
-
return dist$
|
|
211784
|
+
} (dist$a));
|
|
211785
|
+
return dist$a;
|
|
212333
211786
|
}var parseProxyResponse = {};var hasRequiredParseProxyResponse;
|
|
212334
211787
|
|
|
212335
211788
|
function requireParseProxyResponse () {
|
|
@@ -212436,12 +211889,12 @@ function requireParseProxyResponse () {
|
|
|
212436
211889
|
parseProxyResponse.parseProxyResponse = parseProxyResponse$1;
|
|
212437
211890
|
|
|
212438
211891
|
return parseProxyResponse;
|
|
212439
|
-
}var hasRequiredDist$
|
|
211892
|
+
}var hasRequiredDist$a;
|
|
212440
211893
|
|
|
212441
|
-
function requireDist$
|
|
212442
|
-
if (hasRequiredDist$
|
|
212443
|
-
hasRequiredDist$
|
|
212444
|
-
var __createBinding = (dist$
|
|
211894
|
+
function requireDist$a () {
|
|
211895
|
+
if (hasRequiredDist$a) return dist$b;
|
|
211896
|
+
hasRequiredDist$a = 1;
|
|
211897
|
+
var __createBinding = (dist$b && dist$b.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212445
211898
|
if (k2 === undefined) k2 = k;
|
|
212446
211899
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212447
211900
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212452,28 +211905,28 @@ function requireDist$9 () {
|
|
|
212452
211905
|
if (k2 === undefined) k2 = k;
|
|
212453
211906
|
o[k2] = m[k];
|
|
212454
211907
|
}));
|
|
212455
|
-
var __setModuleDefault = (dist$
|
|
211908
|
+
var __setModuleDefault = (dist$b && dist$b.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212456
211909
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212457
211910
|
}) : function(o, v) {
|
|
212458
211911
|
o["default"] = v;
|
|
212459
211912
|
});
|
|
212460
|
-
var __importStar = (dist$
|
|
211913
|
+
var __importStar = (dist$b && dist$b.__importStar) || function (mod) {
|
|
212461
211914
|
if (mod && mod.__esModule) return mod;
|
|
212462
211915
|
var result = {};
|
|
212463
211916
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212464
211917
|
__setModuleDefault(result, mod);
|
|
212465
211918
|
return result;
|
|
212466
211919
|
};
|
|
212467
|
-
var __importDefault = (dist$
|
|
211920
|
+
var __importDefault = (dist$b && dist$b.__importDefault) || function (mod) {
|
|
212468
211921
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
212469
211922
|
};
|
|
212470
|
-
Object.defineProperty(dist$
|
|
212471
|
-
dist$
|
|
212472
|
-
const net = __importStar(require$$0$
|
|
211923
|
+
Object.defineProperty(dist$b, "__esModule", { value: true });
|
|
211924
|
+
dist$b.HttpsProxyAgent = void 0;
|
|
211925
|
+
const net = __importStar(require$$0$8);
|
|
212473
211926
|
const tls = __importStar(require$$1$1);
|
|
212474
211927
|
const assert_1 = __importDefault(require$$0$i);
|
|
212475
211928
|
const debug_1 = __importDefault(requireSrc());
|
|
212476
|
-
const agent_base_1 = requireDist$
|
|
211929
|
+
const agent_base_1 = requireDist$b();
|
|
212477
211930
|
const url_1 = require$$0$f;
|
|
212478
211931
|
const parse_proxy_response_1 = requireParseProxyResponse();
|
|
212479
211932
|
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
@@ -212600,7 +212053,7 @@ function requireDist$9 () {
|
|
|
212600
212053
|
}
|
|
212601
212054
|
}
|
|
212602
212055
|
HttpsProxyAgent.protocols = ['http', 'https'];
|
|
212603
|
-
dist$
|
|
212056
|
+
dist$b.HttpsProxyAgent = HttpsProxyAgent;
|
|
212604
212057
|
function resume(socket) {
|
|
212605
212058
|
socket.resume();
|
|
212606
212059
|
}
|
|
@@ -212615,13 +212068,13 @@ function requireDist$9 () {
|
|
|
212615
212068
|
return ret;
|
|
212616
212069
|
}
|
|
212617
212070
|
|
|
212618
|
-
return dist$
|
|
212619
|
-
}var distExports$2 = requireDist$
|
|
212071
|
+
return dist$b;
|
|
212072
|
+
}var distExports$2 = requireDist$a();var dist$9 = {};var hasRequiredDist$9;
|
|
212620
212073
|
|
|
212621
|
-
function requireDist$
|
|
212622
|
-
if (hasRequiredDist$
|
|
212623
|
-
hasRequiredDist$
|
|
212624
|
-
var __createBinding = (dist$
|
|
212074
|
+
function requireDist$9 () {
|
|
212075
|
+
if (hasRequiredDist$9) return dist$9;
|
|
212076
|
+
hasRequiredDist$9 = 1;
|
|
212077
|
+
var __createBinding = (dist$9 && dist$9.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
212625
212078
|
if (k2 === undefined) k2 = k;
|
|
212626
212079
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
212627
212080
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -212632,28 +212085,28 @@ function requireDist$8 () {
|
|
|
212632
212085
|
if (k2 === undefined) k2 = k;
|
|
212633
212086
|
o[k2] = m[k];
|
|
212634
212087
|
}));
|
|
212635
|
-
var __setModuleDefault = (dist$
|
|
212088
|
+
var __setModuleDefault = (dist$9 && dist$9.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
212636
212089
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
212637
212090
|
}) : function(o, v) {
|
|
212638
212091
|
o["default"] = v;
|
|
212639
212092
|
});
|
|
212640
|
-
var __importStar = (dist$
|
|
212093
|
+
var __importStar = (dist$9 && dist$9.__importStar) || function (mod) {
|
|
212641
212094
|
if (mod && mod.__esModule) return mod;
|
|
212642
212095
|
var result = {};
|
|
212643
212096
|
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
212644
212097
|
__setModuleDefault(result, mod);
|
|
212645
212098
|
return result;
|
|
212646
212099
|
};
|
|
212647
|
-
var __importDefault = (dist$
|
|
212100
|
+
var __importDefault = (dist$9 && dist$9.__importDefault) || function (mod) {
|
|
212648
212101
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
212649
212102
|
};
|
|
212650
|
-
Object.defineProperty(dist$
|
|
212651
|
-
dist$
|
|
212652
|
-
const net = __importStar(require$$0$
|
|
212103
|
+
Object.defineProperty(dist$9, "__esModule", { value: true });
|
|
212104
|
+
dist$9.HttpProxyAgent = void 0;
|
|
212105
|
+
const net = __importStar(require$$0$8);
|
|
212653
212106
|
const tls = __importStar(require$$1$1);
|
|
212654
212107
|
const debug_1 = __importDefault(requireSrc());
|
|
212655
|
-
const events_1 = require$$0$
|
|
212656
|
-
const agent_base_1 = requireDist$
|
|
212108
|
+
const events_1 = require$$0$7;
|
|
212109
|
+
const agent_base_1 = requireDist$b();
|
|
212657
212110
|
const url_1 = require$$0$f;
|
|
212658
212111
|
const debug = (0, debug_1.default)('http-proxy-agent');
|
|
212659
212112
|
/**
|
|
@@ -212756,7 +212209,7 @@ function requireDist$8 () {
|
|
|
212756
212209
|
}
|
|
212757
212210
|
}
|
|
212758
212211
|
HttpProxyAgent.protocols = ['http', 'https'];
|
|
212759
|
-
dist$
|
|
212212
|
+
dist$9.HttpProxyAgent = HttpProxyAgent;
|
|
212760
212213
|
function omit(obj, ...keys) {
|
|
212761
212214
|
const ret = {};
|
|
212762
212215
|
let key;
|
|
@@ -212768,8 +212221,8 @@ function requireDist$8 () {
|
|
|
212768
212221
|
return ret;
|
|
212769
212222
|
}
|
|
212770
212223
|
|
|
212771
|
-
return dist$
|
|
212772
|
-
}var distExports$1 = requireDist$
|
|
212224
|
+
return dist$9;
|
|
212225
|
+
}var distExports$1 = requireDist$9();// Copyright (c) Microsoft Corporation.
|
|
212773
212226
|
// Licensed under the MIT license.
|
|
212774
212227
|
const HTTPS_PROXY = "HTTPS_PROXY";
|
|
212775
212228
|
const HTTP_PROXY = "HTTP_PROXY";
|
|
@@ -215839,25 +215292,14 @@ const Constants$1 = {
|
|
|
215839
215292
|
INVALID_INSTANCE: "invalid_instance",
|
|
215840
215293
|
};
|
|
215841
215294
|
const HttpStatus = {
|
|
215842
|
-
SUCCESS: 200,
|
|
215843
215295
|
SUCCESS_RANGE_START: 200,
|
|
215844
215296
|
SUCCESS_RANGE_END: 299,
|
|
215845
215297
|
REDIRECT: 302,
|
|
215846
|
-
CLIENT_ERROR: 400,
|
|
215847
215298
|
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
215299
|
CLIENT_ERROR_RANGE_END: 499,
|
|
215854
215300
|
SERVER_ERROR: 500,
|
|
215855
215301
|
SERVER_ERROR_RANGE_START: 500,
|
|
215856
|
-
|
|
215857
|
-
GATEWAY_TIMEOUT: 504,
|
|
215858
|
-
SERVER_ERROR_RANGE_END: 599,
|
|
215859
|
-
MULTI_SIDED_ERROR: 600,
|
|
215860
|
-
};
|
|
215302
|
+
SERVER_ERROR_RANGE_END: 599};
|
|
215861
215303
|
const OIDC_DEFAULT_SCOPES = [
|
|
215862
215304
|
Constants$1.OPENID_SCOPE,
|
|
215863
215305
|
Constants$1.PROFILE_SCOPE,
|
|
@@ -215929,7 +215371,6 @@ const ResponseMode = {
|
|
|
215929
215371
|
* allowed grant_type
|
|
215930
215372
|
*/
|
|
215931
215373
|
const GrantType = {
|
|
215932
|
-
IMPLICIT_GRANT: "implicit",
|
|
215933
215374
|
AUTHORIZATION_CODE_GRANT: "authorization_code",
|
|
215934
215375
|
CLIENT_CREDENTIALS_GRANT: "client_credentials",
|
|
215935
215376
|
RESOURCE_OWNER_PASSWORD_GRANT: "password",
|
|
@@ -215943,7 +215384,6 @@ const GrantType = {
|
|
|
215943
215384
|
const CacheAccountType = {
|
|
215944
215385
|
MSSTS_ACCOUNT_TYPE: "MSSTS",
|
|
215945
215386
|
ADFS_ACCOUNT_TYPE: "ADFS",
|
|
215946
|
-
MSAV1_ACCOUNT_TYPE: "MSA",
|
|
215947
215387
|
GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
|
|
215948
215388
|
};
|
|
215949
215389
|
/**
|
|
@@ -215980,7 +215420,6 @@ const AuthorityMetadataSource = {
|
|
|
215980
215420
|
};
|
|
215981
215421
|
const SERVER_TELEM_CONSTANTS = {
|
|
215982
215422
|
SCHEMA_VERSION: 5,
|
|
215983
|
-
MAX_CUR_HEADER_BYTES: 80,
|
|
215984
215423
|
MAX_LAST_HEADER_BYTES: 330,
|
|
215985
215424
|
MAX_CACHED_ERRORS: 50,
|
|
215986
215425
|
CACHE_KEY: "server-telemetry",
|
|
@@ -216042,9 +215481,7 @@ const RegionDiscoverySources = {
|
|
|
216042
215481
|
* Region Discovery Outcomes
|
|
216043
215482
|
*/
|
|
216044
215483
|
const RegionDiscoveryOutcomes = {
|
|
216045
|
-
CONFIGURED_MATCHES_DETECTED: "1",
|
|
216046
215484
|
CONFIGURED_NO_AUTO_DETECTION: "2",
|
|
216047
|
-
CONFIGURED_NOT_DETECTED: "3",
|
|
216048
215485
|
AUTO_DETECTION_REQUESTED_SUCCESSFUL: "4",
|
|
216049
215486
|
AUTO_DETECTION_REQUESTED_FAILED: "5",
|
|
216050
215487
|
};
|
|
@@ -216709,7 +216146,6 @@ const rawMetdataJSON = {
|
|
|
216709
216146
|
},
|
|
216710
216147
|
},
|
|
216711
216148
|
instanceDiscoveryMetadata: {
|
|
216712
|
-
tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
|
|
216713
216149
|
metadata: [
|
|
216714
216150
|
{
|
|
216715
216151
|
preferred_network: "login.microsoftonline.com",
|
|
@@ -216834,18 +216270,7 @@ const ProtocolMode = {
|
|
|
216834
216270
|
*/
|
|
216835
216271
|
const AzureCloudInstance = {
|
|
216836
216272
|
// 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 */
|
|
216273
|
+
None: "none"};/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
216849
216274
|
/*
|
|
216850
216275
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
216851
216276
|
* Licensed under the MIT License.
|
|
@@ -218828,7 +218253,7 @@ class Logger {
|
|
|
218828
218253
|
}
|
|
218829
218254
|
}/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
218830
218255
|
/* eslint-disable header/header */
|
|
218831
|
-
const name$
|
|
218256
|
+
const name$1 = "@azure/msal-common";
|
|
218832
218257
|
const version$4 = "14.12.0";/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
218833
218258
|
|
|
218834
218259
|
/*
|
|
@@ -219435,7 +218860,7 @@ class CacheManager {
|
|
|
219435
218860
|
constructor(clientId, cryptoImpl, logger, staticAuthorityOptions) {
|
|
219436
218861
|
this.clientId = clientId;
|
|
219437
218862
|
this.cryptoImpl = cryptoImpl;
|
|
219438
|
-
this.commonLogger = logger.clone(name$
|
|
218863
|
+
this.commonLogger = logger.clone(name$1, version$4);
|
|
219439
218864
|
this.staticAuthorityOptions = staticAuthorityOptions;
|
|
219440
218865
|
}
|
|
219441
218866
|
/**
|
|
@@ -220181,8 +219606,7 @@ class CacheManager {
|
|
|
220181
219606
|
* Distinguish between Bearer and PoP/SSH token cache types
|
|
220182
219607
|
* Cast to lowercase to handle "bearer" from ADFS
|
|
220183
219608
|
*/
|
|
220184
|
-
const credentialType = authScheme
|
|
220185
|
-
authScheme.toLowerCase() !==
|
|
219609
|
+
const credentialType = authScheme.toLowerCase() !==
|
|
220186
219610
|
AuthenticationScheme.BEARER.toLowerCase()
|
|
220187
219611
|
? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
|
|
220188
219612
|
: CredentialType.ACCESS_TOKEN;
|
|
@@ -221404,7 +220828,7 @@ class BaseClient {
|
|
|
221404
220828
|
// Set the configuration
|
|
221405
220829
|
this.config = buildClientConfiguration(configuration);
|
|
221406
220830
|
// Initialize the logger
|
|
221407
|
-
this.logger = new Logger(this.config.loggerOptions, name$
|
|
220831
|
+
this.logger = new Logger(this.config.loggerOptions, name$1, version$4);
|
|
221408
220832
|
// Initialize crypto
|
|
221409
220833
|
this.cryptoUtils = this.config.cryptoInterface;
|
|
221410
220834
|
// Initialize storage interface
|
|
@@ -221662,9 +221086,7 @@ class ProtocolUtils {
|
|
|
221662
221086
|
* Licensed under the MIT License.
|
|
221663
221087
|
*/
|
|
221664
221088
|
const KeyLocation = {
|
|
221665
|
-
SW: "sw"
|
|
221666
|
-
UHW: "uhw",
|
|
221667
|
-
};
|
|
221089
|
+
SW: "sw"};
|
|
221668
221090
|
/** @internal */
|
|
221669
221091
|
class PopTokenGenerator {
|
|
221670
221092
|
constructor(cryptoUtils, performanceClient) {
|
|
@@ -223276,7 +222698,6 @@ const HttpMethod = {
|
|
|
223276
222698
|
POST: "post",
|
|
223277
222699
|
};
|
|
223278
222700
|
const ProxyStatus = {
|
|
223279
|
-
SUCCESS: HttpStatus.SUCCESS,
|
|
223280
222701
|
SUCCESS_RANGE_START: HttpStatus.SUCCESS_RANGE_START,
|
|
223281
222702
|
SUCCESS_RANGE_END: HttpStatus.SUCCESS_RANGE_END,
|
|
223282
222703
|
SERVER_ERROR: HttpStatus.SERVER_ERROR,
|
|
@@ -223330,10 +222751,7 @@ const ApiId = {
|
|
|
223330
222751
|
* JWT constants
|
|
223331
222752
|
*/
|
|
223332
222753
|
const JwtConstants = {
|
|
223333
|
-
ALGORITHM: "alg",
|
|
223334
222754
|
RSA_256: "RS256",
|
|
223335
|
-
X5T: "x5t",
|
|
223336
|
-
X5C: "x5c",
|
|
223337
222755
|
AUDIENCE: "aud",
|
|
223338
222756
|
EXPIRATION_TIME: "exp",
|
|
223339
222757
|
ISSUER: "iss",
|
|
@@ -223558,7 +222976,7 @@ const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, ti
|
|
|
223558
222976
|
...NetworkUtils.urlToHttpOptions(url),
|
|
223559
222977
|
};
|
|
223560
222978
|
if (agentOptions && Object.keys(agentOptions).length) {
|
|
223561
|
-
customOptions.agent = new require$$2$
|
|
222979
|
+
customOptions.agent = new require$$2$2.Agent(agentOptions);
|
|
223562
222980
|
}
|
|
223563
222981
|
if (isPostRequest) {
|
|
223564
222982
|
// needed for post request to work
|
|
@@ -223580,7 +222998,7 @@ const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, ti
|
|
|
223580
222998
|
request = http.request(customOptions);
|
|
223581
222999
|
}
|
|
223582
223000
|
else {
|
|
223583
|
-
request = require$$2$
|
|
223001
|
+
request = require$$2$2.request(customOptions);
|
|
223584
223002
|
}
|
|
223585
223003
|
if (isPostRequest) {
|
|
223586
223004
|
request.write(body);
|
|
@@ -230807,7 +230225,7 @@ class ClientAssertion {
|
|
|
230807
230225
|
}
|
|
230808
230226
|
}/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
230809
230227
|
/* eslint-disable header/header */
|
|
230810
|
-
const name
|
|
230228
|
+
const name = "@azure/msal-node";
|
|
230811
230229
|
const version$3 = "2.9.2";/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
230812
230230
|
|
|
230813
230231
|
/*
|
|
@@ -231007,7 +230425,7 @@ class ClientApplication {
|
|
|
231007
230425
|
constructor(configuration) {
|
|
231008
230426
|
this.config = buildAppConfiguration(configuration);
|
|
231009
230427
|
this.cryptoProvider = new CryptoProvider();
|
|
231010
|
-
this.logger = new Logger(this.config.system.loggerOptions, name
|
|
230428
|
+
this.logger = new Logger(this.config.system.loggerOptions, name, version$3);
|
|
231011
230429
|
this.storage = new NodeStorage(this.logger, this.config.auth.clientId, this.cryptoProvider, buildStaticAuthorityOptions(this.config.auth));
|
|
231012
230430
|
this.tokenCache = new TokenCache(this.storage, this.logger, this.config.cache.cachePlugin);
|
|
231013
230431
|
}
|
|
@@ -232151,8 +231569,7 @@ class OnBehalfOfClient extends BaseClient {
|
|
|
232151
231569
|
* Distinguish between Bearer and PoP/SSH token cache types
|
|
232152
231570
|
* Cast to lowercase to handle "bearer" from ADFS
|
|
232153
231571
|
*/
|
|
232154
|
-
const credentialType = authScheme
|
|
232155
|
-
authScheme.toLowerCase() !==
|
|
231572
|
+
const credentialType = authScheme.toLowerCase() !==
|
|
232156
231573
|
AuthenticationScheme.BEARER.toLowerCase()
|
|
232157
231574
|
? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
|
|
232158
231575
|
: CredentialType.ACCESS_TOKEN;
|
|
@@ -232408,9 +231825,7 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
232408
231825
|
}
|
|
232409
231826
|
}/*! @azure/msal-node v2.9.2 2024-06-10 */
|
|
232410
231827
|
({
|
|
232411
|
-
win32: `${process.env["ProgramData"]}\\AzureConnectedMachineAgent\\Tokens
|
|
232412
|
-
linux: "/var/opt/azcmagent/tokens/",
|
|
232413
|
-
});// Copyright (c) Microsoft Corporation.
|
|
231828
|
+
win32: `${process.env["ProgramData"]}\\AzureConnectedMachineAgent\\Tokens\\`});// Copyright (c) Microsoft Corporation.
|
|
232414
231829
|
// Licensed under the MIT license.
|
|
232415
231830
|
const msiName$6 = "ManagedIdentityCredential - AppServiceMSI 2017";
|
|
232416
231831
|
const logger$o = credentialLogger(msiName$6);
|
|
@@ -232824,7 +232239,7 @@ const fabricMsi = {
|
|
|
232824
232239
|
"IDENTITY_SERVER_THUMBPRINT=[REDACTED].",
|
|
232825
232240
|
].join(" "));
|
|
232826
232241
|
const request = createPipelineRequest(Object.assign({ abortSignal: getTokenOptions.abortSignal }, prepareRequestOptions$1(scopes, clientId, resourceId)));
|
|
232827
|
-
request.agent = new require$$2$
|
|
232242
|
+
request.agent = new require$$2$2.Agent({
|
|
232828
232243
|
// This is necessary because Service Fabric provides a self-signed certificate.
|
|
232829
232244
|
// The alternative path is to verify the certificate using the IDENTITY_SERVER_THUMBPRINT env variable.
|
|
232830
232245
|
rejectUnauthorized: false,
|
|
@@ -236545,7 +235960,7 @@ function requireDebug () {
|
|
|
236545
235960
|
value: true
|
|
236546
235961
|
});
|
|
236547
235962
|
exports.default = void 0;
|
|
236548
|
-
var _events = require$$0$
|
|
235963
|
+
var _events = require$$0$7;
|
|
236549
235964
|
var util = _interopRequireWildcard(require$$0$6);
|
|
236550
235965
|
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
235966
|
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 +236055,8 @@ function requireSender$1 () {
|
|
|
236640
236055
|
sender$2.sendInParallel = sendInParallel;
|
|
236641
236056
|
sender$2.sendMessage = sendMessage;
|
|
236642
236057
|
var _dgram = _interopRequireDefault(require$$0$r);
|
|
236643
|
-
var _net = _interopRequireDefault(require$$0$
|
|
236644
|
-
var _nodeUrl = _interopRequireDefault(require$$2$
|
|
236058
|
+
var _net = _interopRequireDefault(require$$0$8);
|
|
236059
|
+
var _nodeUrl = _interopRequireDefault(require$$2$4);
|
|
236645
236060
|
var _abortError = _interopRequireDefault(requireAbortError());
|
|
236646
236061
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
236647
236062
|
async function sendInParallel(addresses, port, request, signal) {
|
|
@@ -236913,14 +236328,11 @@ function requireSprintf () {
|
|
|
236913
236328
|
!function() {
|
|
236914
236329
|
|
|
236915
236330
|
var re = {
|
|
236916
|
-
not_string: /[^s]/,
|
|
236917
|
-
not_bool: /[^t]/,
|
|
236918
236331
|
not_type: /[^T]/,
|
|
236919
236332
|
not_primitive: /[^v]/,
|
|
236920
236333
|
number: /[diefg]/,
|
|
236921
236334
|
numeric_arg: /[bcdiefguxX]/,
|
|
236922
236335
|
json: /[j]/,
|
|
236923
|
-
not_json: /[^j]/,
|
|
236924
236336
|
text: /^[^\x25]+/,
|
|
236925
236337
|
modulo: /^\x25{2}/,
|
|
236926
236338
|
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
|
|
@@ -237582,48 +236994,29 @@ function requireLogin7Payload () {
|
|
|
237582
236994
|
var _tdsVersions = requireTdsVersions();
|
|
237583
236995
|
const FLAGS_1 = {
|
|
237584
236996
|
ENDIAN_LITTLE: 0x00,
|
|
237585
|
-
ENDIAN_BIG: 0x01,
|
|
237586
236997
|
CHARSET_ASCII: 0x00,
|
|
237587
|
-
CHARSET_EBCDIC: 0x02,
|
|
237588
236998
|
FLOAT_IEEE_754: 0x00,
|
|
237589
|
-
FLOAT_VAX: 0x04,
|
|
237590
|
-
FLOAT_ND5000: 0x08,
|
|
237591
|
-
BCP_DUMPLOAD_ON: 0x00,
|
|
237592
236999
|
BCP_DUMPLOAD_OFF: 0x10,
|
|
237593
|
-
USE_DB_ON: 0x00,
|
|
237594
237000
|
USE_DB_OFF: 0x20,
|
|
237595
237001
|
INIT_DB_WARN: 0x00,
|
|
237596
237002
|
INIT_DB_FATAL: 0x40,
|
|
237597
|
-
SET_LANG_WARN_OFF: 0x00,
|
|
237598
237003
|
SET_LANG_WARN_ON: 0x80
|
|
237599
237004
|
};
|
|
237600
237005
|
const FLAGS_2 = {
|
|
237601
237006
|
INIT_LANG_WARN: 0x00,
|
|
237602
|
-
INIT_LANG_FATAL: 0x01,
|
|
237603
237007
|
ODBC_OFF: 0x00,
|
|
237604
|
-
ODBC_ON: 0x02,
|
|
237605
|
-
F_TRAN_BOUNDARY: 0x04,
|
|
237606
|
-
F_CACHE_CONNECT: 0x08,
|
|
237607
237008
|
USER_NORMAL: 0x00,
|
|
237608
|
-
USER_SERVER: 0x10,
|
|
237609
|
-
USER_REMUSER: 0x20,
|
|
237610
|
-
USER_SQLREPL: 0x40,
|
|
237611
237009
|
INTEGRATED_SECURITY_OFF: 0x00,
|
|
237612
237010
|
INTEGRATED_SECURITY_ON: 0x80
|
|
237613
237011
|
};
|
|
237614
237012
|
const TYPE_FLAGS = {
|
|
237615
237013
|
SQL_DFLT: 0x00,
|
|
237616
|
-
SQL_TSQL: 0x08,
|
|
237617
237014
|
OLEDB_OFF: 0x00,
|
|
237618
|
-
OLEDB_ON: 0x10,
|
|
237619
237015
|
READ_WRITE_INTENT: 0x00,
|
|
237620
237016
|
READ_ONLY_INTENT: 0x20
|
|
237621
237017
|
};
|
|
237622
237018
|
const FLAGS_3 = {
|
|
237623
237019
|
CHANGE_PASSWORD_NO: 0x00,
|
|
237624
|
-
CHANGE_PASSWORD_YES: 0x01,
|
|
237625
|
-
BINARY_XML: 0x02,
|
|
237626
|
-
SPAWN_USER_INSTANCE: 0x04,
|
|
237627
237020
|
UNKNOWN_COLLATION_HANDLING: 0x08,
|
|
237628
237021
|
EXTENSION_USED: 0x10
|
|
237629
237022
|
};
|
|
@@ -237633,9 +237026,7 @@ function requireLogin7Payload () {
|
|
|
237633
237026
|
LIBRARY_ADAL: 0x02,
|
|
237634
237027
|
FEDAUTH_YES_ECHO: 0x01,
|
|
237635
237028
|
FEDAUTH_NO_ECHO: 0x00,
|
|
237636
|
-
ADAL_WORKFLOW_USER_PASS: 0x01
|
|
237637
|
-
ADAL_WORKFLOW_INTEGRATED: 0x02
|
|
237638
|
-
};
|
|
237029
|
+
ADAL_WORKFLOW_USER_PASS: 0x01};
|
|
237639
237030
|
const FEATURE_EXT_TERMINATOR = 0xFF;
|
|
237640
237031
|
/*
|
|
237641
237032
|
s2.2.6.3
|
|
@@ -238721,19 +238112,19 @@ function requireErrors$6 () {
|
|
|
238721
238112
|
errors$6.RequestError = RequestError;
|
|
238722
238113
|
|
|
238723
238114
|
return errors$6;
|
|
238724
|
-
}var types$
|
|
238115
|
+
}var types$1 = {};var hasRequiredTypes$1;
|
|
238725
238116
|
|
|
238726
238117
|
function requireTypes$1 () {
|
|
238727
|
-
if (hasRequiredTypes$1) return types$
|
|
238118
|
+
if (hasRequiredTypes$1) return types$1;
|
|
238728
238119
|
hasRequiredTypes$1 = 1;
|
|
238729
238120
|
|
|
238730
|
-
Object.defineProperty(types$
|
|
238121
|
+
Object.defineProperty(types$1, "__esModule", {
|
|
238731
238122
|
value: true
|
|
238732
238123
|
});
|
|
238733
|
-
types$
|
|
238124
|
+
types$1.SQLServerStatementColumnEncryptionSetting = types$1.SQLServerEncryptionType = types$1.DescribeParameterEncryptionResultSet2 = types$1.DescribeParameterEncryptionResultSet1 = void 0;
|
|
238734
238125
|
// This code is based on the `mssql-jdbc` library published under the conditions of MIT license.
|
|
238735
238126
|
// Copyright (c) 2019 Microsoft Corporation
|
|
238736
|
-
types$
|
|
238127
|
+
types$1.SQLServerEncryptionType = /*#__PURE__*/function (SQLServerEncryptionType) {
|
|
238737
238128
|
SQLServerEncryptionType[SQLServerEncryptionType["Deterministic"] = 1] = "Deterministic";
|
|
238738
238129
|
SQLServerEncryptionType[SQLServerEncryptionType["Randomized"] = 2] = "Randomized";
|
|
238739
238130
|
SQLServerEncryptionType[SQLServerEncryptionType["PlainText"] = 0] = "PlainText";
|
|
@@ -238742,7 +238133,7 @@ function requireTypes$1 () {
|
|
|
238742
238133
|
// Fields in the first resultset of "sp_describe_parameter_encryption"
|
|
238743
238134
|
// We expect the server to return the fields in the resultset in the same order as mentioned below.
|
|
238744
238135
|
// If the server changes the below order, then transparent parameter encryption will break.
|
|
238745
|
-
types$
|
|
238136
|
+
types$1.DescribeParameterEncryptionResultSet1 = /*#__PURE__*/function (DescribeParameterEncryptionResultSet1) {
|
|
238746
238137
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["KeyOrdinal"] = 0] = "KeyOrdinal";
|
|
238747
238138
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["DbId"] = 1] = "DbId";
|
|
238748
238139
|
DescribeParameterEncryptionResultSet1[DescribeParameterEncryptionResultSet1["KeyId"] = 2] = "KeyId";
|
|
@@ -238756,7 +238147,7 @@ function requireTypes$1 () {
|
|
|
238756
238147
|
}({}); // Fields in the second resultset of "sp_describe_parameter_encryption"
|
|
238757
238148
|
// We expect the server to return the fields in the resultset in the same order as mentioned below.
|
|
238758
238149
|
// If the server changes the below order, then transparent parameter encryption will break.
|
|
238759
|
-
types$
|
|
238150
|
+
types$1.DescribeParameterEncryptionResultSet2 = /*#__PURE__*/function (DescribeParameterEncryptionResultSet2) {
|
|
238760
238151
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ParameterOrdinal"] = 0] = "ParameterOrdinal";
|
|
238761
238152
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ParameterName"] = 1] = "ParameterName";
|
|
238762
238153
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["ColumnEncryptionAlgorithm"] = 2] = "ColumnEncryptionAlgorithm";
|
|
@@ -238765,7 +238156,7 @@ function requireTypes$1 () {
|
|
|
238765
238156
|
DescribeParameterEncryptionResultSet2[DescribeParameterEncryptionResultSet2["NormalizationRuleVersion"] = 5] = "NormalizationRuleVersion";
|
|
238766
238157
|
return DescribeParameterEncryptionResultSet2;
|
|
238767
238158
|
}({});
|
|
238768
|
-
types$
|
|
238159
|
+
types$1.SQLServerStatementColumnEncryptionSetting = /*#__PURE__*/function (SQLServerStatementColumnEncryptionSetting) {
|
|
238769
238160
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["UseConnectionSetting"] = 0] = "UseConnectionSetting";
|
|
238770
238161
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["Enabled"] = 1] = "Enabled";
|
|
238771
238162
|
SQLServerStatementColumnEncryptionSetting[SQLServerStatementColumnEncryptionSetting["ResultSetOnly"] = 2] = "ResultSetOnly";
|
|
@@ -238773,7 +238164,7 @@ function requireTypes$1 () {
|
|
|
238773
238164
|
return SQLServerStatementColumnEncryptionSetting;
|
|
238774
238165
|
}({});
|
|
238775
238166
|
|
|
238776
|
-
return types$
|
|
238167
|
+
return types$1;
|
|
238777
238168
|
}var hasRequiredRequest$1;
|
|
238778
238169
|
|
|
238779
238170
|
function requireRequest$1 () {
|
|
@@ -238785,7 +238176,7 @@ function requireRequest$1 () {
|
|
|
238785
238176
|
value: true
|
|
238786
238177
|
});
|
|
238787
238178
|
exports.default = void 0;
|
|
238788
|
-
var _events = require$$0$
|
|
238179
|
+
var _events = require$$0$7;
|
|
238789
238180
|
var _errors = requireErrors$6();
|
|
238790
238181
|
var _types = requireTypes$1();
|
|
238791
238182
|
/**
|
|
@@ -239177,10 +238568,7 @@ function requireAllHeaders () {
|
|
|
239177
238568
|
});
|
|
239178
238569
|
allHeaders.writeToTrackingBuffer = writeToTrackingBuffer;
|
|
239179
238570
|
const TYPE = {
|
|
239180
|
-
|
|
239181
|
-
TXN_DESCRIPTOR: 2,
|
|
239182
|
-
TRACE_ACTIVITY: 3
|
|
239183
|
-
};
|
|
238571
|
+
TXN_DESCRIPTOR: 2};
|
|
239184
238572
|
const TXNDESCRIPTOR_HEADER_DATA_LEN = 4 + 8;
|
|
239185
238573
|
const TXNDESCRIPTOR_HEADER_LEN = 4 + 2 + TXNDESCRIPTOR_HEADER_DATA_LEN;
|
|
239186
238574
|
function writeToTrackingBuffer(buffer, txnDescriptor, outstandingRequestCount) {
|
|
@@ -239216,9 +238604,7 @@ function requireRpcrequestPayload () {
|
|
|
239216
238604
|
// };
|
|
239217
238605
|
|
|
239218
238606
|
const STATUS = {
|
|
239219
|
-
BY_REF_VALUE: 0x01
|
|
239220
|
-
DEFAULT_VALUE: 0x02
|
|
239221
|
-
};
|
|
238607
|
+
BY_REF_VALUE: 0x01};
|
|
239222
238608
|
|
|
239223
238609
|
/*
|
|
239224
238610
|
s2.2.6.5
|
|
@@ -241025,7 +240411,7 @@ function requireUtil$2 () {
|
|
|
241025
240411
|
return fn
|
|
241026
240412
|
},
|
|
241027
240413
|
addAbortListener:
|
|
241028
|
-
require$$0$
|
|
240414
|
+
require$$0$7.addAbortListener ||
|
|
241029
240415
|
function addAbortListener(signal, listener) {
|
|
241030
240416
|
if (signal === undefined) {
|
|
241031
240417
|
throw new ERR_INVALID_ARG_TYPE('signal', 'AbortSignal', signal)
|
|
@@ -242555,7 +241941,7 @@ function requireLegacy () {
|
|
|
242555
241941
|
hasRequiredLegacy = 1;
|
|
242556
241942
|
|
|
242557
241943
|
const { ArrayIsArray, ObjectSetPrototypeOf } = requirePrimordials();
|
|
242558
|
-
const { EventEmitter: EE } = require$$0$
|
|
241944
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
242559
241945
|
function Stream(opts) {
|
|
242560
241946
|
EE.call(this, opts);
|
|
242561
241947
|
}
|
|
@@ -243321,7 +242707,7 @@ function requireReadable () {
|
|
|
243321
242707
|
} = requirePrimordials();
|
|
243322
242708
|
readable = Readable;
|
|
243323
242709
|
Readable.ReadableState = ReadableState;
|
|
243324
|
-
const { EventEmitter: EE } = require$$0$
|
|
242710
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
243325
242711
|
const { Stream, prependListener } = requireLegacy();
|
|
243326
242712
|
const { Buffer } = require$$0$k;
|
|
243327
242713
|
const { addAbortSignal } = requireAddAbortSignal();
|
|
@@ -244593,7 +243979,7 @@ function requireWritable () {
|
|
|
244593
243979
|
} = requirePrimordials();
|
|
244594
243980
|
writable = Writable;
|
|
244595
243981
|
Writable.WritableState = WritableState;
|
|
244596
|
-
const { EventEmitter: EE } = require$$0$
|
|
243982
|
+
const { EventEmitter: EE } = require$$0$7;
|
|
244597
243983
|
const Stream = requireLegacy().Stream;
|
|
244598
243984
|
const { Buffer } = require$$0$k;
|
|
244599
243985
|
const destroyImpl = requireDestroy();
|
|
@@ -248151,7 +247537,7 @@ function requireMessageIo () {
|
|
|
248151
247537
|
exports.default = void 0;
|
|
248152
247538
|
var _nativeDuplexpair = _interopRequireDefault(requireNativeDuplexpair());
|
|
248153
247539
|
var tls = _interopRequireWildcard(require$$1$1);
|
|
248154
|
-
var _events = require$$0$
|
|
247540
|
+
var _events = require$$0$7;
|
|
248155
247541
|
var _message = _interopRequireDefault(requireMessage());
|
|
248156
247542
|
var _packet = requirePacket$1();
|
|
248157
247543
|
var _incomingMessageStream = _interopRequireDefault(requireIncomingMessageStream());
|
|
@@ -254491,7 +253877,7 @@ var InstantPrinterParser = function () {
|
|
|
254491
253877
|
buf.append(':00');
|
|
254492
253878
|
}
|
|
254493
253879
|
if (_hi < 0) {
|
|
254494
|
-
if (_ldt.year() === -
|
|
253880
|
+
if (_ldt.year() === -1e4) {
|
|
254495
253881
|
buf.replace(pos, pos + 2, "" + (_hi - 1));
|
|
254496
253882
|
} else if (_lo === 0) {
|
|
254497
253883
|
buf.insert(pos, _hi);
|
|
@@ -262307,7 +261693,7 @@ function requireDbcsCodec () {
|
|
|
262307
261693
|
var UNASSIGNED = -1,
|
|
262308
261694
|
GB18030_CODE = -2,
|
|
262309
261695
|
SEQ_START = -10,
|
|
262310
|
-
NODE_START = -
|
|
261696
|
+
NODE_START = -1e3,
|
|
262311
261697
|
UNASSIGNED_NODE = new Array(0x100),
|
|
262312
261698
|
DEF_CHAR = -1;
|
|
262313
261699
|
|
|
@@ -264247,7 +263633,7 @@ function requireDbcsCodec () {
|
|
|
264247
263633
|
4,
|
|
264248
263634
|
"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"
|
|
264249
263635
|
]
|
|
264250
|
-
];var require$$2
|
|
263636
|
+
];var require$$2 = [
|
|
264251
263637
|
[
|
|
264252
263638
|
"0",
|
|
264253
263639
|
"\u0000",
|
|
@@ -271244,13 +270630,13 @@ function requireDbcsData () {
|
|
|
271244
270630
|
'936': 'cp936',
|
|
271245
270631
|
'cp936': {
|
|
271246
270632
|
type: '_dbcs',
|
|
271247
|
-
table: function() { return require$$2
|
|
270633
|
+
table: function() { return require$$2 },
|
|
271248
270634
|
},
|
|
271249
270635
|
|
|
271250
270636
|
// GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
|
|
271251
270637
|
'gbk': {
|
|
271252
270638
|
type: '_dbcs',
|
|
271253
|
-
table: function() { return require$$2
|
|
270639
|
+
table: function() { return require$$2.concat(require$$3$1) },
|
|
271254
270640
|
},
|
|
271255
270641
|
'xgbk': 'gbk',
|
|
271256
270642
|
'isoir58': 'gbk',
|
|
@@ -271262,7 +270648,7 @@ function requireDbcsData () {
|
|
|
271262
270648
|
// http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
|
|
271263
270649
|
'gb18030': {
|
|
271264
270650
|
type: '_dbcs',
|
|
271265
|
-
table: function() { return require$$2
|
|
270651
|
+
table: function() { return require$$2.concat(require$$3$1) },
|
|
271266
270652
|
gb18030: function() { return require$$4 },
|
|
271267
270653
|
encodeSkipVals: [0x80],
|
|
271268
270654
|
encodeAdd: {'€': 0xA2E3},
|
|
@@ -274397,8 +273783,6 @@ function requireDoneTokenParser () {
|
|
|
274397
273783
|
const STATUS = {
|
|
274398
273784
|
MORE: 0x0001,
|
|
274399
273785
|
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
273786
|
COUNT: 0x0010,
|
|
274403
273787
|
ATTN: 0x0020,
|
|
274404
273788
|
SRVERROR: 0x0100
|
|
@@ -274820,11 +274204,7 @@ function requireFeatureExtAckParser () {
|
|
|
274820
274204
|
var _helpers = requireHelpers$1();
|
|
274821
274205
|
var _token = requireToken();
|
|
274822
274206
|
const FEATURE_ID = {
|
|
274823
|
-
SESSIONRECOVERY: 0x01,
|
|
274824
274207
|
FEDAUTH: 0x02,
|
|
274825
|
-
COLUMNENCRYPTION: 0x04,
|
|
274826
|
-
GLOBALTRANSACTIONS: 0x05,
|
|
274827
|
-
AZURESQLSUPPORT: 0x08,
|
|
274828
274208
|
UTF8_SUPPORT: 0x0A,
|
|
274829
274209
|
TERMINATOR: 0xFF
|
|
274830
274210
|
};
|
|
@@ -276537,7 +275917,7 @@ function requireTokenStreamParser () {
|
|
|
276537
275917
|
value: true
|
|
276538
275918
|
});
|
|
276539
275919
|
tokenStreamParser.Parser = void 0;
|
|
276540
|
-
var _events = require$$0$
|
|
275920
|
+
var _events = require$$0$7;
|
|
276541
275921
|
var _streamParser = _interopRequireDefault(requireStreamParser());
|
|
276542
275922
|
var _stream = require$$0$b;
|
|
276543
275923
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -276721,8 +276101,8 @@ function requireConnector () {
|
|
|
276721
276101
|
connector.connectInParallel = connectInParallel;
|
|
276722
276102
|
connector.connectInSequence = connectInSequence;
|
|
276723
276103
|
connector.lookupAllAddresses = lookupAllAddresses;
|
|
276724
|
-
var _net = _interopRequireDefault(require$$0$
|
|
276725
|
-
var _nodeUrl = _interopRequireDefault(require$$2$
|
|
276104
|
+
var _net = _interopRequireDefault(require$$0$8);
|
|
276105
|
+
var _nodeUrl = _interopRequireDefault(require$$2$4);
|
|
276726
276106
|
var _abortError = _interopRequireDefault(requireAbortError());
|
|
276727
276107
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
276728
276108
|
async function connectInParallel(options, lookup, signal) {
|
|
@@ -276890,34 +276270,13 @@ function requireNtlm () {
|
|
|
276890
276270
|
NTLM_NegotiateUnicode: 0x00000001,
|
|
276891
276271
|
NTLM_NegotiateOEM: 0x00000002,
|
|
276892
276272
|
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
276273
|
NTLM_NegotiateNTLM: 0x00000200,
|
|
276900
|
-
NTLM_NegotiateNTOnly: 0x00000400,
|
|
276901
|
-
NTLM_Anonymous: 0x00000800,
|
|
276902
276274
|
NTLM_NegotiateOemDomainSupplied: 0x00001000,
|
|
276903
276275
|
NTLM_NegotiateOemWorkstationSupplied: 0x00002000,
|
|
276904
|
-
NTLM_Unknown6: 0x00004000,
|
|
276905
276276
|
NTLM_NegotiateAlwaysSign: 0x00008000,
|
|
276906
|
-
NTLM_TargetTypeDomain: 0x00010000,
|
|
276907
|
-
NTLM_TargetTypeServer: 0x00020000,
|
|
276908
|
-
NTLM_TargetTypeShare: 0x00040000,
|
|
276909
276277
|
NTLM_NegotiateExtendedSecurity: 0x00080000,
|
|
276910
|
-
NTLM_NegotiateIdentify: 0x00100000,
|
|
276911
|
-
NTLM_Unknown5: 0x00200000,
|
|
276912
|
-
NTLM_RequestNonNTSessionKey: 0x00400000,
|
|
276913
|
-
NTLM_NegotiateTargetInfo: 0x00800000,
|
|
276914
|
-
NTLM_Unknown4: 0x01000000,
|
|
276915
276278
|
NTLM_NegotiateVersion: 0x02000000,
|
|
276916
|
-
NTLM_Unknown3: 0x04000000,
|
|
276917
|
-
NTLM_Unknown2: 0x08000000,
|
|
276918
|
-
NTLM_Unknown1: 0x10000000,
|
|
276919
276279
|
NTLM_Negotiate128: 0x20000000,
|
|
276920
|
-
NTLM_NegotiateKeyExchange: 0x40000000,
|
|
276921
276280
|
NTLM_Negotiate56: 0x80000000
|
|
276922
276281
|
};
|
|
276923
276282
|
function createNTLMRequest(options) {
|
|
@@ -277014,166 +276373,9 @@ function requireSpecialStoredProcedure () {
|
|
|
277014
276373
|
|
|
277015
276374
|
} (specialStoredProcedure, specialStoredProcedure.exports));
|
|
277016
276375
|
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
|
-
};
|
|
276376
|
+
}var version$2 = "18.2.1";
|
|
277155
276377
|
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;
|
|
276378
|
+
version: version$2};var handler = {};var hasRequiredHandler;
|
|
277177
276379
|
|
|
277178
276380
|
function requireHandler () {
|
|
277179
276381
|
if (hasRequiredHandler) return handler;
|
|
@@ -277636,14 +276838,14 @@ function requireConnection$2 () {
|
|
|
277636
276838
|
var _crypto = _interopRequireDefault(require$$0$a);
|
|
277637
276839
|
var _os = _interopRequireDefault(require$$0$c);
|
|
277638
276840
|
var tls = _interopRequireWildcard(require$$1$1);
|
|
277639
|
-
var net = _interopRequireWildcard(require$$0$
|
|
276841
|
+
var net = _interopRequireWildcard(require$$0$8);
|
|
277640
276842
|
var _dns = _interopRequireDefault(require$$0$9);
|
|
277641
276843
|
var _constants = _interopRequireDefault(require$$5$3);
|
|
277642
276844
|
var _stream = require$$0$b;
|
|
277643
276845
|
var _identity = require$$7$1;
|
|
277644
276846
|
var _bulkLoad = _interopRequireDefault(requireBulkLoad());
|
|
277645
276847
|
var _debug = _interopRequireDefault(requireDebug());
|
|
277646
|
-
var _events = require$$0$
|
|
276848
|
+
var _events = require$$0$7;
|
|
277647
276849
|
var _instanceLookup = requireInstanceLookup();
|
|
277648
276850
|
var _transientErrorLookup = requireTransientErrorLookup();
|
|
277649
276851
|
var _packet = requirePacket$1();
|
|
@@ -280898,7 +280100,6 @@ function requireUdt () {
|
|
|
280898
280100
|
const properties = {
|
|
280899
280101
|
Z: (flags & (1 << 0)) > 0,
|
|
280900
280102
|
M: (flags & (1 << 1)) > 0,
|
|
280901
|
-
V: (flags & (1 << 2)) > 0,
|
|
280902
280103
|
P: (flags & (1 << 3)) > 0,
|
|
280903
280104
|
L: (flags & (1 << 4)) > 0
|
|
280904
280105
|
};
|
|
@@ -288510,13 +287711,13 @@ function requireAuth_switch_response () {
|
|
|
288510
287711
|
|
|
288511
287712
|
auth_switch_response = AuthSwitchResponse;
|
|
288512
287713
|
return auth_switch_response;
|
|
288513
|
-
}var types
|
|
287714
|
+
}var types = {exports: {}};var hasRequiredTypes;
|
|
288514
287715
|
|
|
288515
287716
|
function requireTypes () {
|
|
288516
|
-
if (hasRequiredTypes) return types
|
|
287717
|
+
if (hasRequiredTypes) return types.exports;
|
|
288517
287718
|
hasRequiredTypes = 1;
|
|
288518
287719
|
|
|
288519
|
-
types
|
|
287720
|
+
types.exports = {
|
|
288520
287721
|
0x00: 'DECIMAL', // aka DECIMAL
|
|
288521
287722
|
0x01: 'TINY', // aka TINYINT, 1 byte
|
|
288522
287723
|
0x02: 'SHORT', // aka SMALLINT, 2 bytes
|
|
@@ -288550,36 +287751,36 @@ function requireTypes () {
|
|
|
288550
287751
|
|
|
288551
287752
|
// Manually extracted from mysql-5.5.23/include/mysql_com.h
|
|
288552
287753
|
// 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
|
|
287754
|
+
types.exports.DECIMAL = 0x00; // aka DECIMAL (http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html)
|
|
287755
|
+
types.exports.TINY = 0x01; // aka TINYINT, 1 byte
|
|
287756
|
+
types.exports.SHORT = 0x02; // aka SMALLINT, 2 bytes
|
|
287757
|
+
types.exports.LONG = 0x03; // aka INT, 4 bytes
|
|
287758
|
+
types.exports.FLOAT = 0x04; // aka FLOAT, 4-8 bytes
|
|
287759
|
+
types.exports.DOUBLE = 0x05; // aka DOUBLE, 8 bytes
|
|
287760
|
+
types.exports.NULL = 0x06; // NULL (used for prepared statements, I think)
|
|
287761
|
+
types.exports.TIMESTAMP = 0x07; // aka TIMESTAMP
|
|
287762
|
+
types.exports.LONGLONG = 0x08; // aka BIGINT, 8 bytes
|
|
287763
|
+
types.exports.INT24 = 0x09; // aka MEDIUMINT, 3 bytes
|
|
287764
|
+
types.exports.DATE = 0x0a; // aka DATE
|
|
287765
|
+
types.exports.TIME = 0x0b; // aka TIME
|
|
287766
|
+
types.exports.DATETIME = 0x0c; // aka DATETIME
|
|
287767
|
+
types.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
|
|
287768
|
+
types.exports.NEWDATE = 0x0e; // aka ?
|
|
287769
|
+
types.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
|
|
287770
|
+
types.exports.BIT = 0x10; // aka BIT, 1-8 byte
|
|
287771
|
+
types.exports.VECTOR = 0xf2;
|
|
287772
|
+
types.exports.JSON = 0xf5;
|
|
287773
|
+
types.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
|
|
287774
|
+
types.exports.ENUM = 0xf7; // aka ENUM
|
|
287775
|
+
types.exports.SET = 0xf8; // aka SET
|
|
287776
|
+
types.exports.TINY_BLOB = 0xf9; // aka TINYBLOB, TINYTEXT
|
|
287777
|
+
types.exports.MEDIUM_BLOB = 0xfa; // aka MEDIUMBLOB, MEDIUMTEXT
|
|
287778
|
+
types.exports.LONG_BLOB = 0xfb; // aka LONGBLOG, LONGTEXT
|
|
287779
|
+
types.exports.BLOB = 0xfc; // aka BLOB, TEXT
|
|
287780
|
+
types.exports.VAR_STRING = 0xfd; // aka VARCHAR, VARBINARY
|
|
287781
|
+
types.exports.STRING = 0xfe; // aka CHAR, BINARY
|
|
287782
|
+
types.exports.GEOMETRY = 0xff; // aka GEOMETRY
|
|
287783
|
+
return types.exports;
|
|
288583
287784
|
}var binary_row;
|
|
288584
287785
|
var hasRequiredBinary_row;
|
|
288585
287786
|
|
|
@@ -290785,7 +289986,7 @@ function requireCommand () {
|
|
|
290785
289986
|
if (hasRequiredCommand) return command;
|
|
290786
289987
|
hasRequiredCommand = 1;
|
|
290787
289988
|
|
|
290788
|
-
const EventEmitter = require$$0$
|
|
289989
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
290789
289990
|
const Timers = require$$1$7;
|
|
290790
289991
|
|
|
290791
289992
|
class Command extends EventEmitter {
|
|
@@ -291193,7 +290394,7 @@ function requireSeqQueue$1 () {
|
|
|
291193
290394
|
if (hasRequiredSeqQueue$1) return seqQueue$1.exports;
|
|
291194
290395
|
hasRequiredSeqQueue$1 = 1;
|
|
291195
290396
|
(function (module) {
|
|
291196
|
-
var EventEmitter = require$$0$
|
|
290397
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
291197
290398
|
var util = require$$0$6;
|
|
291198
290399
|
|
|
291199
290400
|
var DEFAULT_TIMEOUT = 3000;
|
|
@@ -293818,7 +293019,6 @@ function requireBinlog_query_statusvars () {
|
|
|
293818
293019
|
FLAGS2: 0,
|
|
293819
293020
|
SQL_MODE: 1,
|
|
293820
293021
|
CATALOG: 2,
|
|
293821
|
-
AUTO_INCREMENT: 3,
|
|
293822
293022
|
CHARSET: 4,
|
|
293823
293023
|
TIME_ZONE: 5,
|
|
293824
293024
|
CATALOG_NZ: 6,
|
|
@@ -294175,112 +293375,9 @@ function requireCommands$7 () {
|
|
|
294175
293375
|
Quit
|
|
294176
293376
|
};
|
|
294177
293377
|
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
|
-
};
|
|
293378
|
+
}var version$1 = "3.11.3";
|
|
294260
293379
|
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;
|
|
293380
|
+
version: version$1};var ssl_profiles = {};var lib$3 = {exports: {}};var defaults$1 = {};var hasRequiredDefaults$1;
|
|
294284
293381
|
|
|
294285
293382
|
function requireDefaults$1 () {
|
|
294286
293383
|
if (hasRequiredDefaults$1) return defaults$1;
|
|
@@ -297618,7 +296715,7 @@ function requirePromise$1 () {
|
|
|
297618
296715
|
(function (exports) {
|
|
297619
296716
|
|
|
297620
296717
|
const core = requireMysql2();
|
|
297621
|
-
const EventEmitter = require$$0$
|
|
296718
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
297622
296719
|
const parserCache = requireParser_cache();
|
|
297623
296720
|
|
|
297624
296721
|
function makeDoneCb(resolve, reject, localErr) {
|
|
@@ -299625,10 +298722,10 @@ function requireConnection$1 () {
|
|
|
299625
298722
|
if (hasRequiredConnection$1) return connection$1;
|
|
299626
298723
|
hasRequiredConnection$1 = 1;
|
|
299627
298724
|
|
|
299628
|
-
const Net = require$$0$
|
|
298725
|
+
const Net = require$$0$8;
|
|
299629
298726
|
const Tls = require$$1$1;
|
|
299630
298727
|
const Timers = require$$1$7;
|
|
299631
|
-
const EventEmitter = require$$0$
|
|
298728
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
299632
298729
|
const Readable = require$$0$b.Readable;
|
|
299633
298730
|
const Queue = requireDenque();
|
|
299634
298731
|
const SqlString = requireSqlstring();
|
|
@@ -300642,7 +299739,7 @@ function requirePool$1 () {
|
|
|
300642
299739
|
const process = require$$0$o;
|
|
300643
299740
|
const mysql = requireMysql2();
|
|
300644
299741
|
|
|
300645
|
-
const EventEmitter = require$$0$
|
|
299742
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
300646
299743
|
const PoolConnection = requirePool_connection();
|
|
300647
299744
|
const Queue = requireDenque();
|
|
300648
299745
|
const Connection = requireConnection$1();
|
|
@@ -300924,7 +300021,7 @@ function requirePool_cluster () {
|
|
|
300924
300021
|
const Pool = requirePool$1();
|
|
300925
300022
|
const PoolConfig = requirePool_config();
|
|
300926
300023
|
const Connection = requireConnection$1();
|
|
300927
|
-
const EventEmitter = require$$0$
|
|
300024
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
300928
300025
|
|
|
300929
300026
|
/**
|
|
300930
300027
|
* Selector
|
|
@@ -301208,8 +300305,8 @@ function requireServer () {
|
|
|
301208
300305
|
if (hasRequiredServer) return server;
|
|
301209
300306
|
hasRequiredServer = 1;
|
|
301210
300307
|
|
|
301211
|
-
const net = require$$0$
|
|
301212
|
-
const EventEmitter = require$$0$
|
|
300308
|
+
const net = require$$0$8;
|
|
300309
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
301213
300310
|
|
|
301214
300311
|
const Connection = requireConnection$1();
|
|
301215
300312
|
const ConnectionConfig = requireConnection_config();
|
|
@@ -302993,6 +302090,11 @@ function requireUtilsLegacy () {
|
|
|
302993
302090
|
return nodeCrypto.createHash('sha256').update(text).digest()
|
|
302994
302091
|
}
|
|
302995
302092
|
|
|
302093
|
+
function hashByName(hashName, text) {
|
|
302094
|
+
hashName = hashName.replace(/(\D)-/, '$1'); // e.g. SHA-256 -> SHA256
|
|
302095
|
+
return nodeCrypto.createHash(hashName).update(text).digest()
|
|
302096
|
+
}
|
|
302097
|
+
|
|
302996
302098
|
function hmacSha256(key, msg) {
|
|
302997
302099
|
return nodeCrypto.createHmac('sha256', key).update(msg).digest()
|
|
302998
302100
|
}
|
|
@@ -303006,6 +302108,7 @@ function requireUtilsLegacy () {
|
|
|
303006
302108
|
randomBytes: nodeCrypto.randomBytes,
|
|
303007
302109
|
deriveKey,
|
|
303008
302110
|
sha256,
|
|
302111
|
+
hashByName,
|
|
303009
302112
|
hmacSha256,
|
|
303010
302113
|
md5,
|
|
303011
302114
|
};
|
|
@@ -303023,6 +302126,7 @@ function requireUtilsWebcrypto () {
|
|
|
303023
302126
|
randomBytes,
|
|
303024
302127
|
deriveKey,
|
|
303025
302128
|
sha256,
|
|
302129
|
+
hashByName,
|
|
303026
302130
|
hmacSha256,
|
|
303027
302131
|
md5,
|
|
303028
302132
|
};
|
|
@@ -303031,6 +302135,7 @@ function requireUtilsWebcrypto () {
|
|
|
303031
302135
|
* The Web Crypto API - grabbed from the Node.js library or the global
|
|
303032
302136
|
* @type Crypto
|
|
303033
302137
|
*/
|
|
302138
|
+
// eslint-disable-next-line no-undef
|
|
303034
302139
|
const webCrypto = nodeCrypto.webcrypto || globalThis.crypto;
|
|
303035
302140
|
/**
|
|
303036
302141
|
* The SubtleCrypto API for low level crypto operations.
|
|
@@ -303078,6 +302183,10 @@ function requireUtilsWebcrypto () {
|
|
|
303078
302183
|
return await subtleCrypto.digest('SHA-256', text)
|
|
303079
302184
|
}
|
|
303080
302185
|
|
|
302186
|
+
async function hashByName(hashName, text) {
|
|
302187
|
+
return await subtleCrypto.digest(hashName, text)
|
|
302188
|
+
}
|
|
302189
|
+
|
|
303081
302190
|
/**
|
|
303082
302191
|
* Sign the message with the given key
|
|
303083
302192
|
* @param {ArrayBuffer} keyBuffer
|
|
@@ -303114,6 +302223,135 @@ function requireUtils$2 () {
|
|
|
303114
302223
|
utils$2.exports = requireUtilsWebcrypto();
|
|
303115
302224
|
}
|
|
303116
302225
|
return utils$2.exports;
|
|
302226
|
+
}var certSignatures;
|
|
302227
|
+
var hasRequiredCertSignatures;
|
|
302228
|
+
|
|
302229
|
+
function requireCertSignatures () {
|
|
302230
|
+
if (hasRequiredCertSignatures) return certSignatures;
|
|
302231
|
+
hasRequiredCertSignatures = 1;
|
|
302232
|
+
function x509Error(msg, cert) {
|
|
302233
|
+
return new Error('SASL channel binding: ' + msg + ' when parsing public certificate ' + cert.toString('base64'))
|
|
302234
|
+
}
|
|
302235
|
+
|
|
302236
|
+
function readASN1Length(data, index) {
|
|
302237
|
+
let length = data[index++];
|
|
302238
|
+
if (length < 0x80) return { length, index }
|
|
302239
|
+
|
|
302240
|
+
const lengthBytes = length & 0x7f;
|
|
302241
|
+
if (lengthBytes > 4) throw x509Error('bad length', data)
|
|
302242
|
+
|
|
302243
|
+
length = 0;
|
|
302244
|
+
for (let i = 0; i < lengthBytes; i++) {
|
|
302245
|
+
length = (length << 8) | data[index++];
|
|
302246
|
+
}
|
|
302247
|
+
|
|
302248
|
+
return { length, index }
|
|
302249
|
+
}
|
|
302250
|
+
|
|
302251
|
+
function readASN1OID(data, index) {
|
|
302252
|
+
if (data[index++] !== 0x6) throw x509Error('non-OID data', data) // 6 = OID
|
|
302253
|
+
|
|
302254
|
+
const { length: OIDLength, index: indexAfterOIDLength } = readASN1Length(data, index);
|
|
302255
|
+
index = indexAfterOIDLength;
|
|
302256
|
+
let lastIndex = index + OIDLength;
|
|
302257
|
+
|
|
302258
|
+
const byte1 = data[index++];
|
|
302259
|
+
let oid = ((byte1 / 40) >> 0) + '.' + (byte1 % 40);
|
|
302260
|
+
|
|
302261
|
+
while (index < lastIndex) {
|
|
302262
|
+
// loop over numbers in OID
|
|
302263
|
+
let value = 0;
|
|
302264
|
+
while (index < lastIndex) {
|
|
302265
|
+
// loop over bytes in number
|
|
302266
|
+
const nextByte = data[index++];
|
|
302267
|
+
value = (value << 7) | (nextByte & 0x7f);
|
|
302268
|
+
if (nextByte < 0x80) break
|
|
302269
|
+
}
|
|
302270
|
+
oid += '.' + value;
|
|
302271
|
+
}
|
|
302272
|
+
|
|
302273
|
+
return { oid, index }
|
|
302274
|
+
}
|
|
302275
|
+
|
|
302276
|
+
function expectASN1Seq(data, index) {
|
|
302277
|
+
if (data[index++] !== 0x30) throw x509Error('non-sequence data', data) // 30 = Sequence
|
|
302278
|
+
return readASN1Length(data, index)
|
|
302279
|
+
}
|
|
302280
|
+
|
|
302281
|
+
function signatureAlgorithmHashFromCertificate(data, index) {
|
|
302282
|
+
// read this thread: https://www.postgresql.org/message-id/17760-b6c61e752ec07060%40postgresql.org
|
|
302283
|
+
if (index === undefined) index = 0;
|
|
302284
|
+
index = expectASN1Seq(data, index).index;
|
|
302285
|
+
const { length: certInfoLength, index: indexAfterCertInfoLength } = expectASN1Seq(data, index);
|
|
302286
|
+
index = indexAfterCertInfoLength + certInfoLength; // skip over certificate info
|
|
302287
|
+
index = expectASN1Seq(data, index).index; // skip over signature length field
|
|
302288
|
+
const { oid, index: indexAfterOID } = readASN1OID(data, index);
|
|
302289
|
+
switch (oid) {
|
|
302290
|
+
// RSA
|
|
302291
|
+
case '1.2.840.113549.1.1.4':
|
|
302292
|
+
return 'MD5'
|
|
302293
|
+
case '1.2.840.113549.1.1.5':
|
|
302294
|
+
return 'SHA-1'
|
|
302295
|
+
case '1.2.840.113549.1.1.11':
|
|
302296
|
+
return 'SHA-256'
|
|
302297
|
+
case '1.2.840.113549.1.1.12':
|
|
302298
|
+
return 'SHA-384'
|
|
302299
|
+
case '1.2.840.113549.1.1.13':
|
|
302300
|
+
return 'SHA-512'
|
|
302301
|
+
case '1.2.840.113549.1.1.14':
|
|
302302
|
+
return 'SHA-224'
|
|
302303
|
+
case '1.2.840.113549.1.1.15':
|
|
302304
|
+
return 'SHA512-224'
|
|
302305
|
+
case '1.2.840.113549.1.1.16':
|
|
302306
|
+
return 'SHA512-256'
|
|
302307
|
+
// ECDSA
|
|
302308
|
+
case '1.2.840.10045.4.1':
|
|
302309
|
+
return 'SHA-1'
|
|
302310
|
+
case '1.2.840.10045.4.3.1':
|
|
302311
|
+
return 'SHA-224'
|
|
302312
|
+
case '1.2.840.10045.4.3.2':
|
|
302313
|
+
return 'SHA-256'
|
|
302314
|
+
case '1.2.840.10045.4.3.3':
|
|
302315
|
+
return 'SHA-384'
|
|
302316
|
+
case '1.2.840.10045.4.3.4':
|
|
302317
|
+
return 'SHA-512'
|
|
302318
|
+
// RSASSA-PSS: hash is indicated separately
|
|
302319
|
+
case '1.2.840.113549.1.1.10': {
|
|
302320
|
+
index = indexAfterOID;
|
|
302321
|
+
index = expectASN1Seq(data, index).index;
|
|
302322
|
+
if (data[index++] !== 0xa0) throw x509Error('non-tag data', data) // a0 = constructed tag 0
|
|
302323
|
+
index = readASN1Length(data, index).index; // skip over tag length field
|
|
302324
|
+
index = expectASN1Seq(data, index).index; // skip over sequence length field
|
|
302325
|
+
const { oid: hashOID } = readASN1OID(data, index);
|
|
302326
|
+
switch (hashOID) {
|
|
302327
|
+
// standalone hash OIDs
|
|
302328
|
+
case '1.2.840.113549.2.5':
|
|
302329
|
+
return 'MD5'
|
|
302330
|
+
case '1.3.14.3.2.26':
|
|
302331
|
+
return 'SHA-1'
|
|
302332
|
+
case '2.16.840.1.101.3.4.2.1':
|
|
302333
|
+
return 'SHA-256'
|
|
302334
|
+
case '2.16.840.1.101.3.4.2.2':
|
|
302335
|
+
return 'SHA-384'
|
|
302336
|
+
case '2.16.840.1.101.3.4.2.3':
|
|
302337
|
+
return 'SHA-512'
|
|
302338
|
+
}
|
|
302339
|
+
throw x509Error('unknown hash OID ' + hashOID, data)
|
|
302340
|
+
}
|
|
302341
|
+
// Ed25519 -- see https: return//github.com/openssl/openssl/issues/15477
|
|
302342
|
+
case '1.3.101.110':
|
|
302343
|
+
case '1.3.101.112': // ph
|
|
302344
|
+
return 'SHA-512'
|
|
302345
|
+
// Ed448 -- still not in pg 17.2 (if supported, digest would be SHAKE256 x 64 bytes)
|
|
302346
|
+
case '1.3.101.111':
|
|
302347
|
+
case '1.3.101.113': // ph
|
|
302348
|
+
throw x509Error('Ed448 certificate channel binding is not currently supported by Postgres')
|
|
302349
|
+
}
|
|
302350
|
+
throw x509Error('unknown OID ' + oid, data)
|
|
302351
|
+
}
|
|
302352
|
+
|
|
302353
|
+
certSignatures = { signatureAlgorithmHashFromCertificate };
|
|
302354
|
+
return certSignatures;
|
|
303117
302355
|
}var sasl;
|
|
303118
302356
|
var hasRequiredSasl;
|
|
303119
302357
|
|
|
@@ -303121,23 +302359,35 @@ function requireSasl () {
|
|
|
303121
302359
|
if (hasRequiredSasl) return sasl;
|
|
303122
302360
|
hasRequiredSasl = 1;
|
|
303123
302361
|
const crypto = requireUtils$2();
|
|
302362
|
+
const { signatureAlgorithmHashFromCertificate } = requireCertSignatures();
|
|
302363
|
+
|
|
302364
|
+
function startSession(mechanisms, stream) {
|
|
302365
|
+
const candidates = ['SCRAM-SHA-256'];
|
|
302366
|
+
if (stream) candidates.unshift('SCRAM-SHA-256-PLUS'); // higher-priority, so placed first
|
|
302367
|
+
|
|
302368
|
+
const mechanism = candidates.find((candidate) => mechanisms.includes(candidate));
|
|
302369
|
+
|
|
302370
|
+
if (!mechanism) {
|
|
302371
|
+
throw new Error('SASL: Only mechanism(s) ' + candidates.join(' and ') + ' are supported')
|
|
302372
|
+
}
|
|
303124
302373
|
|
|
303125
|
-
|
|
303126
|
-
|
|
303127
|
-
throw new Error('SASL:
|
|
302374
|
+
if (mechanism === 'SCRAM-SHA-256-PLUS' && typeof stream.getPeerCertificate !== 'function') {
|
|
302375
|
+
// this should never happen if we are really talking to a Postgres server
|
|
302376
|
+
throw new Error('SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate')
|
|
303128
302377
|
}
|
|
303129
302378
|
|
|
303130
302379
|
const clientNonce = crypto.randomBytes(18).toString('base64');
|
|
302380
|
+
const gs2Header = mechanism === 'SCRAM-SHA-256-PLUS' ? 'p=tls-server-end-point' : stream ? 'y' : 'n';
|
|
303131
302381
|
|
|
303132
302382
|
return {
|
|
303133
|
-
mechanism
|
|
302383
|
+
mechanism,
|
|
303134
302384
|
clientNonce,
|
|
303135
|
-
response: '
|
|
302385
|
+
response: gs2Header + ',,n=*,r=' + clientNonce,
|
|
303136
302386
|
message: 'SASLInitialResponse',
|
|
303137
302387
|
}
|
|
303138
302388
|
}
|
|
303139
302389
|
|
|
303140
|
-
async function continueSession(session, password, serverData) {
|
|
302390
|
+
async function continueSession(session, password, serverData, stream) {
|
|
303141
302391
|
if (session.message !== 'SASLInitialResponse') {
|
|
303142
302392
|
throw new Error('SASL: Last message was not SASLInitialResponse')
|
|
303143
302393
|
}
|
|
@@ -303161,7 +302411,21 @@ function requireSasl () {
|
|
|
303161
302411
|
|
|
303162
302412
|
var clientFirstMessageBare = 'n=*,r=' + session.clientNonce;
|
|
303163
302413
|
var serverFirstMessage = 'r=' + sv.nonce + ',s=' + sv.salt + ',i=' + sv.iteration;
|
|
303164
|
-
|
|
302414
|
+
|
|
302415
|
+
// without channel binding:
|
|
302416
|
+
let channelBinding = stream ? 'eSws' : 'biws'; // 'y,,' or 'n,,', base64-encoded
|
|
302417
|
+
|
|
302418
|
+
// override if channel binding is in use:
|
|
302419
|
+
if (session.mechanism === 'SCRAM-SHA-256-PLUS') {
|
|
302420
|
+
const peerCert = stream.getPeerCertificate().raw;
|
|
302421
|
+
let hashName = signatureAlgorithmHashFromCertificate(peerCert);
|
|
302422
|
+
if (hashName === 'MD5' || hashName === 'SHA-1') hashName = 'SHA-256';
|
|
302423
|
+
const certHash = await crypto.hashByName(hashName, peerCert);
|
|
302424
|
+
const bindingData = Buffer.concat([Buffer.from('p=tls-server-end-point,,'), Buffer.from(certHash)]);
|
|
302425
|
+
channelBinding = bindingData.toString('base64');
|
|
302426
|
+
}
|
|
302427
|
+
|
|
302428
|
+
var clientFinalMessageWithoutProof = 'c=' + channelBinding + ',r=' + sv.nonce;
|
|
303165
302429
|
var authMessage = clientFirstMessageBare + ',' + serverFirstMessage + ',' + clientFinalMessageWithoutProof;
|
|
303166
302430
|
|
|
303167
302431
|
var saltBytes = Buffer.from(sv.salt, 'base64');
|
|
@@ -303359,7 +302623,7 @@ function requirePgConnectionString () {
|
|
|
303359
302623
|
//MIT License
|
|
303360
302624
|
|
|
303361
302625
|
//parses a connection string
|
|
303362
|
-
function parse(str) {
|
|
302626
|
+
function parse(str, options = {}) {
|
|
303363
302627
|
//unix socket
|
|
303364
302628
|
if (str.charAt(0) === '/') {
|
|
303365
302629
|
const config = str.split(' ');
|
|
@@ -303373,7 +302637,7 @@ function requirePgConnectionString () {
|
|
|
303373
302637
|
let dummyHost = false;
|
|
303374
302638
|
if (/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(str)) {
|
|
303375
302639
|
// Ensure spaces are encoded as %20
|
|
303376
|
-
str = encodeURI(str).replace(
|
|
302640
|
+
str = encodeURI(str).replace(/%25(\d\d)/g, '%$1');
|
|
303377
302641
|
}
|
|
303378
302642
|
|
|
303379
302643
|
try {
|
|
@@ -303441,29 +302705,126 @@ function requirePgConnectionString () {
|
|
|
303441
302705
|
config.ssl.ca = fs.readFileSync(config.sslrootcert).toString();
|
|
303442
302706
|
}
|
|
303443
302707
|
|
|
303444
|
-
|
|
303445
|
-
|
|
303446
|
-
|
|
303447
|
-
|
|
303448
|
-
|
|
303449
|
-
|
|
303450
|
-
|
|
303451
|
-
|
|
303452
|
-
|
|
303453
|
-
|
|
302708
|
+
if (options.useLibpqCompat && config.uselibpqcompat) {
|
|
302709
|
+
throw new Error('Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.')
|
|
302710
|
+
}
|
|
302711
|
+
|
|
302712
|
+
if (config.uselibpqcompat === 'true' || options.useLibpqCompat) {
|
|
302713
|
+
switch (config.sslmode) {
|
|
302714
|
+
case 'disable': {
|
|
302715
|
+
config.ssl = false;
|
|
302716
|
+
break
|
|
302717
|
+
}
|
|
302718
|
+
case 'prefer': {
|
|
302719
|
+
config.ssl.rejectUnauthorized = false;
|
|
302720
|
+
break
|
|
302721
|
+
}
|
|
302722
|
+
case 'require': {
|
|
302723
|
+
if (config.sslrootcert) {
|
|
302724
|
+
// If a root CA is specified, behavior of `sslmode=require` will be the same as that of `verify-ca`
|
|
302725
|
+
config.ssl.checkServerIdentity = function () {};
|
|
302726
|
+
} else {
|
|
302727
|
+
config.ssl.rejectUnauthorized = false;
|
|
302728
|
+
}
|
|
302729
|
+
break
|
|
302730
|
+
}
|
|
302731
|
+
case 'verify-ca': {
|
|
302732
|
+
if (!config.ssl.ca) {
|
|
302733
|
+
throw new Error(
|
|
302734
|
+
'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.'
|
|
302735
|
+
)
|
|
302736
|
+
}
|
|
302737
|
+
config.ssl.checkServerIdentity = function () {};
|
|
302738
|
+
break
|
|
302739
|
+
}
|
|
303454
302740
|
}
|
|
303455
|
-
|
|
303456
|
-
|
|
303457
|
-
|
|
302741
|
+
} else {
|
|
302742
|
+
switch (config.sslmode) {
|
|
302743
|
+
case 'disable': {
|
|
302744
|
+
config.ssl = false;
|
|
302745
|
+
break
|
|
302746
|
+
}
|
|
302747
|
+
case 'prefer':
|
|
302748
|
+
case 'require':
|
|
302749
|
+
case 'verify-ca':
|
|
302750
|
+
case 'verify-full': {
|
|
302751
|
+
break
|
|
302752
|
+
}
|
|
302753
|
+
case 'no-verify': {
|
|
302754
|
+
config.ssl.rejectUnauthorized = false;
|
|
302755
|
+
break
|
|
302756
|
+
}
|
|
303458
302757
|
}
|
|
303459
302758
|
}
|
|
303460
302759
|
|
|
303461
302760
|
return config
|
|
303462
302761
|
}
|
|
303463
302762
|
|
|
302763
|
+
// convert pg-connection-string ssl config to a ClientConfig.ConnectionOptions
|
|
302764
|
+
function toConnectionOptions(sslConfig) {
|
|
302765
|
+
const connectionOptions = Object.entries(sslConfig).reduce((c, [key, value]) => {
|
|
302766
|
+
// we explicitly check for undefined and null instead of `if (value)` because some
|
|
302767
|
+
// options accept falsy values. Example: `ssl.rejectUnauthorized = false`
|
|
302768
|
+
if (value !== undefined && value !== null) {
|
|
302769
|
+
c[key] = value;
|
|
302770
|
+
}
|
|
302771
|
+
|
|
302772
|
+
return c
|
|
302773
|
+
}, {});
|
|
302774
|
+
|
|
302775
|
+
return connectionOptions
|
|
302776
|
+
}
|
|
302777
|
+
|
|
302778
|
+
// convert pg-connection-string config to a ClientConfig
|
|
302779
|
+
function toClientConfig(config) {
|
|
302780
|
+
const poolConfig = Object.entries(config).reduce((c, [key, value]) => {
|
|
302781
|
+
if (key === 'ssl') {
|
|
302782
|
+
const sslConfig = value;
|
|
302783
|
+
|
|
302784
|
+
if (typeof sslConfig === 'boolean') {
|
|
302785
|
+
c[key] = sslConfig;
|
|
302786
|
+
}
|
|
302787
|
+
// else path is taken. multiple tests produce a sslConfig that is an object
|
|
302788
|
+
// and we can console.log to see that we take this path
|
|
302789
|
+
//
|
|
302790
|
+
// see https://github.com/istanbuljs/babel-plugin-istanbul/issues/186#issuecomment-1137765139
|
|
302791
|
+
// istanbul ignore else
|
|
302792
|
+
else if (typeof sslConfig === 'object') {
|
|
302793
|
+
c[key] = toConnectionOptions(sslConfig);
|
|
302794
|
+
}
|
|
302795
|
+
} else if (value !== undefined && value !== null) {
|
|
302796
|
+
if (key === 'port') {
|
|
302797
|
+
// when port is not specified, it is converted into an empty string
|
|
302798
|
+
// we want to avoid NaN or empty string as a values in ClientConfig
|
|
302799
|
+
if (value !== '') {
|
|
302800
|
+
const v = parseInt(value, 10);
|
|
302801
|
+
if (isNaN(v)) {
|
|
302802
|
+
throw new Error(`Invalid ${key}: ${value}`)
|
|
302803
|
+
}
|
|
302804
|
+
|
|
302805
|
+
c[key] = v;
|
|
302806
|
+
}
|
|
302807
|
+
} else {
|
|
302808
|
+
c[key] = value;
|
|
302809
|
+
}
|
|
302810
|
+
}
|
|
302811
|
+
|
|
302812
|
+
return c
|
|
302813
|
+
}, {});
|
|
302814
|
+
|
|
302815
|
+
return poolConfig
|
|
302816
|
+
}
|
|
302817
|
+
|
|
302818
|
+
// parses a connection string into ClientConfig
|
|
302819
|
+
function parseIntoClientConfig(str) {
|
|
302820
|
+
return toClientConfig(parse(str))
|
|
302821
|
+
}
|
|
302822
|
+
|
|
303464
302823
|
pgConnectionString = parse;
|
|
303465
302824
|
|
|
303466
302825
|
parse.parse = parse;
|
|
302826
|
+
parse.toClientConfig = toClientConfig;
|
|
302827
|
+
parse.parseIntoClientConfig = parseIntoClientConfig;
|
|
303467
302828
|
return pgConnectionString;
|
|
303468
302829
|
}var connectionParameters;
|
|
303469
302830
|
var hasRequiredConnectionParameters;
|
|
@@ -303757,7 +303118,7 @@ function requireQuery$1 () {
|
|
|
303757
303118
|
if (hasRequiredQuery$1) return query$1;
|
|
303758
303119
|
hasRequiredQuery$1 = 1;
|
|
303759
303120
|
|
|
303760
|
-
const { EventEmitter } = require$$0$
|
|
303121
|
+
const { EventEmitter } = require$$0$7;
|
|
303761
303122
|
|
|
303762
303123
|
const Result = requireResult();
|
|
303763
303124
|
const utils = requireUtils$3();
|
|
@@ -303918,7 +303279,21 @@ function requireQuery$1 () {
|
|
|
303918
303279
|
return new Error('Query values must be an array')
|
|
303919
303280
|
}
|
|
303920
303281
|
if (this.requiresPreparation()) {
|
|
303921
|
-
|
|
303282
|
+
// If we're using the extended query protocol we fire off several separate commands
|
|
303283
|
+
// to the backend. On some versions of node & some operating system versions
|
|
303284
|
+
// the network stack writes each message separately instead of buffering them together
|
|
303285
|
+
// causing the client & network to send more slowly. Corking & uncorking the stream
|
|
303286
|
+
// allows node to buffer up the messages internally before sending them all off at once.
|
|
303287
|
+
// note: we're checking for existence of cork/uncork because some versions of streams
|
|
303288
|
+
// might not have this (cloudflare?)
|
|
303289
|
+
connection.stream.cork && connection.stream.cork();
|
|
303290
|
+
try {
|
|
303291
|
+
this.prepare(connection);
|
|
303292
|
+
} finally {
|
|
303293
|
+
// while unlikely for this.prepare to throw, if it does & we don't uncork this stream
|
|
303294
|
+
// this client becomes unresponsive, so put in finally block "just in case"
|
|
303295
|
+
connection.stream.uncork && connection.stream.uncork();
|
|
303296
|
+
}
|
|
303922
303297
|
} else {
|
|
303923
303298
|
connection.query(this.text);
|
|
303924
303299
|
}
|
|
@@ -303995,7 +303370,7 @@ function requireQuery$1 () {
|
|
|
303995
303370
|
|
|
303996
303371
|
query$1 = Query;
|
|
303997
303372
|
return query$1;
|
|
303998
|
-
}var dist$
|
|
303373
|
+
}var dist$8 = {};var messages = {};var hasRequiredMessages;
|
|
303999
303374
|
|
|
304000
303375
|
function requireMessages () {
|
|
304001
303376
|
if (hasRequiredMessages) return messages;
|
|
@@ -304487,6 +303862,7 @@ function requireBufferReader () {
|
|
|
304487
303862
|
cstring() {
|
|
304488
303863
|
const start = this.offset;
|
|
304489
303864
|
let end = start;
|
|
303865
|
+
// eslint-disable-next-line no-empty
|
|
304490
303866
|
while (this.buffer[end++] !== 0) { }
|
|
304491
303867
|
this.offset = end;
|
|
304492
303868
|
return this.buffer.toString(this.encoding, start, end - 1);
|
|
@@ -304754,15 +304130,17 @@ function requireParser () {
|
|
|
304754
304130
|
}
|
|
304755
304131
|
break;
|
|
304756
304132
|
case 10: // AuthenticationSASL
|
|
304757
|
-
|
|
304758
|
-
|
|
304759
|
-
|
|
304760
|
-
|
|
304761
|
-
|
|
304762
|
-
|
|
304763
|
-
|
|
304764
|
-
|
|
304765
|
-
|
|
304133
|
+
{
|
|
304134
|
+
message.name = 'authenticationSASL';
|
|
304135
|
+
message.mechanisms = [];
|
|
304136
|
+
let mechanism;
|
|
304137
|
+
do {
|
|
304138
|
+
mechanism = this.reader.cstring();
|
|
304139
|
+
if (mechanism) {
|
|
304140
|
+
message.mechanisms.push(mechanism);
|
|
304141
|
+
}
|
|
304142
|
+
} while (mechanism);
|
|
304143
|
+
}
|
|
304766
304144
|
break;
|
|
304767
304145
|
case 11: // AuthenticationSASLContinue
|
|
304768
304146
|
message.name = 'authenticationSASLContinue';
|
|
@@ -304809,11 +304187,11 @@ function requireParser () {
|
|
|
304809
304187
|
parser.Parser = Parser;
|
|
304810
304188
|
|
|
304811
304189
|
return parser;
|
|
304812
|
-
}var hasRequiredDist$
|
|
304190
|
+
}var hasRequiredDist$8;
|
|
304813
304191
|
|
|
304814
|
-
function requireDist$
|
|
304815
|
-
if (hasRequiredDist$
|
|
304816
|
-
hasRequiredDist$
|
|
304192
|
+
function requireDist$8 () {
|
|
304193
|
+
if (hasRequiredDist$8) return dist$8;
|
|
304194
|
+
hasRequiredDist$8 = 1;
|
|
304817
304195
|
(function (exports) {
|
|
304818
304196
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
304819
304197
|
exports.DatabaseError = exports.serialize = exports.parse = void 0;
|
|
@@ -304829,11 +304207,166 @@ function requireDist$7 () {
|
|
|
304829
304207
|
}
|
|
304830
304208
|
exports.parse = parse;
|
|
304831
304209
|
|
|
304832
|
-
} (dist$
|
|
304210
|
+
} (dist$8));
|
|
304211
|
+
return dist$8;
|
|
304212
|
+
}var dist$7 = {};var hasRequiredDist$7;
|
|
304213
|
+
|
|
304214
|
+
function requireDist$7 () {
|
|
304215
|
+
if (hasRequiredDist$7) return dist$7;
|
|
304216
|
+
hasRequiredDist$7 = 1;
|
|
304217
|
+
Object.defineProperty(dist$7, "__esModule", { value: true });
|
|
304218
|
+
dist$7.CloudflareSocket = void 0;
|
|
304219
|
+
const events_1 = require$$0$7;
|
|
304220
|
+
/**
|
|
304221
|
+
* Wrapper around the Cloudflare built-in socket that can be used by the `Connection`.
|
|
304222
|
+
*/
|
|
304223
|
+
class CloudflareSocket extends events_1.EventEmitter {
|
|
304224
|
+
constructor(ssl) {
|
|
304225
|
+
super();
|
|
304226
|
+
this.ssl = ssl;
|
|
304227
|
+
this.writable = false;
|
|
304228
|
+
this.destroyed = false;
|
|
304229
|
+
this._upgrading = false;
|
|
304230
|
+
this._upgraded = false;
|
|
304231
|
+
this._cfSocket = null;
|
|
304232
|
+
this._cfWriter = null;
|
|
304233
|
+
this._cfReader = null;
|
|
304234
|
+
}
|
|
304235
|
+
setNoDelay() {
|
|
304236
|
+
return this;
|
|
304237
|
+
}
|
|
304238
|
+
setKeepAlive() {
|
|
304239
|
+
return this;
|
|
304240
|
+
}
|
|
304241
|
+
ref() {
|
|
304242
|
+
return this;
|
|
304243
|
+
}
|
|
304244
|
+
unref() {
|
|
304245
|
+
return this;
|
|
304246
|
+
}
|
|
304247
|
+
async connect(port, host, connectListener) {
|
|
304248
|
+
try {
|
|
304249
|
+
log('connecting');
|
|
304250
|
+
if (connectListener)
|
|
304251
|
+
this.once('connect', connectListener);
|
|
304252
|
+
const options = this.ssl ? { secureTransport: 'starttls' } : {};
|
|
304253
|
+
const mod = await import('cloudflare:sockets');
|
|
304254
|
+
const connect = mod.connect;
|
|
304255
|
+
this._cfSocket = connect(`${host}:${port}`, options);
|
|
304256
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
304257
|
+
this._addClosedHandler();
|
|
304258
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
304259
|
+
if (this.ssl) {
|
|
304260
|
+
this._listenOnce().catch((e) => this.emit('error', e));
|
|
304261
|
+
}
|
|
304262
|
+
else {
|
|
304263
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
304264
|
+
}
|
|
304265
|
+
await this._cfWriter.ready;
|
|
304266
|
+
log('socket ready');
|
|
304267
|
+
this.writable = true;
|
|
304268
|
+
this.emit('connect');
|
|
304269
|
+
return this;
|
|
304270
|
+
}
|
|
304271
|
+
catch (e) {
|
|
304272
|
+
this.emit('error', e);
|
|
304273
|
+
}
|
|
304274
|
+
}
|
|
304275
|
+
async _listen() {
|
|
304276
|
+
// eslint-disable-next-line no-constant-condition
|
|
304277
|
+
while (true) {
|
|
304278
|
+
log('awaiting receive from CF socket');
|
|
304279
|
+
const { done, value } = await this._cfReader.read();
|
|
304280
|
+
log('CF socket received:', done, value);
|
|
304281
|
+
if (done) {
|
|
304282
|
+
log('done');
|
|
304283
|
+
break;
|
|
304284
|
+
}
|
|
304285
|
+
this.emit('data', Buffer.from(value));
|
|
304286
|
+
}
|
|
304287
|
+
}
|
|
304288
|
+
async _listenOnce() {
|
|
304289
|
+
log('awaiting first receive from CF socket');
|
|
304290
|
+
const { done, value } = await this._cfReader.read();
|
|
304291
|
+
log('First CF socket received:', done, value);
|
|
304292
|
+
this.emit('data', Buffer.from(value));
|
|
304293
|
+
}
|
|
304294
|
+
write(data, encoding = 'utf8', callback = () => { }) {
|
|
304295
|
+
if (data.length === 0)
|
|
304296
|
+
return callback();
|
|
304297
|
+
if (typeof data === 'string')
|
|
304298
|
+
data = Buffer.from(data, encoding);
|
|
304299
|
+
log('sending data direct:', data);
|
|
304300
|
+
this._cfWriter.write(data).then(() => {
|
|
304301
|
+
log('data sent');
|
|
304302
|
+
callback();
|
|
304303
|
+
}, (err) => {
|
|
304304
|
+
log('send error', err);
|
|
304305
|
+
callback(err);
|
|
304306
|
+
});
|
|
304307
|
+
return true;
|
|
304308
|
+
}
|
|
304309
|
+
end(data = Buffer.alloc(0), encoding = 'utf8', callback = () => { }) {
|
|
304310
|
+
log('ending CF socket');
|
|
304311
|
+
this.write(data, encoding, (err) => {
|
|
304312
|
+
this._cfSocket.close();
|
|
304313
|
+
if (callback)
|
|
304314
|
+
callback(err);
|
|
304315
|
+
});
|
|
304316
|
+
return this;
|
|
304317
|
+
}
|
|
304318
|
+
destroy(reason) {
|
|
304319
|
+
log('destroying CF socket', reason);
|
|
304320
|
+
this.destroyed = true;
|
|
304321
|
+
return this.end();
|
|
304322
|
+
}
|
|
304323
|
+
startTls(options) {
|
|
304324
|
+
if (this._upgraded) {
|
|
304325
|
+
// Don't try to upgrade again.
|
|
304326
|
+
this.emit('error', 'Cannot call `startTls()` more than once on a socket');
|
|
304327
|
+
return;
|
|
304328
|
+
}
|
|
304329
|
+
this._cfWriter.releaseLock();
|
|
304330
|
+
this._cfReader.releaseLock();
|
|
304331
|
+
this._upgrading = true;
|
|
304332
|
+
this._cfSocket = this._cfSocket.startTls(options);
|
|
304333
|
+
this._cfWriter = this._cfSocket.writable.getWriter();
|
|
304334
|
+
this._cfReader = this._cfSocket.readable.getReader();
|
|
304335
|
+
this._addClosedHandler();
|
|
304336
|
+
this._listen().catch((e) => this.emit('error', e));
|
|
304337
|
+
}
|
|
304338
|
+
_addClosedHandler() {
|
|
304339
|
+
this._cfSocket.closed.then(() => {
|
|
304340
|
+
if (!this._upgrading) {
|
|
304341
|
+
log('CF socket closed');
|
|
304342
|
+
this._cfSocket = null;
|
|
304343
|
+
this.emit('close');
|
|
304344
|
+
}
|
|
304345
|
+
else {
|
|
304346
|
+
this._upgrading = false;
|
|
304347
|
+
this._upgraded = true;
|
|
304348
|
+
}
|
|
304349
|
+
}).catch((e) => this.emit('error', e));
|
|
304350
|
+
}
|
|
304351
|
+
}
|
|
304352
|
+
dist$7.CloudflareSocket = CloudflareSocket;
|
|
304353
|
+
const debug = false;
|
|
304354
|
+
function dump(data) {
|
|
304355
|
+
if (data instanceof Uint8Array || data instanceof ArrayBuffer) {
|
|
304356
|
+
const hex = Buffer.from(data).toString('hex');
|
|
304357
|
+
const str = new TextDecoder().decode(data);
|
|
304358
|
+
return `\n>>> STR: "${str.replace(/\n/g, '\\n')}"\n>>> HEX: ${hex}\n`;
|
|
304359
|
+
}
|
|
304360
|
+
else {
|
|
304361
|
+
return data;
|
|
304362
|
+
}
|
|
304363
|
+
}
|
|
304364
|
+
function log(...args) {
|
|
304365
|
+
debug && console.log(...args.map(dump));
|
|
304366
|
+
}
|
|
304367
|
+
|
|
304833
304368
|
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;
|
|
304369
|
+
}var stream$2;
|
|
304837
304370
|
var hasRequiredStream$1;
|
|
304838
304371
|
|
|
304839
304372
|
function requireStream$1 () {
|
|
@@ -304860,7 +304393,7 @@ function requireStream$1 () {
|
|
|
304860
304393
|
*/
|
|
304861
304394
|
function getNodejsStreamFuncs() {
|
|
304862
304395
|
function getStream(ssl) {
|
|
304863
|
-
const net = require$$0$
|
|
304396
|
+
const net = require$$0$8;
|
|
304864
304397
|
return new net.Socket()
|
|
304865
304398
|
}
|
|
304866
304399
|
|
|
@@ -304879,7 +304412,7 @@ function requireStream$1 () {
|
|
|
304879
304412
|
*/
|
|
304880
304413
|
function getCloudflareStreamFuncs() {
|
|
304881
304414
|
function getStream(ssl) {
|
|
304882
|
-
const { CloudflareSocket } =
|
|
304415
|
+
const { CloudflareSocket } = requireDist$7();
|
|
304883
304416
|
return new CloudflareSocket(ssl)
|
|
304884
304417
|
}
|
|
304885
304418
|
|
|
@@ -304901,7 +304434,9 @@ function requireStream$1 () {
|
|
|
304901
304434
|
function isCloudflareRuntime() {
|
|
304902
304435
|
// Since 2022-03-21 the `global_navigator` compatibility flag is on for Cloudflare Workers
|
|
304903
304436
|
// which means that `navigator.userAgent` will be defined.
|
|
304437
|
+
// eslint-disable-next-line no-undef
|
|
304904
304438
|
if (typeof navigator === 'object' && navigator !== null && typeof navigator.userAgent === 'string') {
|
|
304439
|
+
// eslint-disable-next-line no-undef
|
|
304905
304440
|
return navigator.userAgent === 'Cloudflare-Workers'
|
|
304906
304441
|
}
|
|
304907
304442
|
// In case `navigator` or `navigator.userAgent` is not defined then try a more sneaky approach
|
|
@@ -304928,9 +304463,9 @@ function requireConnection () {
|
|
|
304928
304463
|
if (hasRequiredConnection) return connection;
|
|
304929
304464
|
hasRequiredConnection = 1;
|
|
304930
304465
|
|
|
304931
|
-
var EventEmitter = require$$0$
|
|
304466
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
304932
304467
|
|
|
304933
|
-
const { parse, serialize } = requireDist$
|
|
304468
|
+
const { parse, serialize } = requireDist$8();
|
|
304934
304469
|
const { getStream, getSecureStream } = requireStream$1();
|
|
304935
304470
|
|
|
304936
304471
|
const flushBuffer = serialize.flush();
|
|
@@ -305019,7 +304554,7 @@ function requireConnection () {
|
|
|
305019
304554
|
}
|
|
305020
304555
|
}
|
|
305021
304556
|
|
|
305022
|
-
var net = require$$0$
|
|
304557
|
+
var net = require$$0$8;
|
|
305023
304558
|
if (net.isIP && net.isIP(host) === 0) {
|
|
305024
304559
|
options.servername = host;
|
|
305025
304560
|
}
|
|
@@ -305568,7 +305103,7 @@ function requireClient$2 () {
|
|
|
305568
305103
|
if (hasRequiredClient$2) return client$2;
|
|
305569
305104
|
hasRequiredClient$2 = 1;
|
|
305570
305105
|
|
|
305571
|
-
var EventEmitter = require$$0$
|
|
305106
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
305572
305107
|
var utils = requireUtils$3();
|
|
305573
305108
|
var sasl = requireSasl();
|
|
305574
305109
|
var TypeOverrides = requireTypeOverrides();
|
|
@@ -305611,6 +305146,7 @@ function requireClient$2 () {
|
|
|
305611
305146
|
this._connectionError = false;
|
|
305612
305147
|
this._queryable = true;
|
|
305613
305148
|
|
|
305149
|
+
this.enableChannelBinding = Boolean(c.enableChannelBinding); // set true to use SCRAM-SHA-256-PLUS when offered
|
|
305614
305150
|
this.connection =
|
|
305615
305151
|
c.connection ||
|
|
305616
305152
|
new Connection({
|
|
@@ -305672,6 +305208,10 @@ function requireClient$2 () {
|
|
|
305672
305208
|
con._ending = true;
|
|
305673
305209
|
con.stream.destroy(new Error('timeout expired'));
|
|
305674
305210
|
}, this._connectionTimeoutMillis);
|
|
305211
|
+
|
|
305212
|
+
if (this.connectionTimeoutHandle.unref) {
|
|
305213
|
+
this.connectionTimeoutHandle.unref();
|
|
305214
|
+
}
|
|
305675
305215
|
}
|
|
305676
305216
|
|
|
305677
305217
|
if (this.host && this.host.indexOf('/') === 0) {
|
|
@@ -305826,7 +305366,7 @@ function requireClient$2 () {
|
|
|
305826
305366
|
_handleAuthSASL(msg) {
|
|
305827
305367
|
this._checkPgPass(() => {
|
|
305828
305368
|
try {
|
|
305829
|
-
this.saslSession = sasl.startSession(msg.mechanisms);
|
|
305369
|
+
this.saslSession = sasl.startSession(msg.mechanisms, this.enableChannelBinding && this.connection.stream);
|
|
305830
305370
|
this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response);
|
|
305831
305371
|
} catch (err) {
|
|
305832
305372
|
this.connection.emit('error', err);
|
|
@@ -305836,7 +305376,12 @@ function requireClient$2 () {
|
|
|
305836
305376
|
|
|
305837
305377
|
async _handleAuthSASLContinue(msg) {
|
|
305838
305378
|
try {
|
|
305839
|
-
await sasl.continueSession(
|
|
305379
|
+
await sasl.continueSession(
|
|
305380
|
+
this.saslSession,
|
|
305381
|
+
this.password,
|
|
305382
|
+
msg.data,
|
|
305383
|
+
this.enableChannelBinding && this.connection.stream
|
|
305384
|
+
);
|
|
305840
305385
|
this.connection.sendSCRAMClientFinalMessage(this.saslSession.response);
|
|
305841
305386
|
} catch (err) {
|
|
305842
305387
|
this.connection.emit('error', err);
|
|
@@ -306213,7 +305758,7 @@ var hasRequiredPgPool;
|
|
|
306213
305758
|
function requirePgPool () {
|
|
306214
305759
|
if (hasRequiredPgPool) return pgPool;
|
|
306215
305760
|
hasRequiredPgPool = 1;
|
|
306216
|
-
const EventEmitter = require$$0$
|
|
305761
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
306217
305762
|
|
|
306218
305763
|
const NOOP = function () {};
|
|
306219
305764
|
|
|
@@ -306419,6 +305964,10 @@ function requirePgPool () {
|
|
|
306419
305964
|
response.callback(new Error('timeout exceeded when trying to connect'));
|
|
306420
305965
|
}, this.options.connectionTimeoutMillis);
|
|
306421
305966
|
|
|
305967
|
+
if (tid.unref) {
|
|
305968
|
+
tid.unref();
|
|
305969
|
+
}
|
|
305970
|
+
|
|
306422
305971
|
this._pendingQueue.push(pendingItem);
|
|
306423
305972
|
return result
|
|
306424
305973
|
}
|
|
@@ -306686,7 +306235,7 @@ function requireQuery () {
|
|
|
306686
306235
|
if (hasRequiredQuery) return query.exports;
|
|
306687
306236
|
hasRequiredQuery = 1;
|
|
306688
306237
|
|
|
306689
|
-
var EventEmitter = require$$0$
|
|
306238
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
306690
306239
|
var util = require$$0$6;
|
|
306691
306240
|
var utils = requireUtils$3();
|
|
306692
306241
|
|
|
@@ -306861,6 +306410,7 @@ function requireClient$1 () {
|
|
|
306861
306410
|
|
|
306862
306411
|
// eslint-disable-next-line
|
|
306863
306412
|
var Native;
|
|
306413
|
+
// eslint-disable-next-line no-useless-catch
|
|
306864
306414
|
try {
|
|
306865
306415
|
// 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
306416
|
Native = require('pg-native');
|
|
@@ -306868,7 +306418,7 @@ function requireClient$1 () {
|
|
|
306868
306418
|
throw e
|
|
306869
306419
|
}
|
|
306870
306420
|
var TypeOverrides = requireTypeOverrides();
|
|
306871
|
-
var EventEmitter = require$$0$
|
|
306421
|
+
var EventEmitter = require$$0$7.EventEmitter;
|
|
306872
306422
|
var util = require$$0$6;
|
|
306873
306423
|
var ConnectionParameters = requireConnectionParameters();
|
|
306874
306424
|
|
|
@@ -307183,8 +306733,10 @@ function requireLib$1 () {
|
|
|
307183
306733
|
var Client = requireClient$2();
|
|
307184
306734
|
var defaults = requireDefaults();
|
|
307185
306735
|
var Connection = requireConnection();
|
|
306736
|
+
var Result = requireResult();
|
|
306737
|
+
var utils = requireUtils$3();
|
|
307186
306738
|
var Pool = requirePgPool();
|
|
307187
|
-
const { DatabaseError } = requireDist$
|
|
306739
|
+
const { DatabaseError } = requireDist$8();
|
|
307188
306740
|
const { escapeIdentifier, escapeLiteral } = requireUtils$3();
|
|
307189
306741
|
|
|
307190
306742
|
const poolFactory = (Client) => {
|
|
@@ -307206,6 +306758,8 @@ function requireLib$1 () {
|
|
|
307206
306758
|
this.DatabaseError = DatabaseError;
|
|
307207
306759
|
this.escapeIdentifier = escapeIdentifier;
|
|
307208
306760
|
this.escapeLiteral = escapeLiteral;
|
|
306761
|
+
this.Result = Result;
|
|
306762
|
+
this.utils = utils;
|
|
307209
306763
|
};
|
|
307210
306764
|
|
|
307211
306765
|
if (typeof process.env.NODE_PG_FORCE_NATIVE !== 'undefined') {
|
|
@@ -307238,7 +306792,21 @@ function requireLib$1 () {
|
|
|
307238
306792
|
}
|
|
307239
306793
|
} (lib$2));
|
|
307240
306794
|
return lib$2.exports;
|
|
307241
|
-
}var libExports = requireLib$1()
|
|
306795
|
+
}var libExports = requireLib$1();
|
|
306796
|
+
var pg = /*@__PURE__*/getDefaultExportFromCjs(libExports);// ESM wrapper for pg
|
|
306797
|
+
|
|
306798
|
+
// Re-export all the properties
|
|
306799
|
+
pg.Client;
|
|
306800
|
+
const Pool = pg.Pool;
|
|
306801
|
+
pg.Connection;
|
|
306802
|
+
pg.types;
|
|
306803
|
+
pg.Query;
|
|
306804
|
+
pg.DatabaseError;
|
|
306805
|
+
pg.escapeIdentifier;
|
|
306806
|
+
pg.escapeLiteral;
|
|
306807
|
+
|
|
306808
|
+
// Also export the defaults
|
|
306809
|
+
pg.defaults;/**
|
|
307242
306810
|
* 2011 Peter 'Pita' Martischka
|
|
307243
306811
|
*
|
|
307244
306812
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -307268,7 +306836,7 @@ class Postgres_db extends AbstractDatabase {
|
|
|
307268
306836
|
this.settings.max = this.settings.max || 20;
|
|
307269
306837
|
this.settings.min = this.settings.min || 4;
|
|
307270
306838
|
this.settings.idleTimeoutMillis = this.settings.idleTimeoutMillis || 1000;
|
|
307271
|
-
this.db = new
|
|
306839
|
+
this.db = new Pool(this.settings);
|
|
307272
306840
|
}
|
|
307273
306841
|
init(callback) {
|
|
307274
306842
|
const testTableExists = "SELECT 1 as exists FROM pg_tables WHERE tablename = 'store'";
|
|
@@ -315472,8 +315040,8 @@ function requireSocket () {
|
|
|
315472
315040
|
};
|
|
315473
315041
|
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
315042
|
Object.defineProperty(socket, "__esModule", { value: true });
|
|
315475
|
-
const events_1 = require$$0$
|
|
315476
|
-
const net = require$$0$
|
|
315043
|
+
const events_1 = require$$0$7;
|
|
315044
|
+
const net = require$$0$8;
|
|
315477
315045
|
const tls = require$$1$1;
|
|
315478
315046
|
const errors_1 = requireErrors$3();
|
|
315479
315047
|
const utils_1 = requireUtils$1();
|
|
@@ -318311,7 +317879,7 @@ function requirePool () {
|
|
|
318311
317879
|
if (hasRequiredPool) return Pool_1;
|
|
318312
317880
|
hasRequiredPool = 1;
|
|
318313
317881
|
|
|
318314
|
-
const EventEmitter = require$$0$
|
|
317882
|
+
const EventEmitter = require$$0$7.EventEmitter;
|
|
318315
317883
|
|
|
318316
317884
|
const factoryValidator = requireFactoryValidator();
|
|
318317
317885
|
const PoolOptions = requirePoolOptions();
|
|
@@ -319074,72 +318642,9 @@ function requireGenericPool () {
|
|
|
319074
318642
|
}
|
|
319075
318643
|
};
|
|
319076
318644
|
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
|
-
];
|
|
318645
|
+
}var version = "1.5.17";
|
|
319127
318646
|
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;
|
|
318647
|
+
version: version};var hasRequiredClient;
|
|
319143
318648
|
|
|
319144
318649
|
function requireClient () {
|
|
319145
318650
|
if (hasRequiredClient) return client;
|
|
@@ -319161,7 +318666,7 @@ function requireClient () {
|
|
|
319161
318666
|
const socket_1 = requireSocket();
|
|
319162
318667
|
const commands_queue_1 = requireCommandsQueue();
|
|
319163
318668
|
const multi_command_1 = requireMultiCommand$1();
|
|
319164
|
-
const events_1 = require$$0$
|
|
318669
|
+
const events_1 = require$$0$7;
|
|
319165
318670
|
const command_options_1 = requireCommandOptions();
|
|
319166
318671
|
const commander_1 = requireCommander();
|
|
319167
318672
|
const generic_pool_1 = requireGenericPool();
|
|
@@ -320424,7 +319929,7 @@ function requireCluster () {
|
|
|
320424
319929
|
const commands_1 = requireCommands$6();
|
|
320425
319930
|
const cluster_slots_1 = requireClusterSlots();
|
|
320426
319931
|
const commander_1 = requireCommander();
|
|
320427
|
-
const events_1 = require$$0$
|
|
319932
|
+
const events_1 = require$$0$7;
|
|
320428
319933
|
const multi_command_1 = requireMultiCommand();
|
|
320429
319934
|
const errors_1 = requireErrors$3();
|
|
320430
319935
|
class RedisCluster extends events_1.EventEmitter {
|
|
@@ -327712,7 +327217,7 @@ function requireDebuggability () {
|
|
|
327712
327217
|
};
|
|
327713
327218
|
|
|
327714
327219
|
Promise.prototype._unsetUnhandledRejectionIsNotified = function () {
|
|
327715
|
-
this._bitField = this._bitField & (
|
|
327220
|
+
this._bitField = this._bitField & (-524289);
|
|
327716
327221
|
};
|
|
327717
327222
|
|
|
327718
327223
|
Promise.prototype._isUnhandledRejectionNotified = function () {
|
|
@@ -327724,7 +327229,7 @@ function requireDebuggability () {
|
|
|
327724
327229
|
};
|
|
327725
327230
|
|
|
327726
327231
|
Promise.prototype._unsetRejectionIsUnhandled = function () {
|
|
327727
|
-
this._bitField = this._bitField & (
|
|
327232
|
+
this._bitField = this._bitField & (-2097153);
|
|
327728
327233
|
if (this._isUnhandledRejectionNotified()) {
|
|
327729
327234
|
this._unsetUnhandledRejectionIsNotified();
|
|
327730
327235
|
this._notifyUnhandledRejectionIsHandled();
|
|
@@ -328257,7 +327762,7 @@ function requireBind () {
|
|
|
328257
327762
|
this._bitField = this._bitField | 131072;
|
|
328258
327763
|
this._boundTo = obj;
|
|
328259
327764
|
} else {
|
|
328260
|
-
this._bitField = this._bitField & (
|
|
327765
|
+
this._bitField = this._bitField & (-131073);
|
|
328261
327766
|
}
|
|
328262
327767
|
};
|
|
328263
327768
|
|
|
@@ -329066,7 +328571,7 @@ function requireUsing () {
|
|
|
329066
328571
|
};
|
|
329067
328572
|
|
|
329068
328573
|
Promise.prototype._unsetDisposable = function () {
|
|
329069
|
-
this._bitField = this._bitField & (
|
|
328574
|
+
this._bitField = this._bitField & (-262145);
|
|
329070
328575
|
this._disposer = undefined;
|
|
329071
328576
|
};
|
|
329072
328577
|
|
|
@@ -330630,7 +330135,7 @@ function requirePromise () {
|
|
|
330630
330135
|
};
|
|
330631
330136
|
|
|
330632
330137
|
Promise.prototype._unsetCancellable = function () {
|
|
330633
|
-
this._bitField = this._bitField & (
|
|
330138
|
+
this._bitField = this._bitField & (-67108865);
|
|
330634
330139
|
};
|
|
330635
330140
|
|
|
330636
330141
|
Promise.prototype._setIsMigrated = function () {
|
|
@@ -330638,7 +330143,7 @@ function requirePromise () {
|
|
|
330638
330143
|
};
|
|
330639
330144
|
|
|
330640
330145
|
Promise.prototype._unsetIsMigrated = function () {
|
|
330641
|
-
this._bitField = this._bitField & (
|
|
330146
|
+
this._bitField = this._bitField & (-4194305);
|
|
330642
330147
|
};
|
|
330643
330148
|
|
|
330644
330149
|
Promise.prototype._isMigrated = function () {
|
|
@@ -330969,7 +330474,7 @@ function requirePromise () {
|
|
|
330969
330474
|
};
|
|
330970
330475
|
|
|
330971
330476
|
Promise.prototype._unsetSettlePromisesQueued = function () {
|
|
330972
|
-
this._bitField = this._bitField & (
|
|
330477
|
+
this._bitField = this._bitField & (1073741823);
|
|
330973
330478
|
};
|
|
330974
330479
|
|
|
330975
330480
|
Promise.prototype._queueSettlePromises = function() {
|
|
@@ -331132,7 +330637,7 @@ function requireCursor () {
|
|
|
331132
330637
|
|
|
331133
330638
|
Promise = requireBluebird();
|
|
331134
330639
|
|
|
331135
|
-
EventEmitter = require$$0$
|
|
330640
|
+
EventEmitter = require$$0$7.EventEmitter;
|
|
331136
330641
|
|
|
331137
330642
|
ar = util.ar;
|
|
331138
330643
|
|
|
@@ -337105,11 +336610,11 @@ function requireNet () {
|
|
|
337105
336610
|
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
336611
|
hasProp = {}.hasOwnProperty;
|
|
337107
336612
|
|
|
337108
|
-
net = require$$0$
|
|
336613
|
+
net = require$$0$8;
|
|
337109
336614
|
|
|
337110
336615
|
tls = require$$1$1;
|
|
337111
336616
|
|
|
337112
|
-
events = require$$0$
|
|
336617
|
+
events = require$$0$7;
|
|
337113
336618
|
|
|
337114
336619
|
util = requireUtil$1();
|
|
337115
336620
|
|
|
@@ -340792,6 +340297,8 @@ var hasRequiredSender;
|
|
|
340792
340297
|
function requireSender () {
|
|
340793
340298
|
if (hasRequiredSender) return sender$1;
|
|
340794
340299
|
hasRequiredSender = 1;
|
|
340300
|
+
|
|
340301
|
+
const { Duplex } = require$$0$b;
|
|
340795
340302
|
const { randomFillSync } = require$$0$a;
|
|
340796
340303
|
|
|
340797
340304
|
const PerMessageDeflate = requirePermessageDeflate();
|
|
@@ -341802,12 +341309,13 @@ function requireWebsocket () {
|
|
|
341802
341309
|
if (hasRequiredWebsocket) return websocket;
|
|
341803
341310
|
hasRequiredWebsocket = 1;
|
|
341804
341311
|
|
|
341805
|
-
const EventEmitter = require$$0$
|
|
341806
|
-
const https = require$$2$
|
|
341312
|
+
const EventEmitter = require$$0$7;
|
|
341313
|
+
const https = require$$2$2;
|
|
341807
341314
|
const http$1 = http;
|
|
341808
|
-
const net = require$$0$
|
|
341315
|
+
const net = require$$0$8;
|
|
341809
341316
|
const tls = require$$1$1;
|
|
341810
341317
|
const { randomBytes, createHash } = require$$0$a;
|
|
341318
|
+
const { Duplex, Readable } = require$$0$b;
|
|
341811
341319
|
const { URL } = require$$0$f;
|
|
341812
341320
|
|
|
341813
341321
|
const PerMessageDeflate = requirePermessageDeflate();
|
|
@@ -343214,8 +342722,9 @@ function requireWebsocketServer () {
|
|
|
343214
342722
|
if (hasRequiredWebsocketServer) return websocketServer$1;
|
|
343215
342723
|
hasRequiredWebsocketServer = 1;
|
|
343216
342724
|
|
|
343217
|
-
const EventEmitter = require$$0$
|
|
342725
|
+
const EventEmitter = require$$0$7;
|
|
343218
342726
|
const http$1 = http;
|
|
342727
|
+
const { Duplex } = require$$0$b;
|
|
343219
342728
|
const { createHash } = require$$0$a;
|
|
343220
342729
|
|
|
343221
342730
|
const extension = requireExtension();
|
|
@@ -343770,7 +343279,7 @@ var websocketServer = /*@__PURE__*/getDefaultExportFromCjs(websocketServerExport
|
|
|
343770
343279
|
return WebSocket$2;
|
|
343771
343280
|
return WebSocket_;
|
|
343772
343281
|
}
|
|
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}/**
|
|
343282
|
+
})();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
343283
|
* 2023 Samuel Schwanzer
|
|
343775
343284
|
*
|
|
343776
343285
|
* Licensed under the Apache License, Version 2.0 (the "License");
|