Skip to content

Fix re-auth neo4j.driver typescript type #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/neo4j-driver/test/types/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import {
notificationFilterMinimumSeverityLevel,
NotificationFilterMinimumSeverityLevel,
NotificationFilterDisabledCategory,
notificationFilterDisabledCategory
notificationFilterDisabledCategory,
expirationBasedAuthTokenManager
} from '../../types/index'

import Driver from '../../types/driver'
Expand Down Expand Up @@ -87,6 +88,14 @@ const driver4: Driver = driver(
}
)

const driver5: Driver = driver('bolt://localhost:7687', expirationBasedAuthTokenManager({
tokenProvider: async () => {
return {
token: auth.basic('neo4j', 'password')
}
}
}))

const readMode1: string = session.READ
const writeMode1: string = session.WRITE

Expand Down
2 changes: 1 addition & 1 deletion packages/neo4j-driver/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ declare const auth: {

declare function driver (
url: string,
authToken?: AuthToken,
authToken?: AuthToken | AuthTokenManager,
config?: Config
): Driver

Expand Down