@get-dx/cli 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -15
- package/dist/cli.js +4 -0
- package/dist/commands/auth.js +27 -22
- package/dist/commands/catalog/entities.js +6 -6
- package/dist/commands/catalog/entitiesRendering.js +13 -9
- package/dist/commands/catalog/entityTypes.js +4 -4
- package/dist/commands/catalog/entityTypesRendering.js +15 -21
- package/dist/commands/init.js +15 -60
- package/dist/commands/scorecards.js +4 -4
- package/dist/commands/scorecardsRendering.js +8 -5
- package/dist/commands/snapshots.js +379 -0
- package/dist/commands/studio/query.js +2 -2
- package/dist/config.js +171 -29
- package/dist/http.js +1 -1
- package/dist/loginViaBrowser.js +5 -5
- package/dist/runtime.js +11 -7
- package/dist/ui.js +3 -0
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveApiBaseUrl, resolveWebBaseUrl } from "./config.js";
|
|
2
2
|
import { CliError } from "./errors.js";
|
|
3
3
|
import { getToken } from "./secrets.js";
|
|
4
4
|
import { createLogger } from "./logger.js";
|
|
@@ -7,13 +7,15 @@ export function buildLogger(context) {
|
|
|
7
7
|
return createLogger({ json: context.json || !process.stderr.isTTY });
|
|
8
8
|
}
|
|
9
9
|
export function buildRuntime(context, overrides) {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const apiBaseUrl = overrides?.apiBaseUrl ?? resolveApiBaseUrl();
|
|
11
|
+
const webBaseUrl = overrides?.webBaseUrl ?? resolveWebBaseUrl();
|
|
12
|
+
const token = overrides?.token ?? getToken(apiBaseUrl);
|
|
12
13
|
if (!token) {
|
|
13
14
|
throw new CliError("No API token configured. Run `dx auth login --token <token>` or set DX_API_TOKEN.");
|
|
14
15
|
}
|
|
15
16
|
return {
|
|
16
|
-
|
|
17
|
+
apiBaseUrl,
|
|
18
|
+
webBaseUrl,
|
|
17
19
|
token,
|
|
18
20
|
context,
|
|
19
21
|
version: cliPackage.version,
|
|
@@ -21,13 +23,15 @@ export function buildRuntime(context, overrides) {
|
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
export function buildRuntimeSafe(context, overrides) {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
+
const apiBaseUrl = overrides?.apiBaseUrl ?? resolveApiBaseUrl();
|
|
27
|
+
const webBaseUrl = overrides?.webBaseUrl ?? resolveWebBaseUrl();
|
|
28
|
+
const token = overrides?.token ?? getToken(apiBaseUrl);
|
|
26
29
|
if (!token) {
|
|
27
30
|
return null;
|
|
28
31
|
}
|
|
29
32
|
return {
|
|
30
|
-
|
|
33
|
+
apiBaseUrl,
|
|
34
|
+
webBaseUrl,
|
|
31
35
|
token,
|
|
32
36
|
context,
|
|
33
37
|
version: cliPackage.version,
|
package/dist/ui.js
CHANGED