-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(msar): —logRequests, session-based api calls
- `—logRequests` flag useful mostly for debugging - API requests are now made against a specific session (allowing per-tab sessions to be created/destroyed independendently).
- Loading branch information
Showing
9 changed files
with
42 additions
and
12 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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import cli from '@battis/qui-cli'; | ||
|
||
export const defaults = { | ||
ignoreErrors: true | ||
ignoreErrors: true, | ||
logRequests: false | ||
}; | ||
|
||
export const flags = { | ||
ignoreErrors: { | ||
description: `Continue collecting snapshots even if errors are encountered (default: ${cli.colors.value(defaults.ignoreErrors)}, use ${cli.colors.value('--no-ignoreErrors')} to halt on errors)`, | ||
description: `Continue collecting snapshots even if errors are encountered (default: ${cli.colors.value(defaults.ignoreErrors)}${defaults.ignoreErrors ? `, use ${cli.colors.value('--no-ignoreErrors')} to halt on errors` : ''})`, | ||
default: defaults.ignoreErrors | ||
}, | ||
logRequests: { | ||
description: `Log fetch requests and responses for analysis and debugging (default: ${cli.colors.value(defaults.logRequests)})` | ||
} | ||
}; |
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,11 +1,13 @@ | ||
export type Parsed = { | ||
ignoreErrors: boolean; | ||
batchSize: number; | ||
logRequests: boolean; | ||
}; | ||
|
||
export function parse(values: Record<string, any>): Parsed { | ||
return { | ||
ignoreErrors: !!values.ignoreErrors, | ||
batchSize: parseInt(values.batchSize) | ||
batchSize: parseInt(values.batchSize), | ||
logRequests: !!values.logRequests | ||
}; | ||
} |
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
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