@databricks/sql 1.0.0 → 1.1.1
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/CHANGELOG.md +16 -1
- package/dist/DBSQLClient.d.ts +1 -1
- package/dist/DBSQLClient.js +18 -4
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLOperation/SchemaHelper.d.ts +4 -1
- package/dist/DBSQLOperation/SchemaHelper.js +25 -4
- package/dist/DBSQLOperation/SchemaHelper.js.map +1 -1
- package/dist/DBSQLOperation/index.js +2 -3
- package/dist/DBSQLOperation/index.js.map +1 -1
- package/dist/connection/connections/HttpConnection.js +2 -2
- package/dist/connection/connections/HttpConnection.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/result/IOperationResult.d.ts +2 -1
- package/dist/result/JsonResult.d.ts +3 -5
- package/dist/result/JsonResult.js +6 -11
- package/dist/result/JsonResult.js.map +1 -1
- package/dist/utils/buildUserAgentString.js +2 -7
- package/dist/utils/buildUserAgentString.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/node_modules/async-limiter/.eslintignore +2 -0
- package/node_modules/async-limiter/.nycrc +10 -0
- package/node_modules/async-limiter/.travis.yml +9 -0
- package/node_modules/async-limiter/LICENSE +8 -0
- package/node_modules/async-limiter/index.js +67 -0
- package/node_modules/async-limiter/package.json +39 -0
- package/node_modules/async-limiter/readme.md +132 -0
- package/node_modules/browser-or-node/LICENSE +21 -0
- package/node_modules/browser-or-node/README.md +63 -0
- package/node_modules/browser-or-node/lib/index.js +31 -0
- package/node_modules/browser-or-node/package.json +64 -0
- package/node_modules/browser-or-node/src/index.js +26 -0
- package/node_modules/isomorphic-ws/LICENSE +21 -0
- package/node_modules/isomorphic-ws/README.md +58 -0
- package/node_modules/isomorphic-ws/browser.js +17 -0
- package/node_modules/isomorphic-ws/index.d.ts +8 -0
- package/node_modules/isomorphic-ws/node.js +3 -0
- package/node_modules/isomorphic-ws/package.json +38 -0
- package/node_modules/node-int64/.npmignore +3 -0
- package/node_modules/node-int64/Int64.js +268 -0
- package/node_modules/node-int64/LICENSE +19 -0
- package/node_modules/node-int64/README.md +78 -0
- package/node_modules/node-int64/package.json +31 -0
- package/node_modules/node-int64/test.js +120 -0
- package/node_modules/q/CHANGES.md +800 -0
- package/node_modules/q/LICENSE +18 -0
- package/node_modules/q/README.md +874 -0
- package/node_modules/q/package.json +80 -0
- package/node_modules/q/q.js +2076 -0
- package/node_modules/q/queue.js +35 -0
- package/node_modules/thrift/LICENSE +306 -0
- package/node_modules/thrift/README.md +210 -0
- package/node_modules/thrift/lib/nodejs/README.md +142 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/binary.js +168 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/binary_protocol.js +367 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/browser.js +49 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/buffered_transport.js +186 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/compact_protocol.js +915 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/connection.js +396 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/create_client.js +54 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/framed_transport.js +185 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/header_protocol.js +258 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/header_transport.js +341 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/http_connection.js +282 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/index.js +76 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/input_buffer_underrun_error.js +32 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/int64_util.js +91 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/json_parse.js +299 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/json_protocol.js +799 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/log.js +87 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_processor.js +63 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/multiplexed_protocol.js +73 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/protocol.js +22 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/server.js +123 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/thrift.js +241 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/transport.js +22 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/web_server.js +567 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/ws_connection.js +286 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/ws_transport.js +206 -0
- package/node_modules/thrift/lib/nodejs/lib/thrift/xhr_connection.js +280 -0
- package/node_modules/thrift/package.json +76 -0
- package/node_modules/ws/LICENSE +21 -0
- package/node_modules/ws/README.md +417 -0
- package/node_modules/ws/index.js +9 -0
- package/node_modules/ws/lib/buffer-util.js +72 -0
- package/node_modules/ws/lib/constants.js +10 -0
- package/node_modules/ws/lib/event-target.js +170 -0
- package/node_modules/ws/lib/extension.js +211 -0
- package/node_modules/ws/lib/permessage-deflate.js +516 -0
- package/node_modules/ws/lib/receiver.js +513 -0
- package/node_modules/ws/lib/sender.js +401 -0
- package/node_modules/ws/lib/validation.js +29 -0
- package/node_modules/ws/lib/websocket-server.js +369 -0
- package/node_modules/ws/lib/websocket.js +828 -0
- package/node_modules/ws/package.json +48 -0
- package/package.json +9 -3
- package/dist/DBSQLOperation/getResult.d.ts +0 -2
- package/dist/DBSQLOperation/getResult.js +0 -19
- package/dist/DBSQLOperation/getResult.js.map +0 -1
- package/dist/result/NullResult.d.ts +0 -4
- package/dist/result/NullResult.js +0 -9
- package/dist/result/NullResult.js.map +0 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Allowed token characters:
|
|
5
|
+
//
|
|
6
|
+
// '!', '#', '$', '%', '&', ''', '*', '+', '-',
|
|
7
|
+
// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'
|
|
8
|
+
//
|
|
9
|
+
// tokenChars[32] === 0 // ' '
|
|
10
|
+
// tokenChars[33] === 1 // '!'
|
|
11
|
+
// tokenChars[34] === 0 // '"'
|
|
12
|
+
// ...
|
|
13
|
+
//
|
|
14
|
+
const tokenChars = [
|
|
15
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
|
|
16
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
|
|
17
|
+
0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47
|
|
18
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
|
|
19
|
+
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
|
|
20
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95
|
|
21
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
|
|
22
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Adds an offer to the map of extension offers or a parameter to the map of
|
|
27
|
+
* parameters.
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} dest The map of extension offers or parameters
|
|
30
|
+
* @param {String} name The extension or parameter name
|
|
31
|
+
* @param {(Object|Boolean|String)} elem The extension parameters or the
|
|
32
|
+
* parameter value
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
function push (dest, name, elem) {
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(dest, name)) dest[name].push(elem);
|
|
37
|
+
else dest[name] = [elem];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Parses the `Sec-WebSocket-Extensions` header into an object.
|
|
42
|
+
*
|
|
43
|
+
* @param {String} header The field value of the header
|
|
44
|
+
* @return {Object} The parsed object
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
function parse (header) {
|
|
48
|
+
const offers = {};
|
|
49
|
+
|
|
50
|
+
if (header === undefined || header === '') return offers;
|
|
51
|
+
|
|
52
|
+
var params = {};
|
|
53
|
+
var mustUnescape = false;
|
|
54
|
+
var isEscaping = false;
|
|
55
|
+
var inQuotes = false;
|
|
56
|
+
var extensionName;
|
|
57
|
+
var paramName;
|
|
58
|
+
var start = -1;
|
|
59
|
+
var end = -1;
|
|
60
|
+
|
|
61
|
+
for (var i = 0; i < header.length; i++) {
|
|
62
|
+
const code = header.charCodeAt(i);
|
|
63
|
+
|
|
64
|
+
if (extensionName === undefined) {
|
|
65
|
+
if (end === -1 && tokenChars[code] === 1) {
|
|
66
|
+
if (start === -1) start = i;
|
|
67
|
+
} else if (code === 0x20/* ' ' */|| code === 0x09/* '\t' */) {
|
|
68
|
+
if (end === -1 && start !== -1) end = i;
|
|
69
|
+
} else if (code === 0x3b/* ';' */ || code === 0x2c/* ',' */) {
|
|
70
|
+
if (start === -1) {
|
|
71
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (end === -1) end = i;
|
|
75
|
+
const name = header.slice(start, end);
|
|
76
|
+
if (code === 0x2c) {
|
|
77
|
+
push(offers, name, params);
|
|
78
|
+
params = {};
|
|
79
|
+
} else {
|
|
80
|
+
extensionName = name;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
start = end = -1;
|
|
84
|
+
} else {
|
|
85
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
86
|
+
}
|
|
87
|
+
} else if (paramName === undefined) {
|
|
88
|
+
if (end === -1 && tokenChars[code] === 1) {
|
|
89
|
+
if (start === -1) start = i;
|
|
90
|
+
} else if (code === 0x20 || code === 0x09) {
|
|
91
|
+
if (end === -1 && start !== -1) end = i;
|
|
92
|
+
} else if (code === 0x3b || code === 0x2c) {
|
|
93
|
+
if (start === -1) {
|
|
94
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (end === -1) end = i;
|
|
98
|
+
push(params, header.slice(start, end), true);
|
|
99
|
+
if (code === 0x2c) {
|
|
100
|
+
push(offers, extensionName, params);
|
|
101
|
+
params = {};
|
|
102
|
+
extensionName = undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
start = end = -1;
|
|
106
|
+
} else if (code === 0x3d/* '=' */&& start !== -1 && end === -1) {
|
|
107
|
+
paramName = header.slice(start, i);
|
|
108
|
+
start = end = -1;
|
|
109
|
+
} else {
|
|
110
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
//
|
|
114
|
+
// The value of a quoted-string after unescaping must conform to the
|
|
115
|
+
// token ABNF, so only token characters are valid.
|
|
116
|
+
// Ref: https://tools.ietf.org/html/rfc6455#section-9.1
|
|
117
|
+
//
|
|
118
|
+
if (isEscaping) {
|
|
119
|
+
if (tokenChars[code] !== 1) {
|
|
120
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
121
|
+
}
|
|
122
|
+
if (start === -1) start = i;
|
|
123
|
+
else if (!mustUnescape) mustUnescape = true;
|
|
124
|
+
isEscaping = false;
|
|
125
|
+
} else if (inQuotes) {
|
|
126
|
+
if (tokenChars[code] === 1) {
|
|
127
|
+
if (start === -1) start = i;
|
|
128
|
+
} else if (code === 0x22/* '"' */ && start !== -1) {
|
|
129
|
+
inQuotes = false;
|
|
130
|
+
end = i;
|
|
131
|
+
} else if (code === 0x5c/* '\' */) {
|
|
132
|
+
isEscaping = true;
|
|
133
|
+
} else {
|
|
134
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
135
|
+
}
|
|
136
|
+
} else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {
|
|
137
|
+
inQuotes = true;
|
|
138
|
+
} else if (end === -1 && tokenChars[code] === 1) {
|
|
139
|
+
if (start === -1) start = i;
|
|
140
|
+
} else if (start !== -1 && (code === 0x20 || code === 0x09)) {
|
|
141
|
+
if (end === -1) end = i;
|
|
142
|
+
} else if (code === 0x3b || code === 0x2c) {
|
|
143
|
+
if (start === -1) {
|
|
144
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (end === -1) end = i;
|
|
148
|
+
var value = header.slice(start, end);
|
|
149
|
+
if (mustUnescape) {
|
|
150
|
+
value = value.replace(/\\/g, '');
|
|
151
|
+
mustUnescape = false;
|
|
152
|
+
}
|
|
153
|
+
push(params, paramName, value);
|
|
154
|
+
if (code === 0x2c) {
|
|
155
|
+
push(offers, extensionName, params);
|
|
156
|
+
params = {};
|
|
157
|
+
extensionName = undefined;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
paramName = undefined;
|
|
161
|
+
start = end = -1;
|
|
162
|
+
} else {
|
|
163
|
+
throw new SyntaxError(`Unexpected character at index ${i}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (start === -1 || inQuotes) {
|
|
169
|
+
throw new SyntaxError('Unexpected end of input');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (end === -1) end = i;
|
|
173
|
+
const token = header.slice(start, end);
|
|
174
|
+
if (extensionName === undefined) {
|
|
175
|
+
push(offers, token, {});
|
|
176
|
+
} else {
|
|
177
|
+
if (paramName === undefined) {
|
|
178
|
+
push(params, token, true);
|
|
179
|
+
} else if (mustUnescape) {
|
|
180
|
+
push(params, paramName, token.replace(/\\/g, ''));
|
|
181
|
+
} else {
|
|
182
|
+
push(params, paramName, token);
|
|
183
|
+
}
|
|
184
|
+
push(offers, extensionName, params);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return offers;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Builds the `Sec-WebSocket-Extensions` header field value.
|
|
192
|
+
*
|
|
193
|
+
* @param {Object} extensions The map of extensions and parameters to format
|
|
194
|
+
* @return {String} A string representing the given object
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
function format (extensions) {
|
|
198
|
+
return Object.keys(extensions).map((extension) => {
|
|
199
|
+
var configurations = extensions[extension];
|
|
200
|
+
if (!Array.isArray(configurations)) configurations = [configurations];
|
|
201
|
+
return configurations.map((params) => {
|
|
202
|
+
return [extension].concat(Object.keys(params).map((k) => {
|
|
203
|
+
var values = params[k];
|
|
204
|
+
if (!Array.isArray(values)) values = [values];
|
|
205
|
+
return values.map((v) => v === true ? k : `${k}=${v}`).join('; ');
|
|
206
|
+
})).join('; ');
|
|
207
|
+
}).join(', ');
|
|
208
|
+
}).join(', ');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
module.exports = { format, parse };
|