Skip to content

Commit

Permalink
Rename endpointURL to url (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
macmv authored Oct 11, 2023
1 parent 1aa218f commit 20471df
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 109 deletions.
201 changes: 102 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,17 @@ Database.create({ name: DBNAME })
Create a database.

USAGE
$ fauna create-database DBNAME [--endpointURL <value>] [--timeout <value>]
$ fauna create-database DBNAME [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]

ARGUMENTS
DBNAME database name

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
Create a database.
Expand All @@ -555,18 +555,18 @@ Key.create({
Create a key for the specified database.

USAGE
$ fauna create-key DBNAME [ROLE] [--endpointURL <value>] [--timeout
<value>] [--secret <value>] [--endpoint <value>]
$ fauna create-key DBNAME [ROLE] [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]

ARGUMENTS
DBNAME database name
ROLE (admin|server|server-readonly|client) key user role

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
Create a key for the specified database.
Expand All @@ -588,17 +588,17 @@ Database.byName(DBNAME)!.delete()
Delete a database.

USAGE
$ fauna delete-database DBNAME [--endpointURL <value>] [--timeout <value>]
$ fauna delete-database DBNAME [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]

ARGUMENTS
DBNAME database name

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
Delete a database.
Expand All @@ -620,17 +620,17 @@ Key.byId(ID)!.delete()
Delete a key.

USAGE
$ fauna delete-key KEYNAME [--endpointURL <value>] [--timeout <value>]
$ fauna delete-key KEYNAME [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]

ARGUMENTS
KEYNAME key name

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
Delete a key.
Expand Down Expand Up @@ -769,7 +769,7 @@ line arguments.
Evaluate the given query.

USAGE
$ fauna eval [DBNAME] [QUERY] [--endpointURL <value>] [--timeout
$ fauna eval [DBNAME] [QUERY] [--url <value>] [--timeout
<value>] [--secret <value>] [--endpoint <value>] [--file <value>] [--stdin]
[--output <value>] [--format json|json-tagged|shell] [--version 4|10]
[--typecheck]
Expand All @@ -779,18 +779,18 @@ ARGUMENTS
QUERY FQL query to execute

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--file=<value> File where to read queries from
--format=<option> Output format
<options: json|json-tagged|shell>
--output=<value> File to write output to
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--stdin Read file input from stdin. Writes to stdout by default
--timeout=<value> Connection timeout in milliseconds
--typecheck Enable typechecking
--version=<option> [default: 10] FQL Version
<options: 4|10>
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--file=<value> File where to read queries from
--format=<option> Output format
<options: json|json-tagged|shell>
--output=<value> File to write output to
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--stdin Read file input from stdin. Writes to stdout by default
--timeout=<value> Connection timeout in milliseconds
--typecheck Enable typechecking
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--version=<option> [default: 10] FQL Version
<options: 4|10>

DESCRIPTION
Evaluate the given query.
Expand Down Expand Up @@ -859,10 +859,10 @@ Import data to Fauna.
Import data to Fauna.

USAGE
$ fauna import --path <value> [--endpointURL <value>] [--timeout
<value>] [--secret <value>] [--endpoint <value>] [--db <value>]
[--collection <value>] [--type <value>] [--append] [--allow-short-rows]
[--dry-run] [--treat-empty-csv-cells-as empty|null]
$ fauna import --path <value> [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--db <value>] [--collection
<value>] [--type <value>] [--append] [--allow-short-rows] [--dry-run]
[--treat-empty-csv-cells-as empty|null]

FLAGS
--allow-short-rows
Expand All @@ -886,9 +886,6 @@ FLAGS
--endpoint=<value>
Connection endpoint, from ~/.fauna-shell
--endpointURL=<value>
Database URL. Overrides the `url` in ~/.fauna-shell
--path=<value>
(required) Path to .csv/.json file, or path to folder containing .csv/.json
files. if the path is to a folder, sub-folders will be skipped.
Expand Down Expand Up @@ -919,6 +916,9 @@ FLAGS
'dateEpochMillis' - converts milliseconds since the epoch to a Fauna Time
'dateEpochSeconds' - converts seconds since the epoch to a Fauna Time
--url=<value>
Database URL. Overrides the `url` in ~/.fauna-shell
DESCRIPTION
Import data to Fauna.
Expand Down Expand Up @@ -981,14 +981,14 @@ Database.all().take(1000).toArray()
List child databases in the current database.

USAGE
$ fauna list-databases [--endpointURL <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]
$ fauna list-databases [--url <value>] [--timeout <value>] [--secret
<value>] [--endpoint <value>]

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
List child databases in the current database.
Expand All @@ -1010,14 +1010,14 @@ Key.all().take(100).toArray()
List keys in the current database.

USAGE
$ fauna list-keys [--endpointURL <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>]
$ fauna list-keys [--url <value>] [--timeout <value>] [--secret
<value>] [--endpoint <value>]

FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell

DESCRIPTION
List keys in the current database.
Expand Down Expand Up @@ -1075,21 +1075,23 @@ database, and display a complete diff between all the files.
Print the diff between local and remote schema.
USAGE
$ fauna schema diff [--endpointURL <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--dir <value>]
$ fauna schema diff [--url <value>] [--timeout <value>] [--secret
<value>] [--endpoint <value>] [--dir <value>]
FLAGS
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
DESCRIPTION
Print the diff between local and remote schema.
EXAMPLES
$ fauna schema diff
$ fauna schema diff --dir schemas/myschema
```
Expand All @@ -1113,22 +1115,24 @@ confirmation step.
Push the current project's .fsl files to Fauna.
USAGE
$ fauna schema push [--endpointURL <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--dir <value>] [--force]
$ fauna schema push [--url <value>] [--timeout <value>] [--secret
<value>] [--endpoint <value>] [--dir <value>] [--force]
FLAGS
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--force Push the change without a diff or schema version check
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--force Push the change without a diff or schema version check
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
DESCRIPTION
Push the current project's .fsl files to Fauna.
EXAMPLES
$ fauna schema push
$ fauna schema push --dir schemas/myschema
```
Expand All @@ -1149,18 +1153,18 @@ removed.
Pull a database schema's .fsl files into the current project.
USAGE
$ fauna schema pull [--endpointURL <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--dir <value>] [--delete]
$ fauna schema pull [--url <value>] [--timeout <value>] [--secret
<value>] [--endpoint <value>] [--dir <value>] [--delete]
FLAGS
--delete Delete .fsl files in the target directory that are not
part of the database schema
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--delete Delete .fsl files in the target directory that are not
part of the database schema
--dir=<value> The directory of .fsl files to push. Defaults to the
directory of `.fauna-project`
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
DESCRIPTION
Pull a database schema's .fsl files into the current project.
Expand All @@ -1177,27 +1181,26 @@ Start an interactive shell.
Start an interactive shell.
USAGE
$ fauna shell [DB_PATH] [--endpointURL <value>] [--timeout
<value>] [--secret <value>] [--endpoint <value>] [--file <value>] [--stdin]
[--output <value>] [--format json|json-tagged|shell] [--version 4|10]
[--typecheck]
$ fauna shell [DB_PATH] [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--file <value>] [--stdin] [--output
<value>] [--format json|json-tagged|shell] [--version 4|10] [--typecheck]
ARGUMENTS
DB_PATH Database path
FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--file=<value> File where to read queries from
--format=<option> Output format
<options: json|json-tagged|shell>
--output=<value> File to write output to
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--stdin Read file input from stdin. Writes to stdout by default
--timeout=<value> Connection timeout in milliseconds
--typecheck Enable typechecking
--version=<option> [default: 10] FQL Version
<options: 4|10>
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--file=<value> File where to read queries from
--format=<option> Output format
<options: json|json-tagged|shell>
--output=<value> File to write output to
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--stdin Read file input from stdin. Writes to stdout by default
--timeout=<value> Connection timeout in milliseconds
--typecheck Enable typechecking
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--version=<option> [default: 10] FQL Version
<options: 4|10>
DESCRIPTION
Start an interactive shell.
Expand Down Expand Up @@ -1290,22 +1293,22 @@ Upload a GraphQL schema.
Upload GraphQL schema.
USAGE
$ fauna upload-graphql-schema GRAPHQLFILEPATH [--endpointURL <value>] [--timeout
<value>] [--secret <value>] [--endpoint <value>] [--graphqlHost <value>]
$ fauna upload-graphql-schema GRAPHQLFILEPATH [--url <value>] [--timeout <value>]
[--secret <value>] [--endpoint <value>] [--graphqlHost <value>]
[--graphqlPort <value>] [--mode merge|override|replace]
ARGUMENTS
GRAPHQLFILEPATH Path to GraphQL schema
FLAGS
--endpoint=<value> Connection endpoint, from ~/.fauna-shell
--endpointURL=<value> Database URL. Overrides the `url` in ~/.fauna-shell
--graphqlHost=<value> The Fauna GraphQL API host
--graphqlPort=<value> GraphQL port
--mode=<option> [default: merge] Upload mode
<options: merge|override|replace>
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell
--timeout=<value> Connection timeout in milliseconds
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell
DESCRIPTION
Upload GraphQL schema.
Expand Down
6 changes: 3 additions & 3 deletions src/lib/config/root-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ export class Endpoint {
/**
* Gets a database URL from command line flags.
*
* Note: this is similar to `getURLFromConfig`, but looks up `endpointURL`
* instead of `url` for the url value.
* Note: this is the same as `getURLFromConfig`. Its left different so that
* we can change flags later, without breaking config parsing.
*/
static getURLFromFlags = (flags: Config): string | undefined => {
return this.getURL({
url: flags.strOpt("endpointURL"),
url: flags.strOpt("url"),
scheme: flags.strOpt("scheme"),
domain: flags.strOpt("domain"),
port: flags.numberOpt("port"),
Expand Down
Loading

0 comments on commit 20471df

Please sign in to comment.