@tachybase/module-multi-app 1.6.0 → 1.6.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.
Files changed (94) hide show
  1. package/dist/externalVersion.js +5 -5
  2. package/dist/node_modules/mariadb/callback.js +43 -8
  3. package/dist/node_modules/mariadb/check-node.js +30 -0
  4. package/dist/node_modules/mariadb/lib/cluster-callback.js +84 -0
  5. package/dist/node_modules/mariadb/lib/cluster.js +446 -0
  6. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +576 -177
  7. package/dist/node_modules/mariadb/lib/cmd/change-user.js +54 -44
  8. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +3 -2
  9. package/dist/node_modules/mariadb/lib/cmd/class/prepare-cache-wrapper.js +46 -0
  10. package/dist/node_modules/mariadb/lib/cmd/class/prepare-result-packet.js +141 -0
  11. package/dist/node_modules/mariadb/lib/cmd/class/prepare-wrapper.js +70 -0
  12. package/dist/node_modules/mariadb/lib/cmd/close-prepare.js +38 -0
  13. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +145 -47
  14. package/dist/node_modules/mariadb/lib/cmd/command.js +41 -75
  15. package/dist/node_modules/mariadb/lib/cmd/decoder/binary-decoder.js +282 -0
  16. package/dist/node_modules/mariadb/lib/cmd/decoder/text-decoder.js +210 -0
  17. package/dist/node_modules/mariadb/lib/cmd/{common-binary-cmd.js → encoder/binary-encoder.js} +34 -77
  18. package/dist/node_modules/mariadb/lib/cmd/encoder/text-encoder.js +311 -0
  19. package/dist/node_modules/mariadb/lib/cmd/execute-stream.js +61 -0
  20. package/dist/node_modules/mariadb/lib/cmd/execute.js +338 -0
  21. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +25 -62
  22. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +39 -6
  23. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +48 -16
  24. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/handshake.js +198 -0
  25. package/dist/node_modules/mariadb/lib/cmd/handshake/{initial-handshake.js → auth/initial-handshake.js} +10 -8
  26. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +22 -9
  27. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +9 -4
  28. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/parsec-auth.js +115 -0
  29. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +12 -5
  30. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +44 -33
  31. package/dist/node_modules/mariadb/lib/cmd/handshake/authentication.js +335 -0
  32. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +20 -19
  33. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +6 -3
  34. package/dist/node_modules/mariadb/lib/cmd/parser.js +861 -0
  35. package/dist/node_modules/mariadb/lib/cmd/ping.js +17 -18
  36. package/dist/node_modules/mariadb/lib/cmd/prepare.js +170 -0
  37. package/dist/node_modules/mariadb/lib/cmd/query.js +281 -144
  38. package/dist/node_modules/mariadb/lib/cmd/quit.js +9 -6
  39. package/dist/node_modules/mariadb/lib/cmd/reset.js +15 -19
  40. package/dist/node_modules/mariadb/lib/cmd/stream.js +21 -6
  41. package/dist/node_modules/mariadb/lib/config/cluster-options.js +23 -0
  42. package/dist/node_modules/mariadb/lib/config/connection-options.js +196 -132
  43. package/dist/node_modules/mariadb/lib/config/pool-options.js +27 -19
  44. package/dist/node_modules/mariadb/lib/connection-callback.js +492 -120
  45. package/dist/node_modules/mariadb/lib/connection-promise.js +372 -0
  46. package/dist/node_modules/mariadb/lib/connection.js +1739 -1016
  47. package/dist/node_modules/mariadb/lib/const/capabilities.js +36 -30
  48. package/dist/node_modules/mariadb/lib/const/collations.js +972 -36
  49. package/dist/node_modules/mariadb/lib/const/connection_status.js +3 -0
  50. package/dist/node_modules/mariadb/lib/const/error-code.js +35 -11
  51. package/dist/node_modules/mariadb/lib/const/field-detail.js +3 -0
  52. package/dist/node_modules/mariadb/lib/const/field-type.js +7 -4
  53. package/dist/node_modules/mariadb/lib/const/server-status.js +4 -1
  54. package/dist/node_modules/mariadb/lib/const/state-change.js +3 -0
  55. package/dist/node_modules/mariadb/lib/filtered-cluster-callback.js +136 -0
  56. package/dist/node_modules/mariadb/lib/filtered-cluster.js +118 -0
  57. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +14 -13
  58. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +21 -18
  59. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +75 -64
  60. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +13 -9
  61. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +12 -10
  62. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +402 -134
  63. package/dist/node_modules/mariadb/lib/io/packet.js +287 -202
  64. package/dist/node_modules/mariadb/lib/lru-prepare-cache.js +84 -0
  65. package/dist/node_modules/mariadb/lib/misc/connection-information.js +15 -32
  66. package/dist/node_modules/mariadb/lib/misc/errors.js +68 -25
  67. package/dist/node_modules/mariadb/lib/misc/parse.js +207 -711
  68. package/dist/node_modules/mariadb/lib/misc/utils.js +34 -62
  69. package/dist/node_modules/mariadb/lib/pool-callback.js +213 -174
  70. package/dist/node_modules/mariadb/lib/pool-promise.js +228 -94
  71. package/dist/node_modules/mariadb/lib/pool.js +951 -0
  72. package/dist/node_modules/mariadb/package.json +1 -1
  73. package/dist/node_modules/mariadb/promise.js +1 -34
  74. package/dist/node_modules/mariadb/types/callback.d.ts +207 -0
  75. package/dist/node_modules/mariadb/types/index.d.ts +94 -674
  76. package/dist/node_modules/mariadb/types/share.d.ts +804 -0
  77. package/dist/node_modules/qs/package.json +1 -1
  78. package/dist/server/actions/apps.js +2 -2
  79. package/dist/server/app-lifecycle.d.ts +1 -1
  80. package/dist/server/app-lifecycle.js +4 -4
  81. package/dist/server/models/application.d.ts +1 -1
  82. package/package.json +7 -7
  83. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  84. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  85. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  86. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  87. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  88. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  89. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  90. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  91. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  92. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  93. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  94. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
