-
Notifications
You must be signed in to change notification settings - Fork 148
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
Extract NeoDash auth module to an abstract interface to allow for different providers #767
base: develop
Are you sure you want to change the base?
Changes from 1 commit
2869c23
20a154c
ee20346
70361e8
f22745c
200701c
04d52e7
c602292
26ee2e6
6877693
6ca2e4b
e7d7d98
ee8a7de
d7c250b
cbc47b5
efd14e5
50f16e8
0f14d87
4895d8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,34 @@ | |
import { runCypherQuery } from './runCypherQuery'; | ||
import { extractQueryCallbacks, extractQueryParams } from './utils'; | ||
|
||
const notImplementedError = (functionName: string): never => { | ||
throw new Error(`Not Implemented: ${functionName}`); | ||
}; | ||
|
||
export class Neo4jConnectionModule extends ConnectionModule { | ||
constructor(name) { | ||
super(name); | ||
authenticate(_credentials: Record<any, any>): void | never { | ||
return notImplementedError('authenticate'); | ||
} | ||
|
||
authenticate(_credentials: Record<any, any>): void | never {} | ||
|
||
async runQuery(driver, inputQueryParams, inputQuerycallbacks): Promise<void> { | ||
async runQuery(driver, inputQueryParams, inputQueryCallbacks): Promise<void> { | ||
let queryParams = extractQueryParams(inputQueryParams); | ||
let callbacks = extractQueryCallbacks(inputQuerycallbacks); | ||
let callbacks = extractQueryCallbacks(inputQueryCallbacks); | ||
return runCypherQuery({ driver, ...queryParams, ...callbacks }); | ||
} | ||
|
||
loadDashboard(_id: string): any | never {} | ||
loadDashboard(_id: string): any | never { | ||
return notImplementedError('loadDashboard'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we including dashboards CRUD operations in the current scope or not yet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we should, but let's focus first on migrating the format of the records, i think that's more urgent. In the current release we should just create the base for the next releases. |
||
} | ||
|
||
saveDashboard(_dashboard: any): boolean | never { | ||
return true; | ||
return notImplementedError('saveDashboard'); | ||
} | ||
|
||
deleteDashboard(_id: string): void | never {} | ||
deleteDashboard(_id: string): void | never { | ||
return notImplementedError('deleteDashboard'); | ||
} | ||
|
||
// TODO: understand how to implement it using only JS objects | ||
parseRecords(records: Neo4jRecord[]): any | never { | ||
return records; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some docstrings here, since it's a pretty important interface we should document it well