Comparing version 0.20.5 to 0.20.6
@@ -26,11 +26,15 @@ /*! | ||
} | ||
export declare class FetchConnection extends BaseRawConnection { | ||
private config; | ||
private addr; | ||
declare class BaseFetchConnection extends BaseRawConnection { | ||
protected config: FetchConfig; | ||
protected addr: string; | ||
constructor(config: FetchConfig, registry: CodecsRegistry); | ||
protected _buildAddr(): string; | ||
protected _waitForMessage(): Promise<void>; | ||
protected __sendData(data: Buffer): Promise<void>; | ||
protected _sendData(data: Buffer): void; | ||
static create(config: FetchConfig, registry: CodecsRegistry): FetchConnection; | ||
static create(config: FetchConfig, registry: CodecsRegistry): BaseFetchConnection; | ||
} | ||
export declare class AdminFetchConnection extends BaseFetchConnection { | ||
protected _buildAddr(): string; | ||
} | ||
export {}; |
@@ -42,3 +42,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FetchConnection = void 0; | ||
exports.AdminFetchConnection = void 0; | ||
const baseConn_1 = require("./baseConn"); | ||
@@ -50,3 +50,4 @@ const event_1 = __importDefault(require("./primitives/event")); | ||
} | ||
class FetchConnection extends baseConn_1.BaseRawConnection { | ||
const PROTO_MIME = (`application/x.edgedb.v_${baseConn_1.PROTO_VER[0]}_${baseConn_1.PROTO_VER[1]}.binary'`); | ||
class BaseFetchConnection extends baseConn_1.BaseRawConnection { | ||
constructor(config, registry) { | ||
@@ -67,5 +68,7 @@ super(registry); | ||
this.config = config; | ||
this.addr = `${typeof this.config.address === "string" ? | ||
config.address : `http://${config.address[0]}:${config.address[1]}`}/admin/protocol/${config.database}`; | ||
this.addr = this._buildAddr(); | ||
} | ||
_buildAddr() { | ||
this.throwNotImplemented('_buildAddr'); | ||
} | ||
async _waitForMessage() { | ||
@@ -94,3 +97,3 @@ if (this.buffer.takeMessage()) { | ||
body: data, | ||
headers: { "Content-Type": "application/x.edgedb" }, | ||
headers: { "Content-Type": PROTO_MIME }, | ||
}); | ||
@@ -125,3 +128,3 @@ if (!resp.ok) { | ||
static create(config, registry) { | ||
const conn = new FetchConnection(config, registry); | ||
const conn = new this(config, registry); | ||
conn.connected = true; | ||
@@ -132,2 +135,9 @@ conn.alwaysUseOptimisticFlow = true; | ||
} | ||
exports.FetchConnection = FetchConnection; | ||
class AdminFetchConnection extends BaseFetchConnection { | ||
_buildAddr() { | ||
const config = this.config; | ||
return `${typeof config.address === "string" ? | ||
config.address : `http://${config.address[0]}:${config.address[1]}`}/db/${config.database}/admin_binary_http`; | ||
} | ||
} | ||
exports.AdminFetchConnection = AdminFetchConnection; |
@@ -30,2 +30,2 @@ /*! | ||
export declare const _plugJSBI: typeof plugJSBI; | ||
export declare const _edgedbJsVersion = "0.20.5"; | ||
export declare const _edgedbJsVersion = "0.20.6"; |
@@ -58,2 +58,2 @@ "use strict"; | ||
exports._plugJSBI = bigint_1.plugJSBI; | ||
exports._edgedbJsVersion = "0.20.5"; | ||
exports._edgedbJsVersion = "0.20.6"; |
{ | ||
"name": "edgedb", | ||
"version": "0.20.5", | ||
"version": "0.20.6", | ||
"description": "The official Node.js client library for EdgeDB", | ||
@@ -5,0 +5,0 @@ "homepage": "https://edgedb.com/docs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
998826
25488