-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
105 changed files
with
659 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
[*.{js,json,yml}] | ||
charset = utf-8 | ||
end_of_line = crlf | ||
indent_style = tabs | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
env: | ||
node: true | ||
extends: | ||
- eslint:recommended | ||
- plugin:n/recommended | ||
parserOptions: | ||
ecmaVersion: 2022 | ||
sourceType: module | ||
globals: | ||
ee: readonly | ||
rules: | ||
n/no-extraneous-import: | ||
- error | ||
- allowModules: | ||
- restify-errors |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"collectCoverage": true, | ||
"coverageDirectory": "coverage", | ||
"errorOnDeprecated": true, | ||
"reporters": [ | ||
"default", | ||
["./node_modules/jest-html-reporter", { | ||
"pageTitle": "Test Report for openeo-earthengine-driver" | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
const ServerContext = require("./servercontext"); | ||
const { createInterface } = require('node:readline/promises'); | ||
/*eslint n/no-process-exit: "off"*/ | ||
import ServerContext from "./utils/servercontext.js"; | ||
import { createInterface } from 'node:readline/promises'; | ||
|
||
async function run() { | ||
const serverContext = new ServerContext(); | ||
const users = serverContext.users(); | ||
const serverContext = new ServerContext(); | ||
const users = serverContext.users(); | ||
|
||
const rl = createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
const stop = (code) => { | ||
rl.close(); | ||
process.exit(code); | ||
} | ||
|
||
const username = await rl.question('Enter a username: '); | ||
if (username && username.length < 4) { | ||
console.error("Username must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const exists = await users.exists(username); | ||
if (exists) { | ||
console.error("User with the given name already exists."); | ||
stop(1); | ||
} | ||
const rl = createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
const stop = (code) => { | ||
rl.close(); | ||
process.exit(code); | ||
} | ||
|
||
const password = await rl.question('Enter a password: '); | ||
if (password && password.length < 4) { | ||
console.error("Password must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const username = await rl.question('Enter a username: '); | ||
if (username && username.length < 4) { | ||
console.error("Username must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
const exists = await users.exists(username); | ||
if (exists) { | ||
console.error("User with the given name already exists."); | ||
stop(1); | ||
} | ||
|
||
try { | ||
await users.register(username, password); | ||
console.log('User created!'); | ||
stop(0); | ||
} catch (err) { | ||
console.error(err); | ||
stop(1); | ||
} | ||
const password = await rl.question('Enter a password: '); | ||
if (password && password.length < 4) { | ||
console.error("Password must be at least 4 characters long."); | ||
stop(1); | ||
} | ||
|
||
run(); | ||
try { | ||
await users.register(username, password); | ||
console.log('User created!'); | ||
stop(0); | ||
} catch (err) { | ||
console.error(err); | ||
stop(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.