Skip to content
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

Adding sql requests #91

Merged
merged 19 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7146902
feat : added sql requests
h1ppox99 Jul 4, 2024
a120313
fix : fixed minor test issues
h1ppox99 Jul 4, 2024
7397e0d
fix : corrected sql requests when the filterfields contain keys with …
h1ppox99 Jul 5, 2024
2827702
feat : added getJoin request and more tests
h1ppox99 Jul 5, 2024
f86a7fe
fix : istanbul ignored updateKey.ts since not used for the moment
h1ppox99 Jul 5, 2024
b87e73f
fix : fixed wrong management of empty queries (NB: default req.query …
h1ppox99 Jul 5, 2024
795f82a
fix : changed the order of parameters for _get and _getMax methods fo…
h1ppox99 Jul 5, 2024
289654c
fix : fixed initialisation of token following changes to the req.quer…
h1ppox99 Jul 5, 2024
6ba4eba
feat: test files v1
Mathixx Jul 4, 2024
1eb2e30
fix: tests covering matrixDb
Mathixx Jul 4, 2024
0e5a16b
fix: no personal settings in gitignore + changed test anme
Mathixx Jul 4, 2024
f6b59cc
fix: test config in __testData__ folder
Mathixx Jul 4, 2024
61df3cc
feat : added /register endpoint to test User Interactive Authenticati…
BichraiX Jul 5, 2024
433f700
chore: workaround TS type because it's Friday. TODO exists, to be fix…
guimard Jul 5, 2024
98647bd
fix : cancel previous commit
h1ppox99 Jul 5, 2024
c4fbe2e
fix: added istanbul ignore to ensure good test coverage
Mathixx Jul 5, 2024
1e5caa4
feat : added sql request getWhereEqualAndHigher
h1ppox99 Jul 5, 2024
602361e
Merge branch 'full-id-service' into adding-sql-requests
h1ppox99 Jul 8, 2024
e7746cc
fix : corrected wrong syntax
h1ppox99 Jul 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Authenticate = (
token = re[1]
}
// @ts-expect-error req.query exists
} else if (req.query != null) {
} else if (req.query && Object.keys(req.query).length > 0) {
// @ts-expect-error req.query.access_token may be null
token = req.query.access_token
}
Expand Down
1 change: 1 addition & 0 deletions packages/matrix-client-server/src/matrixDb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type Collections =
| 'devices'
| 'local_current_membership'


type Get = (
table: Collections,
fields?: string[],
Expand Down
2 changes: 2 additions & 0 deletions packages/matrix-client-server/src/matrixDb/sql/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MatrixDBSQLite
Record<Collections, Array<Record<string, string | number>>>
>
): Promise<void> {
/* istanbul ignore if */
if (this.db != null) return Promise.resolve()
return new Promise((resolve, reject) => {
import('sqlite3')
Expand Down Expand Up @@ -82,6 +83,7 @@ class MatrixDBSQLite
)

stmt.finalize((err) => {
/* istanbul ignore if */
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (err) {
reject(err)
Expand Down
2 changes: 1 addition & 1 deletion packages/matrix-client-server/src/utils/authenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Authenticate = (
token = re[1]
}
// @ts-expect-error req.query exists
} else if (req.query != null) {
} else if (req.query && Object.keys(req.query).length > 0) {
// @ts-expect-error req.query.access_token may be null
token = req.query.access_token
}
Expand Down
Loading
Loading