@@ -1,292 +0,0 @@
1
- 'use strict';
2
-
3
- const Command = require('../command');
4
- const InitialHandshake = require('./initial-handshake');
5
- const ClientHandshakeResponse = require('./client-handshake-response');
6
- const SslRequest = require('./ssl-request');
7
- const ClientCapabilities = require('./client-capabilities');
8
- const Errors = require('../../misc/errors');
9
- const Capabilities = require('../../const/capabilities');
10
- const process = require('process');
11
-
12
- /**
13
- * Handle handshake.
14
- * see https://mariadb.com/kb/en/library/1-connecting-connecting/
15
- */
16
- class Handshake extends Command {
17
- constructor(resolve, reject, _createSecureContext, _addCommand, getSocket) {
18
- super(resolve, reject);
19
- this._createSecureContext = _createSecureContext;
20
- this._addCommand = _addCommand;
21
- this.getSocket = getSocket;
22
- this.onPacketReceive = this.parseHandshakeInit;
23
- this.plugin = this;
24
- }
25
-
26
- ensureOptionCompatibility(opts, info) {
27
- if (
28
- opts.multipleStatements &&
29
- (info.serverCapabilities & Capabilities.MULTI_STATEMENTS) === 0
30
- ) {
31
- return this.throwNewError(
32
- "Option `multipleStatements` enable, but server doesn'permits multi-statment",
33
- true,
34
- info,
35
- '08S01',
36
- Errors.ER_CLIENT_OPTION_INCOMPATIBILITY
37
- );
38
- }
39
-
40
- if (opts.permitLocalInfile && (info.serverCapabilities & Capabilities.LOCAL_FILES) === 0) {
41
- return this.throwNewError(
42
- "Option `permitLocalInfile` enable, but server doesn'permits using local file",
43
- true,
44
- info,
45
- '08S01',
46
- Errors.ER_CLIENT_OPTION_INCOMPATIBILITY
47
- );
48
- }
49
- }
50
-
51
- parseHandshakeInit(packet, out, opts, info) {
52
- if (packet.peek() === 0xff) {
53
- //in case that some host is not permit to connect server
54
- const authErr = packet.readError(info);
55
- authErr.fatal = true;
56
- return this.throwError(authErr, info);
57
- }
58
-
59
- let handshake = new InitialHandshake(packet, info);
60
- this.ensureOptionCompatibility(opts, info);
61
- ClientCapabilities.init(opts, info);
62
-
63
- if (opts.ssl) {
64
- if (info.serverCapabilities & Capabilities.SSL) {
65
- info.clientCapabilities |= Capabilities.SSL;
66
- SslRequest.send(this, out, info, opts);
67
- this._createSecureContext(
68
- function () {
69
- ClientHandshakeResponse.send(this, out, opts, handshake.pluginName, info);
70
- }.bind(this)
71
- );
72
- } else {
73
- return this.throwNewError(
74
- 'Trying to connect with ssl, but ssl not enabled in the server',
75
- true,
76
- info,
77
- '08S01',
78
- Errors.ER_SERVER_SSL_DISABLED
79
- );
80
- }
81
- } else {
82
- ClientHandshakeResponse.send(this, out, opts, handshake.pluginName, info);
83
- }
84
- this.onPacketReceive = this.handshakeResult;
85
- }
86
-
87
- /**
88
- * Fast-path handshake results :
89
- * - if plugin was the one expected by server, server will send OK_Packet / ERR_Packet.
90
- * - if not, server send an AuthSwitchRequest packet, indicating the specific PLUGIN to use with this user.
91
- * dispatching to plugin handler then.
92
- *
93
- * @param packet current packet
94
- * @param out output buffer
95
- * @param opts options
96
- * @param info connection info
97
- * @returns {*} return null if authentication succeed, depending on plugin conversation if not finished
98
- */
99
- handshakeResult(packet, out, opts, info) {
100
- const marker = packet.peek();
101
- switch (marker) {
102
- //*********************************************************************************************************
103
- //* AuthSwitchRequest packet
104
- //*********************************************************************************************************
105
- case 0xfe:
106
- this.plugin.onPacketReceive = null;
107
- this.plugin.emit('send_end');
108
- this.plugin.emit('end');
109
- this.dispatchAuthSwitchRequest(packet, out, opts, info);
110
- return;
111
-
112
- //*********************************************************************************************************
113
- //* OK_Packet - authentication succeeded
114
- //*********************************************************************************************************
115
- case 0x00:
116
- this.plugin.onPacketReceive = null;
117
- packet.skip(1); //skip header
118
- packet.skipLengthCodedNumber(); //skip affected rows
119
- packet.skipLengthCodedNumber(); //skip last insert id
120
- info.status = packet.readUInt16();
121
- this.plugin.emit('send_end');
122
- return this.plugin.successEnd();
123
-
124
- //*********************************************************************************************************
125
- //* ERR_Packet
126
- //*********************************************************************************************************
127
- case 0xff:
128
- this.plugin.onPacketReceive = null;
129
- const authErr = packet.readError(info, this.displaySql());
130
- authErr.fatal = true;
131
- return this.plugin.throwError(authErr, info);
132
-
133
- //*********************************************************************************************************
134
- //* unexpected
135
- //*********************************************************************************************************
136
- default:
137
- this.throwNewError(
138
- 'Unexpected type of packet during handshake phase : ' + marker,
139
- true,
140
- info,
141
- '42000',
142
- Errors.ER_AUTHENTICATION_BAD_PACKET
143
- );
144
- }
145
- }
146
-
147
- /**
148
- * Handle authentication switch request : dispatch to plugin handler.
149
- *
150
- * @param packet packet
151
- * @param out output writer
152
- * @param opts options
153
- * @param info connection information
154
- */
155
- dispatchAuthSwitchRequest(packet, out, opts, info) {
156
- let pluginName, pluginData;
157
- if (info.clientCapabilities & Capabilities.PLUGIN_AUTH) {
158
- packet.skip(1); //header
159
- if (packet.remaining()) {
160
- //AuthSwitchRequest packet.
161
- pluginName = packet.readStringNullEnded();
162
- pluginData = packet.readBufferRemaining();
163
- } else {
164
- //OldAuthSwitchRequest
165
- pluginName = 'mysql_old_password';
166
- pluginData = info.seed.slice(0, 8);
167
- }
168
- } else {
169
- pluginName = packet.readStringNullEnded('cesu8');
170
- pluginData = packet.readBufferRemaining();
171
- }
172
-
173
- try {
174
- this.plugin = Handshake.pluginHandler(
175
- pluginName,
176
- this.plugin.sequenceNo,
177
- this.plugin.compressSequenceNo,
178
- pluginData,
179
- info,
180
- opts,
181
- out,
182
- this.resolve,
183
- this.reject,
184
- this.handshakeResult.bind(this)
185
- );
186
- } catch (err) {
187
- this.reject(err);
188
- return;
189
- }
190
-
191
- if (!this.plugin) {
192
- this.reject(
193
- Errors.createError(
194
- "Client does not support authentication protocol '" +
195
- pluginName +
196
- "' requested by server. ",
197
- null,
198
- true,
199
- info,
200
- '08004',
201
- Errors.ER_AUTHENTICATION_PLUGIN_NOT_SUPPORTED
202
- )
203
- );
204
- } else {
205
- this._addCommand(this.plugin, false);
206
- }
207
- }
208
-
209
- static pluginHandler(
210
- pluginName,
211
- packSeq,
212
- compressPackSeq,
213
- pluginData,
214
- info,
215
- opts,
216
- out,
217
- authResolve,
218
- authReject,
219
- multiAuthResolver
220
- ) {
221
- let pluginAuth;
222
- switch (pluginName) {
223
- case 'mysql_native_password':
224
- pluginAuth = require('./auth/native-password-auth.js');
225
- break;
226
-
227
- case 'mysql_clear_password':
228
- pluginAuth = require('./auth/clear-password-auth.js');
229
- break;
230
-
231
- case 'client_ed25519':
232
- pluginAuth = require('./auth/ed25519-password-auth.js');
233
- break;
234
-
235
- case 'dialog':
236
- pluginAuth = require('./auth/pam-password-auth.js');
237
- break;
238
-
239
- case 'sha256_password':
240
- if (!Handshake.ensureNodeVersion(11, 6, 0)) {
241
- throw Errors.createError(
242
- 'sha256_password authentication plugin require node 11.6+',
243
- null,
244
- true,
245
- info,
246
- '08004',
247
- Errors.ER_MINIMUM_NODE_VERSION_REQUIRED
248
- );
249
- }
250
- pluginAuth = require('./auth/sha256-password-auth.js');
251
- break;
252
-
253
- case 'caching_sha2_password':
254
- if (!Handshake.ensureNodeVersion(11, 6, 0)) {
255
- throw Errors.createError(
256
- 'caching_sha2_password authentication plugin require node 11.6+',
257
- null,
258
- true,
259
- info,
260
- '08004',
261
- Errors.ER_MINIMUM_NODE_VERSION_REQUIRED
262
- );
263
- }
264
- pluginAuth = require('./auth/caching-sha2-password-auth.js');
265
- break;
266
-
267
- //TODO "auth_gssapi_client"
268
-
269
- default:
270
- return null;
271
- }
272
- return new pluginAuth(
273
- packSeq,
274
- compressPackSeq,
275
- pluginData,
276
- authResolve,
277
- authReject,
278
- multiAuthResolver
279
- );
280
- }
281
-
282
- static ensureNodeVersion(major, minor, patch) {
283
- const ver = process.versions.node.split('.');
284
- return (
285
- ver[0] > major ||
286
- (ver[0] === major && ver[1] > minor) ||
287
- (ver[0] === major && ver[1] === minor && ver[2] >= patch)
288
- );
289
- }
290
- }
291
-
292
- module.exports = Handshake;