/
index.ts
46 lines (40 loc) · 877 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import weaviate, {
AuthClientCredentials,
AuthUserPasswordCredentials,
ApiKey,
AuthAccessTokenCredentials,
generateUuid5,
} from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
console.log(
JSON.stringify(
new AuthAccessTokenCredentials({
accessToken: 'token123',
expiresIn: 123,
})
)
);
console.log(
JSON.stringify(
new AuthUserPasswordCredentials({
username: 'user123',
password: 'password',
})
)
);
console.log(
JSON.stringify(
new AuthClientCredentials({
clientSecret: 'secret123',
})
)
);
console.log(JSON.stringify(new ApiKey('abcd1234')));
console.log(generateUuid5('55dfccce-0142-4807-a1ff-60be9b38f5cc', 'the-best-namespace'));
client.misc
.metaGetter()
.do()
.then((res: any) => console.log(`res: ${JSON.stringify(res)}`));