Skip to content

Commit 92212e8

Browse files
authored
Merge pull request #207 from weaviate/dev/1.27
Support new `v1.27` features in the `TSv3` client
2 parents e272b37 + aef7fa7 commit 92212e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6862
-1051
lines changed

.github/workflows/main.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ on:
77
pull_request:
88

99
env:
10-
WEAVIATE_124: 1.24.21
11-
WEAVIATE_125: 1.25.8
12-
WEAVIATE_126: 1.26.1
10+
WEAVIATE_124: stable-v1.24-a8b364e
11+
WEAVIATE_125: 1.25.21
12+
WEAVIATE_126: 1.26.7
13+
WEAVIATE_127: 1.27.0
1314

1415
jobs:
1516
checks:
@@ -18,7 +19,7 @@ jobs:
1819
- uses: actions/checkout@v3
1920
- uses: actions/setup-node@v3
2021
with:
21-
node-version: '18.x'
22+
node-version: '22.x'
2223
- name: "Run checks"
2324
run: |
2425
npm ci
@@ -35,9 +36,10 @@ jobs:
3536
versions: [
3637
{ node: "22.x", weaviate: $WEAVIATE_124},
3738
{ node: "22.x", weaviate: $WEAVIATE_125},
38-
{ node: "18.x", weaviate: $WEAVIATE_126},
39-
{ node: "20.x", weaviate: $WEAVIATE_126},
40-
{ node: "22.x", weaviate: $WEAVIATE_126}
39+
{ node: "22.x", weaviate: $WEAVIATE_126},
40+
{ node: "18.x", weaviate: $WEAVIATE_127},
41+
{ node: "20.x", weaviate: $WEAVIATE_127},
42+
{ node: "22.x", weaviate: $WEAVIATE_127}
4143
]
4244
steps:
4345
- uses: actions/checkout@v3
@@ -79,7 +81,7 @@ jobs:
7981
# Setup .npmrc file to publish to npm
8082
- uses: actions/setup-node@v3
8183
with:
82-
node-version: '18.x'
84+
node-version: '22.x'
8385
registry-url: 'https://registry.npmjs.org'
8486
- run: npm ci
8587
- run: npm run build

ci/run_dependencies.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,24 @@ function wait(){
2121

2222
echo "Waiting for $1"
2323
while true; do
24-
if curl -s $1 > /dev/null; then
24+
# first check if weaviate already responds
25+
if ! curl -s $1 > /dev/null; then
26+
continue
27+
fi
28+
29+
# endpoint available, check if it is ready
30+
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$1/v1/.well-known/ready")
31+
32+
if [ "$HTTP_STATUS" -eq 200 ]; then
2533
break
2634
else
27-
if [ $? -eq 7 ]; then
28-
echo "Weaviate is not up yet. (waited for ${ALREADY_WAITING}s)"
29-
if [ $ALREADY_WAITING -gt $MAX_WAIT_SECONDS ]; then
30-
echo "Weaviate did not start up in $MAX_WAIT_SECONDS."
31-
exit 1
32-
else
33-
sleep 2
34-
let ALREADY_WAITING=$ALREADY_WAITING+2
35-
fi
35+
echo "Weaviate is not up yet. (waited for ${ALREADY_WAITING}s)"
36+
if [ $ALREADY_WAITING -gt $MAX_WAIT_SECONDS ]; then
37+
echo "Weaviate did not start up in $MAX_WAIT_SECONDS."
38+
exit 1
39+
else
40+
sleep 2
41+
let ALREADY_WAITING=$ALREADY_WAITING+2
3642
fi
3743
fi
3844
done

src/backup/backupCreateStatusGetter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Connection from '../connection/index.js';
2+
import { WeaviateInvalidInputError } from '../errors.js';
23
import { BackupCreateStatusResponse } from '../openapi/types.js';
34
import { CommandBase } from '../validation/commandBase.js';
45
import { Backend } from './index.js';
@@ -29,7 +30,7 @@ export default class BackupCreateStatusGetter extends CommandBase {
2930
do = (): Promise<BackupCreateStatusResponse> => {
3031
this.validate();
3132
if (this.errors.length > 0) {
32-
return Promise.reject(new Error('invalid usage: ' + this.errors.join(', ')));
33+
return Promise.reject(new WeaviateInvalidInputError('invalid usage: ' + this.errors.join(', ')));
3334
}
3435
return this.client.get(this._path()) as Promise<BackupCreateStatusResponse>;
3536
};

src/backup/backupCreator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Connection from '../connection/index.js';
2+
import { WeaviateInvalidInputError } from '../errors.js';
23
import {
34
BackupConfig,
45
BackupCreateRequest,
@@ -81,7 +82,7 @@ export default class BackupCreator extends CommandBase {
8182
do = (): Promise<BackupCreateResponse> => {
8283
this.validate();
8384
if (this.errors.length > 0) {
84-
return Promise.reject(new Error('invalid usage: ' + this.errors.join(', ')));
85+
return Promise.reject(new WeaviateInvalidInputError('invalid usage: ' + this.errors.join(', ')));
8586
}
8687

8788
const payload = {

src/backup/backupGetter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Connection from '../connection/index.js';
2+
import { WeaviateInvalidInputError } from '../errors.js';
23
import { BackupCreateResponse } from '../openapi/types.js';
34
import { CommandBase } from '../validation/commandBase.js';
45
import { Backend } from './index.js';
@@ -23,7 +24,7 @@ export default class BackupGetter extends CommandBase {
2324
do = (): Promise<BackupCreateResponse[]> => {
2425
this.validate();
2526
if (this.errors.length > 0) {
26-
return Promise.reject(new Error('invalid usage: ' + this.errors.join(', ')));
27+
return Promise.reject(new WeaviateInvalidInputError('invalid usage: ' + this.errors.join(', ')));
2728
}
2829

2930
return this.client.get(this._path());

src/backup/backupRestoreStatusGetter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Connection from '../connection/index.js';
2+
import { WeaviateInvalidInputError } from '../errors.js';
23
import { BackupRestoreStatusResponse } from '../openapi/types.js';
34
import { CommandBase } from '../validation/commandBase.js';
45
import { Backend } from './index.js';
@@ -29,7 +30,7 @@ export default class BackupRestoreStatusGetter extends CommandBase {
2930
do = (): Promise<BackupRestoreStatusResponse> => {
3031
this.validate();
3132
if (this.errors.length > 0) {
32-
return Promise.reject(new Error('invalid usage: ' + this.errors.join(', ')));
33+
return Promise.reject(new WeaviateInvalidInputError('invalid usage: ' + this.errors.join(', ')));
3334
}
3435

3536
return this.client.get(this._path());

src/backup/backupRestorer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Connection from '../connection/index.js';
2+
import { WeaviateInvalidInputError } from '../errors.js';
23
import {
34
BackupRestoreRequest,
45
BackupRestoreResponse,
@@ -81,7 +82,7 @@ export default class BackupRestorer extends CommandBase {
8182
do = (): Promise<BackupRestoreResponse> => {
8283
this.validate();
8384
if (this.errors.length > 0) {
84-
return Promise.reject(new Error('invalid usage: ' + this.errors.join(', ')));
85+
return Promise.reject(new WeaviateInvalidInputError('invalid usage: ' + this.errors.join(', ')));
8586
}
8687

8788
const payload = {

0 commit comments

Comments
 (0)