Skip to content

Commit

Permalink
Merge pull request #129 from tigrisdata/main
Browse files Browse the repository at this point in the history
Beta release
  • Loading branch information
adilansari authored Oct 18, 2022
2 parents 87a0cf5 + 5a74245 commit 09d3809
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- name: Release dry run
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --debug --dryRun
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ jobs:
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --debug
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tigrisdata/core",
"version": "1.0.0-beta.9",
"version": "1.0.0-beta.10",
"description": "Tigris client for Typescript",
"author": "Tigris Data (https://www.tigrisdata.com/)",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/consumables/cursor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("class FindCursor", () => {
}
}
);
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
db = tigris.getDatabase("db3");
done();
});
Expand Down
78 changes: 39 additions & 39 deletions src/__tests__/tigris.rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe("rpc tests", () => {
});

it("listDatabase", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const listDbsPromise = tigris.listDatabases();
listDbsPromise
.then((value) => {
Expand All @@ -71,7 +71,7 @@ describe("rpc tests", () => {
});

it("createDatabaseIfNotExists", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const dbCreationPromise = tigris.createDatabaseIfNotExists("db6", new DatabaseOptions());
dbCreationPromise
.then((value) => {
Expand All @@ -83,7 +83,7 @@ describe("rpc tests", () => {
});

it("dropDatabase", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const dbDropPromise = tigris.dropDatabase("db6", new DatabaseOptions());
dbDropPromise
.then((value) => {
Expand All @@ -95,13 +95,13 @@ describe("rpc tests", () => {
});

it("getDatabase", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db1");
expect(db1.db).toBe("db1");
});

it("listCollections1", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db1");

const listCollectionPromise = db1.listCollections();
Expand All @@ -117,7 +117,7 @@ describe("rpc tests", () => {
});

it("listCollections2", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");

const listCollectionPromise = db1.listCollections();
Expand All @@ -133,7 +133,7 @@ describe("rpc tests", () => {
});

it("describeDatabase", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");

const databaseDescriptionPromise = db1.describe();
Expand All @@ -150,7 +150,7 @@ describe("rpc tests", () => {
});

it("dropCollection", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");

const dropCollectionPromise = db1.dropCollection("db3_coll_2");
Expand All @@ -162,14 +162,14 @@ describe("rpc tests", () => {
});

it("getCollection", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const books = db1.getCollection<IBook>("books");
expect(books.collectionName).toBe("books");
});

it("insert", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const insertionPromise = db1.getCollection<IBook>("books").insertOne({
author: "author name",
Expand All @@ -184,7 +184,7 @@ describe("rpc tests", () => {
});

it("insert2", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const insertionPromise = db1.getCollection<IBook2>("books").insertOne({
id: 0,
Expand All @@ -201,7 +201,7 @@ describe("rpc tests", () => {
});

it("insertWithOptionalField", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const randomNumber: number = Math.floor(Math.random() * 100);
// pass the random number in author field. mock server reads author and sets as the
Expand All @@ -218,7 +218,7 @@ describe("rpc tests", () => {
});

it("insertOrReplace", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const insertOrReplacePromise = db1.getCollection<IBook>("books").insertOrReplaceOne({
author: "author name",
Expand All @@ -233,7 +233,7 @@ describe("rpc tests", () => {
});

it("insertOrReplaceWithOptionalField", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const randomNumber: number = Math.floor(Math.random() * 100);
// pass the random number in author field. mock server reads author and sets as the
Expand All @@ -250,7 +250,7 @@ describe("rpc tests", () => {
});

it("delete", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const deletionPromise = db1.getCollection<IBook>("books").deleteMany({
op: SelectorFilterOperator.EQ,
Expand All @@ -265,7 +265,7 @@ describe("rpc tests", () => {
});

it("deleteOne", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const collection = tigris.getDatabase("db3").getCollection<IBook>("books");
const spyCollection = spy(collection);

Expand All @@ -289,7 +289,7 @@ describe("rpc tests", () => {
});

it("update", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const updatePromise = db1.getCollection<IBook>("books").updateMany(
{
Expand All @@ -312,7 +312,7 @@ describe("rpc tests", () => {
});

it("updateOne", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const collection = tigris.getDatabase("db3").getCollection<IBook>("books");
const spyCollection = spy(collection);

Expand All @@ -339,7 +339,7 @@ describe("rpc tests", () => {
});

it("readOne", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const readOnePromise = db1.getCollection<IBook>("books").findOne( {
op: SelectorFilterOperator.EQ,
Expand All @@ -358,7 +358,7 @@ describe("rpc tests", () => {
});

it("readOneRecordNotFound", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const readOnePromise = db1.getCollection<IBook>("books").findOne({
op: SelectorFilterOperator.EQ,
Expand All @@ -373,7 +373,7 @@ describe("rpc tests", () => {
});

it("readOneWithLogicalFilter", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db1 = tigris.getDatabase("db3");
const readOnePromise: Promise<IBook | void> = db1.getCollection<IBook>("books").findOne({
op: LogicalOperator.AND,
Expand Down Expand Up @@ -403,7 +403,7 @@ describe("rpc tests", () => {
});

describe("findMany", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("db3");

it("with filter using for await on cursor", async () => {
Expand Down Expand Up @@ -462,7 +462,7 @@ describe("rpc tests", () => {
});

it("search", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const options: SearchRequestOptions = {
page: 2,
Expand All @@ -488,7 +488,7 @@ describe("rpc tests", () => {
});

it("searchStream using iteration", async () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const request: SearchRequest<IBook> = {
q: "philosophy",
Expand All @@ -509,7 +509,7 @@ describe("rpc tests", () => {
});

it("searchStream using next", async () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const request: SearchRequest<IBook> = {
q: "philosophy",
Expand All @@ -532,7 +532,7 @@ describe("rpc tests", () => {
});

it("beginTx", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const beginTxPromise = db3.beginTransaction();
beginTxPromise.then(value => {
Expand All @@ -543,7 +543,7 @@ describe("rpc tests", () => {
});

it("commitTx", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const beginTxPromise = db3.beginTransaction();
beginTxPromise.then(session => {
Expand All @@ -556,7 +556,7 @@ describe("rpc tests", () => {
});

it("rollbackTx", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const beginTxPromise = db3.beginTransaction();
beginTxPromise.then(session => {
Expand All @@ -569,7 +569,7 @@ describe("rpc tests", () => {
});

it("transact", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const txDB = tigris.getDatabase("test-tx");
const books = txDB.getCollection<IBook>("books");
txDB.transact(tx => {
Expand Down Expand Up @@ -615,7 +615,7 @@ describe("rpc tests", () => {
});

it("createOrUpdateCollections", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db3 = tigris.getDatabase("db3");
const bookSchema: TigrisSchema<IBook> = {
id: {
Expand Down Expand Up @@ -644,7 +644,7 @@ describe("rpc tests", () => {
});

it("createOrUpdateTopic", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const alertSchema: TigrisTopicSchema<Alert> = {
id: {
Expand All @@ -669,7 +669,7 @@ describe("rpc tests", () => {
});

it("serverMetadata", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const serverMetadataPromise = tigris.getServerMetadata();
serverMetadataPromise.then(value => {
expect(value.serverVersion).toBe("1.0.0-test-service");
Expand All @@ -678,7 +678,7 @@ describe("rpc tests", () => {
});

it("events", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const collection = db.getCollection<IBook>("books");
let success = true;
Expand All @@ -705,7 +705,7 @@ describe("rpc tests", () => {
});

it("publish", () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
expect(topic.topicName).toBe("test_topic");
Expand All @@ -724,7 +724,7 @@ describe("rpc tests", () => {
});

it("subscribe using callback", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
let success = true;
Expand All @@ -747,7 +747,7 @@ describe("rpc tests", () => {
});

it("subscribe using stream", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
const subscription: Readable = topic.subscribe() as Readable;
Expand All @@ -768,7 +768,7 @@ describe("rpc tests", () => {
});

it("subscribeWithFilter", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
let success = true;
Expand Down Expand Up @@ -797,7 +797,7 @@ describe("rpc tests", () => {
});

it("subscribeToPartitions", (done) => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
let success = true;
Expand All @@ -823,7 +823,7 @@ describe("rpc tests", () => {
});

it("findMany in topic", async () => {
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT, insecureChannel: true});
const tigris = new Tigris({serverUrl: "0.0.0.0:" + SERVER_PORT});
const db = tigris.getDatabase("test_db");
const topic = db.getTopic<Alert>("test_topic");
const expectedIds = new Set<number>(TestTigrisService.ALERTS_B64_BY_ID.keys());
Expand Down
Loading

0 comments on commit 09d3809

Please sign in to comment.