@databricks/sql 1.5.0 → 1.6.0
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/DBSQLClient.d.ts +15 -8
- package/dist/DBSQLClient.js +74 -81
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLOperation/FetchResultsHelper.d.ts +3 -3
- package/dist/DBSQLOperation/FetchResultsHelper.js +4 -3
- package/dist/DBSQLOperation/FetchResultsHelper.js.map +1 -1
- package/dist/DBSQLOperation/index.d.ts +10 -7
- package/dist/DBSQLOperation/index.js +110 -41
- package/dist/DBSQLOperation/index.js.map +1 -1
- package/dist/DBSQLParameter.d.ts +6 -2
- package/dist/DBSQLParameter.js +15 -1
- package/dist/DBSQLParameter.js.map +1 -1
- package/dist/DBSQLSession.d.ts +5 -6
- package/dist/DBSQLSession.js +66 -36
- package/dist/DBSQLSession.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.d.ts +3 -3
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js +3 -4
- package/dist/connection/auth/DatabricksOAuth/AuthorizationCode.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.d.ts +6 -3
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js +27 -8
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/index.d.ts +4 -6
- package/dist/connection/auth/DatabricksOAuth/index.js +1 -1
- package/dist/connection/auth/DatabricksOAuth/index.js.map +1 -1
- package/dist/connection/auth/PlainHttpAuthentication.d.ts +6 -3
- package/dist/connection/auth/PlainHttpAuthentication.js +1 -0
- package/dist/connection/auth/PlainHttpAuthentication.js.map +1 -1
- package/dist/connection/connections/HttpConnection.d.ts +16 -9
- package/dist/connection/connections/HttpConnection.js +60 -51
- package/dist/connection/connections/HttpConnection.js.map +1 -1
- package/dist/connection/connections/ThriftHttpConnection.d.ts +38 -0
- package/dist/connection/connections/ThriftHttpConnection.js +134 -0
- package/dist/connection/connections/ThriftHttpConnection.js.map +1 -0
- package/dist/connection/contracts/IAuthentication.d.ts +2 -2
- package/dist/connection/contracts/IConnectionOptions.d.ts +17 -19
- package/dist/connection/contracts/IConnectionProvider.d.ts +6 -3
- package/dist/contracts/IClientContext.d.ts +10 -0
- package/dist/{connection/contracts/IThriftConnection.js → contracts/IClientContext.js} +1 -1
- package/dist/contracts/IClientContext.js.map +1 -0
- package/dist/contracts/IDBSQLClient.d.ts +2 -0
- package/dist/contracts/IDBSQLSession.d.ts +1 -0
- package/dist/contracts/IDriver.d.ts +24 -0
- package/dist/contracts/IDriver.js +3 -0
- package/dist/contracts/IDriver.js.map +1 -0
- package/dist/errors/ParameterError.d.ts +2 -0
- package/dist/errors/ParameterError.js +6 -0
- package/dist/errors/ParameterError.js.map +1 -0
- package/dist/hive/HiveDriver.d.ts +8 -5
- package/dist/hive/HiveDriver.js +23 -23
- package/dist/hive/HiveDriver.js.map +1 -1
- package/dist/result/ArrowResult.d.ts +3 -1
- package/dist/result/ArrowResult.js +4 -2
- package/dist/result/ArrowResult.js.map +1 -1
- package/dist/result/CloudFetchResult.d.ts +2 -1
- package/dist/result/CloudFetchResult.js +5 -3
- package/dist/result/CloudFetchResult.js.map +1 -1
- package/dist/result/JsonResult.d.ts +3 -1
- package/dist/result/JsonResult.js +2 -1
- package/dist/result/JsonResult.js.map +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -4
- package/dist/DBSQLOperation/OperationStatusHelper.d.ts +0 -16
- package/dist/DBSQLOperation/OperationStatusHelper.js +0 -138
- package/dist/DBSQLOperation/OperationStatusHelper.js.map +0 -1
- package/dist/connection/contracts/IThriftConnection.d.ts +0 -4
- package/dist/connection/contracts/IThriftConnection.js.map +0 -1
- package/dist/node_modules/thrift/LICENSE +0 -306
- package/dist/node_modules/thrift/README.md +0 -210
- package/dist/node_modules/thrift/lib/nodejs/README.md +0 -142
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/binary.js +0 -168
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/binary_protocol.js +0 -367
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/browser.js +0 -49
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/buffered_transport.js +0 -186
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/compact_protocol.js +0 -915
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/connection.js +0 -396
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/create_client.js +0 -54
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/framed_transport.js +0 -185
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/header_protocol.js +0 -258
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/header_transport.js +0 -341
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js +0 -292
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/index.js +0 -76
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/input_buffer_underrun_error.js +0 -32
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/int64_util.js +0 -91
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/json_parse.js +0 -299
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/json_protocol.js +0 -799
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/log.js +0 -87
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_processor.js +0 -63
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_protocol.js +0 -73
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/protocol.js +0 -22
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/server.js +0 -123
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/thrift.js +0 -241
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/transport.js +0 -22
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/web_server.js +0 -567
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/ws_connection.js +0 -286
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/ws_transport.js +0 -206
- package/dist/node_modules/thrift/lib/nodejs/lib/thrift/xhr_connection.js +0 -280
- package/dist/node_modules/thrift/package.json +0 -72
- package/dist/utils/areHeadersEqual.d.ts +0 -2
- package/dist/utils/areHeadersEqual.js +0 -49
- package/dist/utils/areHeadersEqual.js.map +0 -1
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
* or more contributor license agreements. See the NOTICE file
|
|
4
|
-
* distributed with this work for additional information
|
|
5
|
-
* regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
* to you under the Apache License, Version 2.0 (the
|
|
7
|
-
* "License"); you may not use this file except in compliance
|
|
8
|
-
* with the License. You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing,
|
|
13
|
-
* software distributed under the License is distributed on an
|
|
14
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
* KIND, either express or implied. See the License for the
|
|
16
|
-
* specific language governing permissions and limitations
|
|
17
|
-
* under the License.
|
|
18
|
-
*/
|
|
19
|
-
var util = require('util');
|
|
20
|
-
var EventEmitter = require("events").EventEmitter;
|
|
21
|
-
var thrift = require('./thrift');
|
|
22
|
-
|
|
23
|
-
var TBufferedTransport = require('./buffered_transport');
|
|
24
|
-
var TJSONProtocol = require('./json_protocol');
|
|
25
|
-
var InputBufferUnderrunError = require('./input_buffer_underrun_error');
|
|
26
|
-
|
|
27
|
-
var createClient = require('./create_client');
|
|
28
|
-
|
|
29
|
-
exports.XHRConnection = XHRConnection;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Constructor Function for the XHR Connection.
|
|
33
|
-
* If you do not specify a host and port then XHRConnection will default to the
|
|
34
|
-
* host and port of the page from which this javascript is served.
|
|
35
|
-
* @constructor
|
|
36
|
-
* @param {string} [url] - The URL to connect to.
|
|
37
|
-
* @classdesc TXHRConnection objects provide Thrift end point transport
|
|
38
|
-
* semantics implemented using XHR.
|
|
39
|
-
* @example
|
|
40
|
-
* var transport = new Thrift.TXHRConnection('localhost', 9099, {});
|
|
41
|
-
*/
|
|
42
|
-
function XHRConnection(host, port, options) {
|
|
43
|
-
this.options = options || {};
|
|
44
|
-
this.wpos = 0;
|
|
45
|
-
this.rpos = 0;
|
|
46
|
-
this.useCORS = (options && options.useCORS);
|
|
47
|
-
this.send_buf = '';
|
|
48
|
-
this.recv_buf = '';
|
|
49
|
-
this.transport = options.transport || TBufferedTransport;
|
|
50
|
-
this.protocol = options.protocol || TJSONProtocol;
|
|
51
|
-
this.headers = options.headers || {};
|
|
52
|
-
|
|
53
|
-
host = host || window.location.host;
|
|
54
|
-
port = port || window.location.port;
|
|
55
|
-
var prefix = options.https ? 'https://' : 'http://';
|
|
56
|
-
var path = options.path || '/';
|
|
57
|
-
|
|
58
|
-
if (port === '') {
|
|
59
|
-
port = undefined;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (!port || port === 80 || port === '80') {
|
|
63
|
-
this.url = prefix + host + path;
|
|
64
|
-
} else {
|
|
65
|
-
this.url = prefix + host + ':' + port + path;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
//The sequence map is used to map seqIDs back to the
|
|
69
|
-
// calling client in multiplexed scenarios
|
|
70
|
-
this.seqId2Service = {};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
util.inherits(XHRConnection, EventEmitter);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Gets the browser specific XmlHttpRequest Object.
|
|
77
|
-
* @returns {object} the browser XHR interface object
|
|
78
|
-
*/
|
|
79
|
-
XHRConnection.prototype.getXmlHttpRequestObject = function() {
|
|
80
|
-
try { return new XMLHttpRequest(); } catch (e1) { }
|
|
81
|
-
try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e2) { }
|
|
82
|
-
try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e3) { }
|
|
83
|
-
|
|
84
|
-
throw "Your browser doesn't support XHR.";
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Sends the current XRH request if the transport was created with a URL
|
|
89
|
-
* and the async parameter is false. If the transport was not created with
|
|
90
|
-
* a URL, or the async parameter is True and no callback is provided, or
|
|
91
|
-
* the URL is an empty string, the current send buffer is returned.
|
|
92
|
-
* @param {object} async - If true the current send buffer is returned.
|
|
93
|
-
* @param {object} callback - Optional async completion callback
|
|
94
|
-
* @returns {undefined|string} Nothing or the current send buffer.
|
|
95
|
-
* @throws {string} If XHR fails.
|
|
96
|
-
*/
|
|
97
|
-
XHRConnection.prototype.flush = function() {
|
|
98
|
-
var self = this;
|
|
99
|
-
if (this.url === undefined || this.url === '') {
|
|
100
|
-
return this.send_buf;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
var xreq = this.getXmlHttpRequestObject();
|
|
104
|
-
|
|
105
|
-
if (xreq.overrideMimeType) {
|
|
106
|
-
xreq.overrideMimeType('application/json');
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
xreq.onreadystatechange = function() {
|
|
110
|
-
if (this.readyState == 4 && this.status == 200) {
|
|
111
|
-
self.setRecvBuffer(this.responseText);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
xreq.open('POST', this.url, true);
|
|
116
|
-
|
|
117
|
-
Object.keys(this.headers).forEach(function(headerKey) {
|
|
118
|
-
xreq.setRequestHeader(headerKey, self.headers[headerKey]);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
xreq.send(this.send_buf);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Sets the buffer to provide the protocol when deserializing.
|
|
126
|
-
* @param {string} buf - The buffer to supply the protocol.
|
|
127
|
-
*/
|
|
128
|
-
XHRConnection.prototype.setRecvBuffer = function(buf) {
|
|
129
|
-
this.recv_buf = buf;
|
|
130
|
-
this.recv_buf_sz = this.recv_buf.length;
|
|
131
|
-
this.wpos = this.recv_buf.length;
|
|
132
|
-
this.rpos = 0;
|
|
133
|
-
|
|
134
|
-
if (Object.prototype.toString.call(buf) == "[object ArrayBuffer]") {
|
|
135
|
-
var data = new Uint8Array(buf);
|
|
136
|
-
}
|
|
137
|
-
var thing = new Buffer(data || buf);
|
|
138
|
-
|
|
139
|
-
this.transport.receiver(this.__decodeCallback.bind(this))(thing);
|
|
140
|
-
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
XHRConnection.prototype.__decodeCallback = function(transport_with_data) {
|
|
144
|
-
var proto = new this.protocol(transport_with_data);
|
|
145
|
-
try {
|
|
146
|
-
while (true) {
|
|
147
|
-
var header = proto.readMessageBegin();
|
|
148
|
-
var dummy_seqid = header.rseqid * -1;
|
|
149
|
-
var client = this.client;
|
|
150
|
-
//The Multiplexed Protocol stores a hash of seqid to service names
|
|
151
|
-
// in seqId2Service. If the SeqId is found in the hash we need to
|
|
152
|
-
// lookup the appropriate client for this call.
|
|
153
|
-
// The client var is a single client object when not multiplexing,
|
|
154
|
-
// when using multiplexing it is a service name keyed hash of client
|
|
155
|
-
// objects.
|
|
156
|
-
//NOTE: The 2 way interdependencies between protocols, transports,
|
|
157
|
-
// connections and clients in the Node.js implementation are irregular
|
|
158
|
-
// and make the implementation difficult to extend and maintain. We
|
|
159
|
-
// should bring this stuff inline with typical thrift I/O stack
|
|
160
|
-
// operation soon.
|
|
161
|
-
// --ra
|
|
162
|
-
var service_name = this.seqId2Service[header.rseqid];
|
|
163
|
-
if (service_name) {
|
|
164
|
-
client = this.client[service_name];
|
|
165
|
-
delete this.seqId2Service[header.rseqid];
|
|
166
|
-
}
|
|
167
|
-
/*jshint -W083 */
|
|
168
|
-
client._reqs[dummy_seqid] = function(err, success) {
|
|
169
|
-
transport_with_data.commitPosition();
|
|
170
|
-
var clientCallback = client._reqs[header.rseqid];
|
|
171
|
-
delete client._reqs[header.rseqid];
|
|
172
|
-
if (clientCallback) {
|
|
173
|
-
clientCallback(err, success);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
/*jshint +W083 */
|
|
177
|
-
if (client['recv_' + header.fname]) {
|
|
178
|
-
client['recv_' + header.fname](proto, header.mtype, dummy_seqid);
|
|
179
|
-
} else {
|
|
180
|
-
delete client._reqs[dummy_seqid];
|
|
181
|
-
this.emit("error",
|
|
182
|
-
new thrift.TApplicationException(
|
|
183
|
-
thrift.TApplicationExceptionType.WRONG_METHOD_NAME,
|
|
184
|
-
"Received a response to an unknown RPC function"));
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
} catch (e) {
|
|
188
|
-
if (e instanceof InputBufferUnderrunError) {
|
|
189
|
-
transport_with_data.rollbackPosition();
|
|
190
|
-
} else {
|
|
191
|
-
throw e;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Returns true if the transport is open, XHR always returns true.
|
|
198
|
-
* @readonly
|
|
199
|
-
* @returns {boolean} Always True.
|
|
200
|
-
*/
|
|
201
|
-
XHRConnection.prototype.isOpen = function() {
|
|
202
|
-
return true;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Opens the transport connection, with XHR this is a nop.
|
|
207
|
-
*/
|
|
208
|
-
XHRConnection.prototype.open = function() {};
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Closes the transport connection, with XHR this is a nop.
|
|
212
|
-
*/
|
|
213
|
-
XHRConnection.prototype.close = function() {};
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Returns the specified number of characters from the response
|
|
217
|
-
* buffer.
|
|
218
|
-
* @param {number} len - The number of characters to return.
|
|
219
|
-
* @returns {string} Characters sent by the server.
|
|
220
|
-
*/
|
|
221
|
-
XHRConnection.prototype.read = function(len) {
|
|
222
|
-
var avail = this.wpos - this.rpos;
|
|
223
|
-
|
|
224
|
-
if (avail === 0) {
|
|
225
|
-
return '';
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
var give = len;
|
|
229
|
-
|
|
230
|
-
if (avail < len) {
|
|
231
|
-
give = avail;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
var ret = this.read_buf.substr(this.rpos, give);
|
|
235
|
-
this.rpos += give;
|
|
236
|
-
|
|
237
|
-
//clear buf when complete?
|
|
238
|
-
return ret;
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Returns the entire response buffer.
|
|
243
|
-
* @returns {string} Characters sent by the server.
|
|
244
|
-
*/
|
|
245
|
-
XHRConnection.prototype.readAll = function() {
|
|
246
|
-
return this.recv_buf;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Sets the send buffer to buf.
|
|
251
|
-
* @param {string} buf - The buffer to send.
|
|
252
|
-
*/
|
|
253
|
-
XHRConnection.prototype.write = function(buf) {
|
|
254
|
-
this.send_buf = buf;
|
|
255
|
-
this.flush();
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Returns the send buffer.
|
|
260
|
-
* @readonly
|
|
261
|
-
* @returns {string} The send buffer.
|
|
262
|
-
*/
|
|
263
|
-
XHRConnection.prototype.getSendBuffer = function() {
|
|
264
|
-
return this.send_buf;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Creates a new TXHRTransport object, used by Thrift clients to connect
|
|
269
|
-
* to Thrift HTTP based servers.
|
|
270
|
-
* @param {string} host - The host name or IP to connect to.
|
|
271
|
-
* @param {number} port - The TCP port to connect to.
|
|
272
|
-
* @param {XHRConnectOptions} options - The configuration options to use.
|
|
273
|
-
* @returns {XHRConnection} The connection object.
|
|
274
|
-
* @see {@link XHRConnectOptions}
|
|
275
|
-
*/
|
|
276
|
-
exports.createXHRConnection = function(host, port, options) {
|
|
277
|
-
return new XHRConnection(host, port, options);
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
exports.createXHRClient = createClient;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "thrift",
|
|
3
|
-
"description": "node.js bindings for the Apache Thrift RPC system",
|
|
4
|
-
"homepage": "http://thrift.apache.org/",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/apache/thrift.git"
|
|
8
|
-
},
|
|
9
|
-
"version": "0.16.0",
|
|
10
|
-
"author": {
|
|
11
|
-
"name": "Apache Thrift Developers",
|
|
12
|
-
"email": "dev@thrift.apache.org",
|
|
13
|
-
"url": "http://thrift.apache.org"
|
|
14
|
-
},
|
|
15
|
-
"license": "Apache-2.0",
|
|
16
|
-
"licenses": [
|
|
17
|
-
{
|
|
18
|
-
"type": "Apache-2.0",
|
|
19
|
-
"url": "http://www.apache.org/licenses/LICENSE-2.0"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"bugs": {
|
|
23
|
-
"mail": "dev@thrift.apache.org",
|
|
24
|
-
"url": "https://issues.apache.org/jira/browse/THRIFT"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"lib/nodejs/lib/thrift",
|
|
28
|
-
"lib/nodejs/README.md"
|
|
29
|
-
],
|
|
30
|
-
"directories": {
|
|
31
|
-
"lib": "./lib/nodejs/lib/thrift"
|
|
32
|
-
},
|
|
33
|
-
"browser": "./lib/nodejs/lib/thrift/browser.js",
|
|
34
|
-
"main": "./lib/nodejs/lib/thrift",
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">= 10.18.0"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"browser-or-node": "^1.2.1",
|
|
40
|
-
"isomorphic-ws": "^4.0.1",
|
|
41
|
-
"node-int64": "^0.4.0",
|
|
42
|
-
"q": "^1.5.0",
|
|
43
|
-
"ws": "^5.2.3"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@types/node": "^10.12.6",
|
|
47
|
-
"@types/node-int64": "^0.4.29",
|
|
48
|
-
"@types/q": "^1.5.1",
|
|
49
|
-
"buffer-equals": "^1.0.4",
|
|
50
|
-
"commander": "^2.14.1",
|
|
51
|
-
"connect": "^3.6.6",
|
|
52
|
-
"eslint": "^5.7.0",
|
|
53
|
-
"eslint-config-prettier": "^3.1.0",
|
|
54
|
-
"eslint-plugin-prettier": "^3.0.0",
|
|
55
|
-
"html-validator-cli": "^4.1.4",
|
|
56
|
-
"jsdoc": "^3.6.7",
|
|
57
|
-
"json-int64": "^1.0.2",
|
|
58
|
-
"nyc": "^15.0.0",
|
|
59
|
-
"prettier": "^1.14.3",
|
|
60
|
-
"tape": "^4.9.0",
|
|
61
|
-
"typescript": "^3.1.6",
|
|
62
|
-
"utf-8-validate": "^5.0.0"
|
|
63
|
-
},
|
|
64
|
-
"scripts": {
|
|
65
|
-
"cover": "lib/nodejs/test/testAll.sh COVER",
|
|
66
|
-
"test": "lib/nodejs/test/testAll.sh",
|
|
67
|
-
"test-ts": "lib/nodets/test/testAll.sh",
|
|
68
|
-
"prettier": "prettier --write '**/*.js'",
|
|
69
|
-
"lint": "eslint lib/nodejs/. --ext .js",
|
|
70
|
-
"lint-tests": "eslint lib/nodejs/test/. --ext .js"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function areArraysEqual(a, b) {
|
|
4
|
-
// If they're the same object - they're equal
|
|
5
|
-
if (a === b) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
// If they have a different size - they're definitely not equal
|
|
9
|
-
if (a.length !== b.length) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
// Here we have arrays of same size. Compare elements - if any pair is different
|
|
13
|
-
// then arrays are different
|
|
14
|
-
for (let i = 0; i < a.length; i += 1) {
|
|
15
|
-
if (a[i] !== b[i]) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// If all corresponding elements in both arrays are equal - arrays are equal too
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
function areHeadersEqual(a, b) {
|
|
23
|
-
// If they're the same object - they're equal
|
|
24
|
-
if (a === b) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
// If both objects have different keys - they're not equal
|
|
28
|
-
const keysOfA = Object.keys(a);
|
|
29
|
-
const keysOfB = Object.keys(b);
|
|
30
|
-
if (!areArraysEqual(keysOfA, keysOfB)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
// Compare corresponding properties of both objects. If any pair is different - objects are different
|
|
34
|
-
for (const key of keysOfA) {
|
|
35
|
-
const propA = a[key];
|
|
36
|
-
const propB = b[key];
|
|
37
|
-
if (Array.isArray(propA) && Array.isArray(propB)) {
|
|
38
|
-
if (!areArraysEqual(propA, propB)) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else if (propA !== propB) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
exports.default = areHeadersEqual;
|
|
49
|
-
//# sourceMappingURL=areHeadersEqual.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"areHeadersEqual.js","sourceRoot":"","sources":["../../lib/utils/areHeadersEqual.ts"],"names":[],"mappings":";;AAEA,SAAS,cAAc,CAAI,CAAW,EAAE,CAAW;IACjD,6CAA6C;IAC7C,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,+DAA+D;IAC/D,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,gFAAgF;IAChF,4BAA4B;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACpC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;KACF;IAED,gFAAgF;IAChF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAwB,eAAe,CAAC,CAAc,EAAE,CAAc;IACpE,6CAA6C;IAC7C,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IAED,0DAA0D;IAC1D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;QACrC,OAAO,KAAK,CAAC;KACd;IAED,qGAAqG;IACrG,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;QACzB,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACrB,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAErB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAChD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBACjC,OAAO,KAAK,CAAC;aACd;SACF;aAAM,IAAI,KAAK,KAAK,KAAK,EAAE;YAC1B,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AA5BD,kCA4BC"}
|