Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ferrum-db-client

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ferrum-db-client - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

8

dist/index.d.ts

@@ -5,4 +5,7 @@ import { FerrumDBRemote } from './db_remote';

export { SetRemote } from './set_remote';
export declare function ferrumConnect(ip: string, port: number): Promise<FerrumServerConnection>;
export declare class FerrumServerConnection {
export { TimeSeriesRemote } from './time_series_remote';
export { SupportedCompressionTypes, SupportedEncodingTypes } from './util';
export declare function ferrumConnect(ip: string, port: number): Promise<FerrumServerClient>;
export { CollectionType } from './proto/collection_pb';
export declare class FerrumServerClient {
private ip;

@@ -14,2 +17,3 @@ private port;

createDatabase(dbName: string): Promise<FerrumDBRemote>;
getDatabase(dbName: string): Promise<FerrumDBRemote>;
hasDatabase(dbName: string): Promise<boolean>;

@@ -16,0 +20,0 @@ dropDatabase(dbName: string): Promise<void>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FerrumServerConnection = exports.ferrumConnect = exports.SetRemote = exports.IndexRemote = exports.FerrumDBRemote = void 0;
exports.FerrumServerClient = exports.CollectionType = exports.ferrumConnect = exports.TimeSeriesRemote = exports.SetRemote = exports.IndexRemote = exports.FerrumDBRemote = void 0;
const grpc_js_1 = require("@grpc/grpc-js");

@@ -16,8 +16,12 @@ const db_remote_1 = require("./db_remote");

Object.defineProperty(exports, "SetRemote", { enumerable: true, get: function () { return set_remote_1.SetRemote; } });
var time_series_remote_1 = require("./time_series_remote");
Object.defineProperty(exports, "TimeSeriesRemote", { enumerable: true, get: function () { return time_series_remote_1.TimeSeriesRemote; } });
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
async function ferrumConnect(ip, port) {
return new FerrumServerConnection(ip, port);
return new FerrumServerClient(ip, port);
}
exports.ferrumConnect = ferrumConnect;
class FerrumServerConnection {
var collection_pb_1 = require("./proto/collection_pb");
Object.defineProperty(exports, "CollectionType", { enumerable: true, get: function () { return collection_pb_1.CollectionType; } });
class FerrumServerClient {
constructor(ip, port) {

@@ -46,2 +50,9 @@ this.ip = ip;

}
async getDatabase(dbName) {
const has = await this.hasDatabase(dbName);
if (!has) {
throw new Error(`Database ${dbName} does not exist`);
}
return new db_remote_1.FerrumDBRemote(this.ip, this.port, dbName);
}
async hasDatabase(dbName) {

@@ -81,3 +92,3 @@ const msg = new database_server_pb_1.CreateDatabaseRequest();

}
exports.FerrumServerConnection = FerrumServerConnection;
exports.FerrumServerClient = FerrumServerClient;
//# sourceMappingURL=index.js.map
{
"name": "ferrum-db-client",
"version": "0.3.0",
"version": "0.3.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts",

@@ -11,9 +11,13 @@ import { ChannelCredentials } from '@grpc/grpc-js';

export { SetRemote } from './set_remote';
export { TimeSeriesRemote } from './time_series_remote';
export { SupportedCompressionTypes, SupportedEncodingTypes } from './util';
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
export async function ferrumConnect(ip: string, port: number): Promise<FerrumServerConnection> {
return new FerrumServerConnection(ip, port);
export async function ferrumConnect(ip: string, port: number): Promise<FerrumServerClient> {
return new FerrumServerClient(ip, port);
}
export class FerrumServerConnection {
export { CollectionType } from './proto/collection_pb';
export class FerrumServerClient {
private ip: string;

@@ -61,2 +65,11 @@ private port: number;

public async getDatabase(dbName: string): Promise<FerrumDBRemote> {
const has = await this.hasDatabase(dbName);
if (!has) {
throw new Error(`Database ${dbName} does not exist`);
}
return new FerrumDBRemote(this.ip, this.port, dbName);
}
public async hasDatabase(dbName: string): Promise<boolean> {

@@ -63,0 +76,0 @@ const msg = new CreateDatabaseRequest();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc