@databricks/sql 0.1.8-beta.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/.gitattributes +32 -0
- package/CHANGELOG.md +1 -0
- package/CONTRIBUTING.md +55 -0
- package/LICENSE +201 -0
- package/README.md +78 -0
- package/dist/DBSQLClient.d.ts +42 -0
- package/dist/DBSQLClient.js +111 -0
- package/dist/DBSQLClient.js.map +1 -0
- package/dist/HiveClient.d.ts +35 -0
- package/dist/HiveClient.js +156 -0
- package/dist/HiveClient.js.map +1 -0
- package/dist/HiveOperation.d.ts +65 -0
- package/dist/HiveOperation.js +190 -0
- package/dist/HiveOperation.js.map +1 -0
- package/dist/HiveSession.d.ts +30 -0
- package/dist/HiveSession.js +197 -0
- package/dist/HiveSession.js.map +1 -0
- package/dist/connection/auth/NoSaslAuthentication.d.ts +5 -0
- package/dist/connection/auth/NoSaslAuthentication.js +15 -0
- package/dist/connection/auth/NoSaslAuthentication.js.map +1 -0
- package/dist/connection/auth/PlainHttpAuthentication.d.ts +15 -0
- package/dist/connection/auth/PlainHttpAuthentication.js +30 -0
- package/dist/connection/auth/PlainHttpAuthentication.js.map +1 -0
- package/dist/connection/auth/helpers/SaslPackageFactory.d.ts +11 -0
- package/dist/connection/auth/helpers/SaslPackageFactory.js +24 -0
- package/dist/connection/auth/helpers/SaslPackageFactory.js.map +1 -0
- package/dist/connection/connections/HttpConnection.d.ts +13 -0
- package/dist/connection/connections/HttpConnection.js +77 -0
- package/dist/connection/connections/HttpConnection.js.map +1 -0
- package/dist/connection/contracts/IAuthentication.d.ts +4 -0
- package/dist/connection/contracts/IAuthentication.js +3 -0
- package/dist/connection/contracts/IAuthentication.js.map +1 -0
- package/dist/connection/contracts/IConnectionOptions.d.ts +23 -0
- package/dist/connection/contracts/IConnectionOptions.js +3 -0
- package/dist/connection/contracts/IConnectionOptions.js.map +1 -0
- package/dist/connection/contracts/IConnectionProvider.d.ts +6 -0
- package/dist/connection/contracts/IConnectionProvider.js +3 -0
- package/dist/connection/contracts/IConnectionProvider.js.map +1 -0
- package/dist/connection/contracts/IThriftConnection.d.ts +4 -0
- package/dist/connection/contracts/IThriftConnection.js +3 -0
- package/dist/connection/contracts/IThriftConnection.js.map +1 -0
- package/dist/connection/contracts/ITransport.d.ts +13 -0
- package/dist/connection/contracts/ITransport.js +3 -0
- package/dist/connection/contracts/ITransport.js.map +1 -0
- package/dist/connection/transports/HttpTransport.d.ts +14 -0
- package/dist/connection/transports/HttpTransport.js +39 -0
- package/dist/connection/transports/HttpTransport.js.map +1 -0
- package/dist/connection/types/AuthOptions.d.ts +4 -0
- package/dist/connection/types/AuthOptions.js +3 -0
- package/dist/connection/types/AuthOptions.js.map +1 -0
- package/dist/contracts/IHiveClient.d.ts +10 -0
- package/dist/contracts/IHiveClient.js +3 -0
- package/dist/contracts/IHiveClient.js.map +1 -0
- package/dist/contracts/IHiveSession.d.ts +126 -0
- package/dist/contracts/IHiveSession.js +3 -0
- package/dist/contracts/IHiveSession.js.map +1 -0
- package/dist/contracts/IOperation.d.ts +47 -0
- package/dist/contracts/IOperation.js +3 -0
- package/dist/contracts/IOperation.js.map +1 -0
- package/dist/dto/InfoValue.d.ts +9 -0
- package/dist/dto/InfoValue.js +31 -0
- package/dist/dto/InfoValue.js.map +1 -0
- package/dist/dto/Status.d.ts +15 -0
- package/dist/dto/Status.js +21 -0
- package/dist/dto/Status.js.map +1 -0
- package/dist/errors/AuthenticationError.d.ts +3 -0
- package/dist/errors/AuthenticationError.js +30 -0
- package/dist/errors/AuthenticationError.js.map +1 -0
- package/dist/errors/HiveDriverError.d.ts +2 -0
- package/dist/errors/HiveDriverError.js +26 -0
- package/dist/errors/HiveDriverError.js.map +1 -0
- package/dist/errors/OperationStateError.d.ts +6 -0
- package/dist/errors/OperationStateError.js +32 -0
- package/dist/errors/OperationStateError.js.map +1 -0
- package/dist/errors/StatusError.d.ts +8 -0
- package/dist/errors/StatusError.js +15 -0
- package/dist/errors/StatusError.js.map +1 -0
- package/dist/factory/StatusFactory.d.ts +14 -0
- package/dist/factory/StatusFactory.js +40 -0
- package/dist/factory/StatusFactory.js.map +1 -0
- package/dist/hive/Commands/BaseCommand.d.ts +7 -0
- package/dist/hive/Commands/BaseCommand.js +36 -0
- package/dist/hive/Commands/BaseCommand.js.map +1 -0
- package/dist/hive/Commands/CancelDelegationTokenCommand.d.ts +12 -0
- package/dist/hive/Commands/CancelDelegationTokenCommand.js +34 -0
- package/dist/hive/Commands/CancelDelegationTokenCommand.js.map +1 -0
- package/dist/hive/Commands/CancelOperationCommand.d.ts +11 -0
- package/dist/hive/Commands/CancelOperationCommand.js +34 -0
- package/dist/hive/Commands/CancelOperationCommand.js.map +1 -0
- package/dist/hive/Commands/CloseOperationCommand.d.ts +11 -0
- package/dist/hive/Commands/CloseOperationCommand.js +34 -0
- package/dist/hive/Commands/CloseOperationCommand.js.map +1 -0
- package/dist/hive/Commands/CloseSessionCommand.d.ts +11 -0
- package/dist/hive/Commands/CloseSessionCommand.js +34 -0
- package/dist/hive/Commands/CloseSessionCommand.js.map +1 -0
- package/dist/hive/Commands/ExecuteStatementCommand.d.ts +17 -0
- package/dist/hive/Commands/ExecuteStatementCommand.js +34 -0
- package/dist/hive/Commands/ExecuteStatementCommand.js.map +1 -0
- package/dist/hive/Commands/FetchResultsCommand.d.ts +20 -0
- package/dist/hive/Commands/FetchResultsCommand.js +34 -0
- package/dist/hive/Commands/FetchResultsCommand.js.map +1 -0
- package/dist/hive/Commands/GetCatalogsCommand.d.ts +12 -0
- package/dist/hive/Commands/GetCatalogsCommand.js +34 -0
- package/dist/hive/Commands/GetCatalogsCommand.js.map +1 -0
- package/dist/hive/Commands/GetColumnsCommand.d.ts +16 -0
- package/dist/hive/Commands/GetColumnsCommand.js +34 -0
- package/dist/hive/Commands/GetColumnsCommand.js.map +1 -0
- package/dist/hive/Commands/GetCrossReferenceCommand.d.ts +18 -0
- package/dist/hive/Commands/GetCrossReferenceCommand.js +34 -0
- package/dist/hive/Commands/GetCrossReferenceCommand.js.map +1 -0
- package/dist/hive/Commands/GetDelegationTokenCommand.d.ts +14 -0
- package/dist/hive/Commands/GetDelegationTokenCommand.js +34 -0
- package/dist/hive/Commands/GetDelegationTokenCommand.js.map +1 -0
- package/dist/hive/Commands/GetFunctionsCommand.d.ts +15 -0
- package/dist/hive/Commands/GetFunctionsCommand.js +34 -0
- package/dist/hive/Commands/GetFunctionsCommand.js.map +1 -0
- package/dist/hive/Commands/GetInfoCommand.d.ts +16 -0
- package/dist/hive/Commands/GetInfoCommand.js +34 -0
- package/dist/hive/Commands/GetInfoCommand.js.map +1 -0
- package/dist/hive/Commands/GetOperationStatusCommand.d.ts +23 -0
- package/dist/hive/Commands/GetOperationStatusCommand.js +34 -0
- package/dist/hive/Commands/GetOperationStatusCommand.js.map +1 -0
- package/dist/hive/Commands/GetPrimaryKeysCommand.d.ts +15 -0
- package/dist/hive/Commands/GetPrimaryKeysCommand.js +34 -0
- package/dist/hive/Commands/GetPrimaryKeysCommand.js.map +1 -0
- package/dist/hive/Commands/GetQueryIdCommand.d.ts +11 -0
- package/dist/hive/Commands/GetQueryIdCommand.js +34 -0
- package/dist/hive/Commands/GetQueryIdCommand.js.map +1 -0
- package/dist/hive/Commands/GetResultSetMetadataCommand.d.ts +12 -0
- package/dist/hive/Commands/GetResultSetMetadataCommand.js +34 -0
- package/dist/hive/Commands/GetResultSetMetadataCommand.js.map +1 -0
- package/dist/hive/Commands/GetSchemasCommand.d.ts +14 -0
- package/dist/hive/Commands/GetSchemasCommand.js +34 -0
- package/dist/hive/Commands/GetSchemasCommand.js.map +1 -0
- package/dist/hive/Commands/GetTableTypesCommand.d.ts +12 -0
- package/dist/hive/Commands/GetTableTypesCommand.js +34 -0
- package/dist/hive/Commands/GetTableTypesCommand.js.map +1 -0
- package/dist/hive/Commands/GetTablesCommand.d.ts +16 -0
- package/dist/hive/Commands/GetTablesCommand.js +34 -0
- package/dist/hive/Commands/GetTablesCommand.js.map +1 -0
- package/dist/hive/Commands/GetTypeInfoCommand.d.ts +12 -0
- package/dist/hive/Commands/GetTypeInfoCommand.js +34 -0
- package/dist/hive/Commands/GetTypeInfoCommand.js.map +1 -0
- package/dist/hive/Commands/OpenSessionCommand.d.ts +33 -0
- package/dist/hive/Commands/OpenSessionCommand.js +34 -0
- package/dist/hive/Commands/OpenSessionCommand.js.map +1 -0
- package/dist/hive/Commands/RenewDelegationTokenCommand.d.ts +12 -0
- package/dist/hive/Commands/RenewDelegationTokenCommand.js +34 -0
- package/dist/hive/Commands/RenewDelegationTokenCommand.js.map +1 -0
- package/dist/hive/Commands/SetClientInfoCommand.d.ts +12 -0
- package/dist/hive/Commands/SetClientInfoCommand.js +34 -0
- package/dist/hive/Commands/SetClientInfoCommand.js.map +1 -0
- package/dist/hive/HiveDriver.d.ts +52 -0
- package/dist/hive/HiveDriver.js +129 -0
- package/dist/hive/HiveDriver.js.map +1 -0
- package/dist/hive/Types/index.d.ts +229 -0
- package/dist/hive/Types/index.js +16 -0
- package/dist/hive/Types/index.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/result/IOperationResult.d.ts +5 -0
- package/dist/result/IOperationResult.js +3 -0
- package/dist/result/IOperationResult.js.map +1 -0
- package/dist/result/JsonResult.d.ts +20 -0
- package/dist/result/JsonResult.js +137 -0
- package/dist/result/JsonResult.js.map +1 -0
- package/dist/result/NullResult.d.ts +6 -0
- package/dist/result/NullResult.js +13 -0
- package/dist/result/NullResult.js.map +1 -0
- package/dist/utils/GetResult.d.ts +16 -0
- package/dist/utils/GetResult.js +38 -0
- package/dist/utils/GetResult.js.map +1 -0
- package/dist/utils/HiveUtils.d.ts +11 -0
- package/dist/utils/HiveUtils.js +39 -0
- package/dist/utils/HiveUtils.js.map +1 -0
- package/dist/utils/ProgressUpdateTransformer.d.ts +8 -0
- package/dist/utils/ProgressUpdateTransformer.js +33 -0
- package/dist/utils/ProgressUpdateTransformer.js.map +1 -0
- package/dist/utils/WaitUntilReady.d.ts +16 -0
- package/dist/utils/WaitUntilReady.js +120 -0
- package/dist/utils/WaitUntilReady.js.map +1 -0
- package/docs/readme.md +227 -0
- package/docs/troubleshooting.md +84 -0
- package/examples/data_types.js +173 -0
- package/examples/repl +106 -0
- package/examples/session.js +55 -0
- package/examples/usage.js +18 -0
- package/nyc.config.js +8 -0
- package/package.json +56 -0
- package/tests/e2e/data_types.test.js +353 -0
- package/tests/e2e/utils/config.js +20 -0
- package/tests/e2e/utils/logger.js +22 -0
- package/tests/unit/HiveClient.test.js +153 -0
- package/tests/unit/HiveOperation.test.js +340 -0
- package/tests/unit/HiveSession.test.js +146 -0
- package/tests/unit/connection/auth/PlainHttpAuthentication.test.js +44 -0
- package/tests/unit/connection/connections/HttpConnection.test.js +141 -0
- package/tests/unit/dto/InfoValue.test.js +50 -0
- package/tests/unit/factory/StatusFactory.test.js +62 -0
- package/tests/unit/hive/HiveDriver.test.js +115 -0
- package/tests/unit/hive/commands/CancelDelegationTokenCommand.test.js +43 -0
- package/tests/unit/hive/commands/CancelOperationCommand.test.js +45 -0
- package/tests/unit/hive/commands/CloseOperationCommand.test.js +45 -0
- package/tests/unit/hive/commands/CloseSessionCommand.test.js +38 -0
- package/tests/unit/hive/commands/ExecuteStatementCommand.test.js +54 -0
- package/tests/unit/hive/commands/FetchResultsCommand.test.js +59 -0
- package/tests/unit/hive/commands/GetCatalogsCommand.test.js +50 -0
- package/tests/unit/hive/commands/GetColumnsCommand.test.js +50 -0
- package/tests/unit/hive/commands/GetCrossReferenceCommand.test.js +56 -0
- package/tests/unit/hive/commands/GetDelegationTokenCommand.test.js +45 -0
- package/tests/unit/hive/commands/GetFunctionsCommand.test.js +50 -0
- package/tests/unit/hive/commands/GetInfoCommand.test.js +51 -0
- package/tests/unit/hive/commands/GetOperationStatusCommand.test.js +63 -0
- package/tests/unit/hive/commands/GetPrimaryKeysCommand.test.js +50 -0
- package/tests/unit/hive/commands/GetQueryIdCommand.test.js +42 -0
- package/tests/unit/hive/commands/GetResultSetMetadataCommand.test.js +54 -0
- package/tests/unit/hive/commands/GetSchemasCommand.test.js +52 -0
- package/tests/unit/hive/commands/GetTableTypesCommand.test.js +50 -0
- package/tests/unit/hive/commands/GetTablesCommand.test.js +54 -0
- package/tests/unit/hive/commands/GetTypeInfoCommand.test.js +50 -0
- package/tests/unit/hive/commands/OpenSessionCommand.test.js +43 -0
- package/tests/unit/hive/commands/RenewDelegationTokenCommand.test.js +43 -0
- package/tests/unit/hive/commands/SetClientInfoCommand.test.js +45 -0
- package/tests/unit/result/JsonResult.test.js +295 -0
- package/tests/unit/utils/GetResult.test.js +30 -0
- package/tests/unit/utils/HiveUtils.test.js +60 -0
- package/tests/unit/utils/ProgressUpdateTransformer.test.js +28 -0
- package/tests/unit/utils/WaitUntilReady.test.js +105 -0
- package/thrift/TCLIService.thrift +1299 -0
- package/thrift/gen-nodejs/TCLIService.js +4596 -0
- package/thrift/gen-nodejs/TCLIService_types.js +6794 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var thrift = require('thrift');
|
|
4
|
+
var NoSaslAuthentication = /** @class */ (function () {
|
|
5
|
+
function NoSaslAuthentication() {
|
|
6
|
+
}
|
|
7
|
+
NoSaslAuthentication.prototype.authenticate = function (transport) {
|
|
8
|
+
transport.connect();
|
|
9
|
+
transport.setOptions('transport', thrift.TBufferedTransport);
|
|
10
|
+
return Promise.resolve(transport);
|
|
11
|
+
};
|
|
12
|
+
return NoSaslAuthentication;
|
|
13
|
+
}());
|
|
14
|
+
exports.default = NoSaslAuthentication;
|
|
15
|
+
//# sourceMappingURL=NoSaslAuthentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoSaslAuthentication.js","sourceRoot":"","sources":["../../../lib/connection/auth/NoSaslAuthentication.ts"],"names":[],"mappings":";;AAAA,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAIjC;IAAA;IAOA,CAAC;IANG,2CAAY,GAAZ,UAAa,SAAqB;QAC9B,SAAS,CAAC,OAAO,EAAE,CAAC;QACpB,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAE7D,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IACL,2BAAC;AAAD,CAAC,AAPD,IAOC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import IAuthentication from "../contracts/IAuthentication";
|
|
2
|
+
import ITransport from "../contracts/ITransport";
|
|
3
|
+
import { AuthOptions } from '../types/AuthOptions';
|
|
4
|
+
declare type HttpAuthOptions = AuthOptions & {
|
|
5
|
+
headers?: object;
|
|
6
|
+
};
|
|
7
|
+
export default class PlainHttpAuthentication implements IAuthentication {
|
|
8
|
+
private username;
|
|
9
|
+
private password;
|
|
10
|
+
private headers;
|
|
11
|
+
constructor(options: HttpAuthOptions);
|
|
12
|
+
authenticate(transport: ITransport): Promise<ITransport>;
|
|
13
|
+
private getToken;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var PlainHttpAuthentication = /** @class */ (function () {
|
|
15
|
+
function PlainHttpAuthentication(options) {
|
|
16
|
+
this.username = (options === null || options === void 0 ? void 0 : options.username) || 'anonymous';
|
|
17
|
+
this.password = (options === null || options === void 0 ? void 0 : options.password) !== undefined ? options === null || options === void 0 ? void 0 : options.password : 'anonymous';
|
|
18
|
+
this.headers = (options === null || options === void 0 ? void 0 : options.headers) || {};
|
|
19
|
+
}
|
|
20
|
+
PlainHttpAuthentication.prototype.authenticate = function (transport) {
|
|
21
|
+
transport.setOptions('headers', __assign(__assign({}, (this.headers)), { Authorization: this.getToken(this.username, this.password) }));
|
|
22
|
+
return Promise.resolve(transport);
|
|
23
|
+
};
|
|
24
|
+
PlainHttpAuthentication.prototype.getToken = function (username, password) {
|
|
25
|
+
return 'Basic ' + Buffer.from("".concat(username, ":").concat(password)).toString('base64');
|
|
26
|
+
};
|
|
27
|
+
return PlainHttpAuthentication;
|
|
28
|
+
}());
|
|
29
|
+
exports.default = PlainHttpAuthentication;
|
|
30
|
+
//# sourceMappingURL=PlainHttpAuthentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainHttpAuthentication.js","sourceRoot":"","sources":["../../../lib/connection/auth/PlainHttpAuthentication.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAQA;IAKI,iCAAY,OAAwB;QAChC,IAAI,CAAC,QAAQ,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,WAAW,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAK,SAAS,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;QAClF,IAAI,CAAC,OAAO,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAAI,EAAE,CAAC;IAC1C,CAAC;IAED,8CAAY,GAAZ,UAAa,SAAqB;QAC9B,SAAS,CAAC,UAAU,CAAC,SAAS,wBACvB,CAAC,IAAI,CAAC,OAAO,CAAC,KACjB,aAAa,EAAE,IAAI,CAAC,QAAQ,CACxB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,QAAQ,CAChB,IACH,CAAC;QAEH,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAEO,0CAAQ,GAAhB,UAAiB,QAAgB,EAAE,QAAgB;QAC/C,OAAO,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,UAAG,QAAQ,cAAI,QAAQ,CAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChF,CAAC;IACL,8BAAC;AAAD,CAAC,AA1BD,IA0BC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaslPackageFactory = exports.StatusCode = void 0;
|
|
4
|
+
var StatusCode;
|
|
5
|
+
(function (StatusCode) {
|
|
6
|
+
StatusCode[StatusCode["START"] = 1] = "START";
|
|
7
|
+
StatusCode[StatusCode["OK"] = 2] = "OK";
|
|
8
|
+
StatusCode[StatusCode["BAD"] = 3] = "BAD";
|
|
9
|
+
StatusCode[StatusCode["ERROR"] = 4] = "ERROR";
|
|
10
|
+
StatusCode[StatusCode["COMPLETE"] = 5] = "COMPLETE";
|
|
11
|
+
})(StatusCode = exports.StatusCode || (exports.StatusCode = {}));
|
|
12
|
+
;
|
|
13
|
+
var SaslPackageFactory = /** @class */ (function () {
|
|
14
|
+
function SaslPackageFactory() {
|
|
15
|
+
}
|
|
16
|
+
SaslPackageFactory.create = function (status, body) {
|
|
17
|
+
var bodyLength = Buffer.alloc(4);
|
|
18
|
+
bodyLength.writeUInt32BE(body.length, 0);
|
|
19
|
+
return Buffer.concat([Buffer.from([status]), bodyLength, body]);
|
|
20
|
+
};
|
|
21
|
+
return SaslPackageFactory;
|
|
22
|
+
}());
|
|
23
|
+
exports.SaslPackageFactory = SaslPackageFactory;
|
|
24
|
+
//# sourceMappingURL=SaslPackageFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaslPackageFactory.js","sourceRoot":"","sources":["../../../../lib/connection/auth/helpers/SaslPackageFactory.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAMX;AAND,WAAY,UAAU;IAClB,6CAAO,CAAA;IACP,uCAAI,CAAA;IACJ,yCAAK,CAAA;IACL,6CAAO,CAAA;IACP,mDAAU,CAAA;AACd,CAAC,EANW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAMrB;AAAA,CAAC;AAEF;IAAA;IAQA,CAAC;IAPU,yBAAM,GAAb,UAAc,MAAkB,EAAE,IAAY;QAC1C,IAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEnC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAEzC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAE,MAAM,CAAC,IAAI,CAAC,CAAE,MAAM,CAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAE,CAAC,CAAC;IACxE,CAAC;IACL,yBAAC;AAAD,CAAC,AARD,IAQC;AARY,gDAAkB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import IThriftConnection from "../contracts/IThriftConnection";
|
|
2
|
+
import IConnectionProvider from "../contracts/IConnectionProvider";
|
|
3
|
+
import IConnectionOptions from "../contracts/IConnectionOptions";
|
|
4
|
+
import IAuthentication from "../contracts/IAuthentication";
|
|
5
|
+
export default class HttpConnection implements IConnectionProvider, IThriftConnection {
|
|
6
|
+
private thrift;
|
|
7
|
+
private connection;
|
|
8
|
+
connect(options: IConnectionOptions, authProvider: IAuthentication): Promise<IThriftConnection>;
|
|
9
|
+
getConnection(): any;
|
|
10
|
+
isConnected(): boolean;
|
|
11
|
+
private getNodeOptions;
|
|
12
|
+
private addCookieHandler;
|
|
13
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var thrift = require('thrift');
|
|
18
|
+
var HttpTransport_1 = __importDefault(require("../transports/HttpTransport"));
|
|
19
|
+
var HttpConnection = /** @class */ (function () {
|
|
20
|
+
function HttpConnection() {
|
|
21
|
+
this.thrift = thrift;
|
|
22
|
+
}
|
|
23
|
+
HttpConnection.prototype.connect = function (options, authProvider) {
|
|
24
|
+
var _this = this;
|
|
25
|
+
var _a;
|
|
26
|
+
var httpTransport = new HttpTransport_1.default(__assign(__assign({ transport: thrift.TBufferedTransport, protocol: thrift.TBinaryProtocol }, options.options), { nodeOptions: __assign(__assign({}, this.getNodeOptions(options.options || {})), (((_a = options.options) === null || _a === void 0 ? void 0 : _a.nodeOptions) || {})) }));
|
|
27
|
+
return authProvider.authenticate(httpTransport).then(function () {
|
|
28
|
+
_this.connection = _this.thrift.createHttpConnection(options.host, options.port, httpTransport.getOptions());
|
|
29
|
+
_this.addCookieHandler();
|
|
30
|
+
return _this;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
HttpConnection.prototype.getConnection = function () {
|
|
34
|
+
return this.connection;
|
|
35
|
+
};
|
|
36
|
+
HttpConnection.prototype.isConnected = function () {
|
|
37
|
+
if (this.connection) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
HttpConnection.prototype.getNodeOptions = function (options) {
|
|
45
|
+
var ca = options.ca, cert = options.cert, key = options.key, https = options.https;
|
|
46
|
+
var nodeOptions = {};
|
|
47
|
+
if (ca) {
|
|
48
|
+
nodeOptions.ca = ca;
|
|
49
|
+
}
|
|
50
|
+
if (cert) {
|
|
51
|
+
nodeOptions.cert = cert;
|
|
52
|
+
}
|
|
53
|
+
if (key) {
|
|
54
|
+
nodeOptions.key = key;
|
|
55
|
+
}
|
|
56
|
+
if (https) {
|
|
57
|
+
nodeOptions.rejectUnauthorized = false;
|
|
58
|
+
}
|
|
59
|
+
return nodeOptions;
|
|
60
|
+
};
|
|
61
|
+
HttpConnection.prototype.addCookieHandler = function () {
|
|
62
|
+
var _this = this;
|
|
63
|
+
var responseCallback = this.connection.responseCallback;
|
|
64
|
+
this.connection.responseCallback = function (response) {
|
|
65
|
+
if (Array.isArray(response.headers['set-cookie'])) {
|
|
66
|
+
var cookie = [_this.connection.nodeOptions.headers['cookie']];
|
|
67
|
+
_this.connection.nodeOptions.headers['cookie'] = cookie.concat(response.headers['set-cookie'])
|
|
68
|
+
.filter(Boolean)
|
|
69
|
+
.join(';');
|
|
70
|
+
}
|
|
71
|
+
responseCallback.call(_this.connection, response);
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
return HttpConnection;
|
|
75
|
+
}());
|
|
76
|
+
exports.default = HttpConnection;
|
|
77
|
+
//# sourceMappingURL=HttpConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpConnection.js","sourceRoot":"","sources":["../../../lib/connection/connections/HttpConnection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAMjC,8EAAwD;AAUxD;IAAA;QACY,WAAM,GAAQ,MAAM,CAAC;IA2EjC,CAAC;IAxEG,gCAAO,GAAP,UAAQ,OAA2B,EAAE,YAA6B;QAAlE,iBAsBC;;QArBG,IAAM,aAAa,GAAG,IAAI,uBAAa,qBACnC,SAAS,EAAE,MAAM,CAAC,kBAAkB,EACpC,QAAQ,EAAE,MAAM,CAAC,eAAe,IAC7B,OAAO,CAAC,OAAO,KAClB,WAAW,wBACJ,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,GAC1C,CAAC,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,WAAW,KAAI,EAAE,CAAC,KAE7C,CAAA;QAEF,OAAO,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC;YACjD,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,MAAM,CAAC,oBAAoB,CAC9C,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,aAAa,CAAC,UAAU,EAAE,CAC7B,CAAC;YAEF,KAAI,CAAC,gBAAgB,EAAE,CAAC;YAExB,OAAO,KAAI,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,sCAAa,GAAb;QACI,OAAO,IAAI,CAAC,UAAU,CAAC;IAC9B,CAAC;IAED,oCAAW,GAAX;QACC,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,IAAI,CAAC;SACZ;aAAM;YACN,OAAO,KAAK,CAAC;SACb;IACF,CAAC;IAEU,uCAAc,GAAtB,UAAuB,OAAgB;QAC3B,IAAA,EAAE,GAAuB,OAAO,GAA9B,EAAE,IAAI,GAAiB,OAAO,KAAxB,EAAE,GAAG,GAAY,OAAO,IAAnB,EAAE,KAAK,GAAK,OAAO,MAAZ,CAAa;QACzC,IAAM,WAAW,GAAgB,EAAE,CAAC;QAEpC,IAAI,EAAE,EAAE;YACJ,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC;SACvB;QACD,IAAI,IAAI,EAAE;YACN,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;SAC3B;QACD,IAAI,GAAG,EAAE;YACL,WAAW,CAAC,GAAG,GAAG,GAAG,CAAC;SACzB;QAED,IAAI,KAAK,EAAE;YACP,WAAW,CAAC,kBAAkB,GAAG,KAAK,CAAC;SAC1C;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAEO,yCAAgB,GAAxB;QAAA,iBAcC;QAbG,IAAM,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QAE1D,IAAI,CAAC,UAAU,CAAC,gBAAgB,GAAG,UAAC,QAAyB;YACzD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE;gBAC/C,IAAI,MAAM,GAAG,CAAC,KAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAE7D,KAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;qBACxF,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,GAAG,CAAC,CAAC;aAClB;YAED,gBAAgB,CAAC,IAAI,CAAC,KAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACrD,CAAC,CAAC;IACN,CAAC;IACL,qBAAC;AAAD,CAAC,AA5ED,IA4EC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAuthentication.js","sourceRoot":"","sources":["../../../lib/connection/contracts/IAuthentication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare type Options = {
|
|
3
|
+
username?: string;
|
|
4
|
+
password?: string;
|
|
5
|
+
ssl?: boolean;
|
|
6
|
+
https?: boolean;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
max_attempts?: number;
|
|
9
|
+
retry_max_delay?: number;
|
|
10
|
+
connect_timeout?: number;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
headers?: object;
|
|
13
|
+
path?: string;
|
|
14
|
+
ca?: Buffer | string;
|
|
15
|
+
cert?: Buffer | string;
|
|
16
|
+
key?: Buffer | string;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
export default interface IConnectionOptions {
|
|
20
|
+
host: string;
|
|
21
|
+
port: number;
|
|
22
|
+
options?: Options;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConnectionOptions.js","sourceRoot":"","sources":["../../../lib/connection/contracts/IConnectionOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import IConnectionOptions from './IConnectionOptions';
|
|
2
|
+
import IAuthentication from './IAuthentication';
|
|
3
|
+
import IThriftConnection from './IThriftConnection';
|
|
4
|
+
export default interface IConnectionProvider {
|
|
5
|
+
connect(options: IConnectionOptions, authProvider: IAuthentication): Promise<IThriftConnection>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConnectionProvider.js","sourceRoot":"","sources":["../../../lib/connection/contracts/IConnectionProvider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IThriftConnection.js","sourceRoot":"","sources":["../../../lib/connection/contracts/IThriftConnection.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare type ThriftConnection = any;
|
|
3
|
+
export default interface ITransport {
|
|
4
|
+
getTransport(): any;
|
|
5
|
+
setOptions(option: string, value: any): void;
|
|
6
|
+
getOptions(): object;
|
|
7
|
+
connect(): any;
|
|
8
|
+
addListener(eventName: string, listener: Function): void;
|
|
9
|
+
removeListener(eventName: string, listener: Function): void;
|
|
10
|
+
emit(eventName: string): void;
|
|
11
|
+
write(data: Buffer | String): void;
|
|
12
|
+
end(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITransport.js","sourceRoot":"","sources":["../../../lib/connection/contracts/ITransport.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ITransport from "../contracts/ITransport";
|
|
2
|
+
export default class HttpTransport implements ITransport {
|
|
3
|
+
private httpOptions;
|
|
4
|
+
constructor(httpOptions?: object);
|
|
5
|
+
getTransport(): any;
|
|
6
|
+
setOptions(option: string, value: any): void;
|
|
7
|
+
getOptions(): object;
|
|
8
|
+
connect(): void;
|
|
9
|
+
addListener(): void;
|
|
10
|
+
removeListener(): void;
|
|
11
|
+
write(): void;
|
|
12
|
+
end(): void;
|
|
13
|
+
emit(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var HttpTransport = /** @class */ (function () {
|
|
15
|
+
function HttpTransport(httpOptions) {
|
|
16
|
+
if (httpOptions === void 0) { httpOptions = {}; }
|
|
17
|
+
this.httpOptions = httpOptions;
|
|
18
|
+
}
|
|
19
|
+
HttpTransport.prototype.getTransport = function () {
|
|
20
|
+
return this.httpOptions;
|
|
21
|
+
};
|
|
22
|
+
HttpTransport.prototype.setOptions = function (option, value) {
|
|
23
|
+
var _a;
|
|
24
|
+
this.httpOptions = __assign(__assign({}, this.httpOptions), (_a = {}, _a[option] = value, _a));
|
|
25
|
+
};
|
|
26
|
+
HttpTransport.prototype.getOptions = function () {
|
|
27
|
+
return this.httpOptions;
|
|
28
|
+
};
|
|
29
|
+
HttpTransport.prototype.connect = function () { };
|
|
30
|
+
;
|
|
31
|
+
HttpTransport.prototype.addListener = function () { };
|
|
32
|
+
HttpTransport.prototype.removeListener = function () { };
|
|
33
|
+
HttpTransport.prototype.write = function () { };
|
|
34
|
+
HttpTransport.prototype.end = function () { };
|
|
35
|
+
HttpTransport.prototype.emit = function () { };
|
|
36
|
+
return HttpTransport;
|
|
37
|
+
}());
|
|
38
|
+
exports.default = HttpTransport;
|
|
39
|
+
//# sourceMappingURL=HttpTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpTransport.js","sourceRoot":"","sources":["../../../lib/connection/transports/HttpTransport.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA;IAGI,uBAAY,WAAwB;QAAxB,4BAAA,EAAA,gBAAwB;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED,oCAAY,GAAZ;QACI,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,kCAAU,GAAV,UAAW,MAAc,EAAE,KAAU;;QACjC,IAAI,CAAC,WAAW,yBACT,IAAI,CAAC,WAAW,gBAClB,MAAM,IAAG,KAAK,MAClB,CAAC;IACN,CAAC;IAED,kCAAU,GAAV;QACI,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,+BAAO,GAAP,cAAW,CAAC;IAAA,CAAC;IACb,mCAAW,GAAX,cAAe,CAAC;IAChB,sCAAc,GAAd,cAAkB,CAAC;IACnB,6BAAK,GAAL,cAAS,CAAC;IACV,2BAAG,GAAH,cAAO,CAAC;IACR,4BAAI,GAAJ,cAAQ,CAAC;IACb,oBAAC;AAAD,CAAC,AA5BD,IA4BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthOptions.js","sourceRoot":"","sources":["../../../lib/connection/types/AuthOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import IHiveSession from "./IHiveSession";
|
|
2
|
+
import { OpenSessionRequest } from "../hive/Commands/OpenSessionCommand";
|
|
3
|
+
import IConnectionOptions from "../connection/contracts/IConnectionOptions";
|
|
4
|
+
import IConnectionProvider from "../connection/contracts/IConnectionProvider";
|
|
5
|
+
import IAuthentication from "../connection/contracts/IAuthentication";
|
|
6
|
+
export default interface IHiveClient {
|
|
7
|
+
connect(options: IConnectionOptions, connectionProvider: IConnectionProvider, authProvider: IAuthentication): Promise<IHiveClient>;
|
|
8
|
+
openSession(request: OpenSessionRequest): Promise<IHiveSession>;
|
|
9
|
+
close(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHiveClient.js","sourceRoot":"","sources":["../../lib/contracts/IHiveClient.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import IOperation from "./IOperation";
|
|
3
|
+
import Status from "../dto/Status";
|
|
4
|
+
import InfoValue from "../dto/InfoValue";
|
|
5
|
+
export declare type CrossReferenceRequest = {
|
|
6
|
+
parentCatalogName: string;
|
|
7
|
+
parentSchemaName: string;
|
|
8
|
+
parentTableName: string;
|
|
9
|
+
foreignCatalogName: string;
|
|
10
|
+
foreignSchemaName: string;
|
|
11
|
+
foreignTableName: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type ExecuteStatementOptions = {
|
|
14
|
+
runAsync?: boolean;
|
|
15
|
+
confOverlay?: Map<string, string>;
|
|
16
|
+
queryTimeout?: Buffer;
|
|
17
|
+
};
|
|
18
|
+
export declare type SchemasRequest = {
|
|
19
|
+
schemaName?: string;
|
|
20
|
+
catalogName?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare type TablesRequest = {
|
|
23
|
+
catalogName?: string;
|
|
24
|
+
schemaName?: string;
|
|
25
|
+
tableName?: string;
|
|
26
|
+
tableTypes?: Array<string>;
|
|
27
|
+
};
|
|
28
|
+
export declare type ColumnRequest = {
|
|
29
|
+
catalogName?: string;
|
|
30
|
+
schemaName?: string;
|
|
31
|
+
tableName?: string;
|
|
32
|
+
columnName?: string;
|
|
33
|
+
};
|
|
34
|
+
export declare type FunctionNameRequest = {
|
|
35
|
+
functionName: string;
|
|
36
|
+
catalogName?: string;
|
|
37
|
+
schemaName?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare type PrimaryKeysRequest = {
|
|
40
|
+
schemaName: string;
|
|
41
|
+
tableName: string;
|
|
42
|
+
catalogName?: string;
|
|
43
|
+
};
|
|
44
|
+
export default interface IHiveSession {
|
|
45
|
+
/**
|
|
46
|
+
* Returns general information about the data source
|
|
47
|
+
*
|
|
48
|
+
* @param infoType one of the values TCLIService_types.TGetInfoType
|
|
49
|
+
*/
|
|
50
|
+
getInfo(infoType: number): Promise<InfoValue>;
|
|
51
|
+
/**
|
|
52
|
+
* Executes DDL/DML statements
|
|
53
|
+
*
|
|
54
|
+
* @param statement DDL/DML statement
|
|
55
|
+
* @param options
|
|
56
|
+
*/
|
|
57
|
+
executeStatement(statement: string, options?: ExecuteStatementOptions): Promise<IOperation>;
|
|
58
|
+
/**
|
|
59
|
+
* Informataion about supported data types
|
|
60
|
+
*/
|
|
61
|
+
getTypeInfo(): Promise<IOperation>;
|
|
62
|
+
/**
|
|
63
|
+
* Get list of catalogs
|
|
64
|
+
*/
|
|
65
|
+
getCatalogs(): Promise<IOperation>;
|
|
66
|
+
/**
|
|
67
|
+
* Get list of databases
|
|
68
|
+
*
|
|
69
|
+
* @param request
|
|
70
|
+
*/
|
|
71
|
+
getSchemas(request: SchemasRequest): Promise<IOperation>;
|
|
72
|
+
/**
|
|
73
|
+
* Get list of tables
|
|
74
|
+
*
|
|
75
|
+
* @param request
|
|
76
|
+
*/
|
|
77
|
+
getTables(request: TablesRequest): Promise<IOperation>;
|
|
78
|
+
/**
|
|
79
|
+
* Get list of supported table types
|
|
80
|
+
*/
|
|
81
|
+
getTableTypes(): Promise<IOperation>;
|
|
82
|
+
/**
|
|
83
|
+
* Get full information about columns of the table
|
|
84
|
+
*
|
|
85
|
+
* @param request
|
|
86
|
+
*/
|
|
87
|
+
getColumns(request: ColumnRequest): Promise<IOperation>;
|
|
88
|
+
/**
|
|
89
|
+
* Get information about function
|
|
90
|
+
*
|
|
91
|
+
* @param request
|
|
92
|
+
*/
|
|
93
|
+
getFunctions(request: FunctionNameRequest): Promise<IOperation>;
|
|
94
|
+
/**
|
|
95
|
+
* Get primary keys of table
|
|
96
|
+
*
|
|
97
|
+
* @param request
|
|
98
|
+
*/
|
|
99
|
+
getPrimaryKeys(request: PrimaryKeysRequest): Promise<IOperation>;
|
|
100
|
+
/**
|
|
101
|
+
* Request information about foreign keys between two tables
|
|
102
|
+
* @param request
|
|
103
|
+
*/
|
|
104
|
+
getCrossReference(request: CrossReferenceRequest): Promise<IOperation>;
|
|
105
|
+
/**
|
|
106
|
+
* Get delegation token. For kerberos auth only
|
|
107
|
+
*
|
|
108
|
+
* @param owner
|
|
109
|
+
* @param renewer
|
|
110
|
+
*/
|
|
111
|
+
getDelegationToken(owner: string, renewer: string): Promise<string>;
|
|
112
|
+
/**
|
|
113
|
+
* Renew delegation token/ For kerberos auth only
|
|
114
|
+
* @param token
|
|
115
|
+
*/
|
|
116
|
+
renewDelegationToken(token: string): Promise<Status>;
|
|
117
|
+
/**
|
|
118
|
+
* Cancel delegation token. For kerberos auth only
|
|
119
|
+
* @param token
|
|
120
|
+
*/
|
|
121
|
+
cancelDelegationToken(token: string): Promise<Status>;
|
|
122
|
+
/**
|
|
123
|
+
* closes the session
|
|
124
|
+
*/
|
|
125
|
+
close(): Promise<Status>;
|
|
126
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHiveSession.js","sourceRoot":"","sources":["../../lib/contracts/IHiveSession.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GetOperationStatusResponse } from "../hive/Commands/GetOperationStatusCommand";
|
|
2
|
+
import Status from "../dto/Status";
|
|
3
|
+
import { TableSchema, RowSet } from "../hive/Types";
|
|
4
|
+
export default interface IOperation {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch schema and a portion of data
|
|
7
|
+
*/
|
|
8
|
+
fetch(): Promise<Status>;
|
|
9
|
+
/**
|
|
10
|
+
* Request status of operation
|
|
11
|
+
*
|
|
12
|
+
* @param progress
|
|
13
|
+
*/
|
|
14
|
+
status(progress: boolean): Promise<GetOperationStatusResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Cancel operation
|
|
17
|
+
*/
|
|
18
|
+
cancel(): Promise<Status>;
|
|
19
|
+
/**
|
|
20
|
+
* Close operation
|
|
21
|
+
*/
|
|
22
|
+
close(): Promise<Status>;
|
|
23
|
+
/**
|
|
24
|
+
* Check if operation is finished
|
|
25
|
+
*/
|
|
26
|
+
finished(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Check if operation hasMoreRows
|
|
29
|
+
*/
|
|
30
|
+
hasMoreRows(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Set the max fetch size
|
|
33
|
+
*/
|
|
34
|
+
setMaxRows(maxRows: number): void;
|
|
35
|
+
/**
|
|
36
|
+
* Return retrieved schema
|
|
37
|
+
*/
|
|
38
|
+
getSchema(): TableSchema | null;
|
|
39
|
+
/**
|
|
40
|
+
* Return retrieved data
|
|
41
|
+
*/
|
|
42
|
+
getData(): Array<RowSet>;
|
|
43
|
+
/**
|
|
44
|
+
* Request queryId
|
|
45
|
+
*/
|
|
46
|
+
getQueryId(): Promise<string>;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOperation.js","sourceRoot":"","sources":["../../lib/contracts/IOperation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { GetInfoValue } from "../hive/Types";
|
|
3
|
+
declare type InfoResultType = string | number | Buffer | null;
|
|
4
|
+
export default class InfoValue {
|
|
5
|
+
private value;
|
|
6
|
+
constructor(value: GetInfoValue);
|
|
7
|
+
getValue(): InfoResultType;
|
|
8
|
+
}
|
|
9
|
+
export {};
|