This is an automated email from the ASF dual-hosted git repository.
colegreer pushed a commit to branch js-http
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/js-http by this push:
new 4cf9a5a66e minor tweaks
4cf9a5a66e is described below
commit 4cf9a5a66ebca095662d801deb7e3d8ea4f6882d
Author: Cole Greer <[email protected]>
AuthorDate: Sun Mar 1 22:02:58 2026 -0800
minor tweaks
---
.../main/javascript/gremlin-javascript/lib/driver/client.ts | 1 -
.../javascript/gremlin-javascript/lib/driver/connection.ts | 11 +++++++----
.../gremlin-javascript/test/integration/client-tests.js | 2 +-
.../test/integration/remote-connection-tests.js | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
index f9b39f5ef4..943c47d45b 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.ts
@@ -102,7 +102,6 @@ export default class Client {
* @param {RequestOptions} [requestOptions] Configuration specific to the
current request.
* @returns {Promise}
*/ //TODO:: tighten return type to Promise<ResultSet>
- //TODO:: Remove bytecode as allowable message type
submit(message: string, bindings: any | null, requestOptions?:
RequestOptions): Promise<any> {
const requestBuilder = RequestMessage.build(message)
.addG(this.options.traversalSource || 'g')
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
index 90fb942b82..27fb0ade50 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/connection.ts
@@ -121,7 +121,7 @@ export default class Connection extends EventEmitter {
/** @override */
submit(request: RequestMessage) {
- const request_buf = this._writer.writeRequest(request);
+ const request_buf: Buffer = this._writer.writeRequest(request);
return this.#makeHttpRequest(request_buf)
.then((response) => {
@@ -188,12 +188,15 @@ export default class Connection extends EventEmitter {
headers[key] = Array.isArray(value) ? value.join(', ') : value;
});
}
-
- return fetch(this.url, {
+ let request = {
method: 'POST',
headers,
body: request_buf,
- });
+ }
+
+ // TODO:: add request interceptors
+
+ return fetch(this.url, request);
}
async #handleResponse(response: Response) {
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/client-tests.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/client-tests.js
index db9208770c..c050f37d7e 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/client-tests.js
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/client-tests.js
@@ -51,7 +51,7 @@ describe('Client', function () {
});
});
it('should send and parse a script with non-native javascript bindings',
function () {
- return client.submit('card.class.simpleName + ":" + card', { card:
cardinality.set } )
+ return client.submit('card.class.simpleName + ":" + card', { card:
cardinality.set })
.then(function (result) {
assert.ok(result);
assert.strictEqual(result.first(), 'Cardinality:set');
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
index 5d4da82e8c..6376dbe5a9 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js
@@ -39,7 +39,7 @@ describe('DriverRemoteConnection', function () {
describe('#submit()', function () {
it('should send the request and parse the response', function () {
- return connection.submit(new Bytecode().addStep('V', []).addStep('tail',
[]))
+ return connection.submit('g.V().tail()')
.then(function (response) {
assert.ok(response);
assert.ok(response.traversers);
@@ -48,7 +48,7 @@ describe('DriverRemoteConnection', function () {
});
});
it('should send the request with syntax error and parse the response
error', function () {
- return connection.submit(new Bytecode().addStep('SYNTAX_ERROR'))
+ return connection.submit('SYNTAX_ERROR')
.catch(function (err) {
assert.ok(err);
assert.ok(err.message.indexOf('599') > 0);