Describe the bug
In the SDK v2.0.3, connecting as a record user via the connect() method works, but the typescript compiler complains:
await db
.connect(url, {
namespace: 'test',
database: 'test',
access: 'anyuser',
variables: {
test: 'test'
},
reconnect: true,
versionCheck: false
})
But the type definition defined here doesn't seem to account for this method of connecting when using the connect() method. Should it not rather be the following?
export type ProvidedAuth = AnyAuth | null;
Steps to reproduce
Try the code written above. The typescript compiler will complain that 'access' does not exist in type RootAuth | NamespaceAuth | DatabaseAuth | AuthCallable.
Expected behaviour
I would like to connect as a record user using the connect() method without typescript complaining.
SurrealDB version
Not relevant in this case, but I'm trying to upgrade to surrealdb version 3.1.2.
JavaScript SDK version
2.0.3
Contact Details
this issue
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)
Describe the bug
In the SDK v2.0.3, connecting as a record user via the
connect()method works, but the typescript compiler complains:But the type definition defined here doesn't seem to account for this method of connecting when using the
connect()method. Should it not rather be the following?Steps to reproduce
Try the code written above. The typescript compiler will complain that 'access' does not exist in type
RootAuth | NamespaceAuth | DatabaseAuth | AuthCallable.Expected behaviour
I would like to connect as a record user using the
connect()method without typescript complaining.SurrealDB version
Not relevant in this case, but I'm trying to upgrade to surrealdb version 3.1.2.
JavaScript SDK version
2.0.3
Contact Details
this issue
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)