@mittwald/cli 1.0.0-alpha.27 → 1.0.0-alpha.29
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 +905 -806
- package/dist/esm/ExtendedBaseCommand.d.ts +4 -0
- package/dist/esm/ExtendedBaseCommand.js +12 -0
- package/dist/esm/Formatter.js +13 -1
- package/dist/esm/GetBaseCommand.d.ts +2 -3
- package/dist/esm/GetBaseCommand.js +2 -4
- package/dist/esm/ListBaseCommand.d.ts +2 -3
- package/dist/esm/ListBaseCommand.js +2 -4
- package/dist/esm/commands/app/copy.d.ts +2 -1
- package/dist/esm/commands/app/copy.js +3 -3
- package/dist/esm/commands/app/dependency/list.d.ts +1 -1
- package/dist/esm/commands/app/dependency/update.d.ts +2 -1
- package/dist/esm/commands/app/dependency/update.js +3 -3
- package/dist/esm/commands/app/dependency/versions.d.ts +1 -1
- package/dist/esm/commands/app/get.d.ts +2 -1
- package/dist/esm/commands/app/get.js +4 -3
- package/dist/esm/commands/app/list.d.ts +1 -1
- package/dist/esm/commands/app/list.js +4 -0
- package/dist/esm/commands/app/ssh.d.ts +5 -3
- package/dist/esm/commands/app/ssh.js +18 -9
- package/dist/esm/commands/app/uninstall.d.ts +2 -1
- package/dist/esm/commands/app/uninstall.js +3 -6
- package/dist/esm/commands/backup/create.js +2 -2
- package/dist/esm/commands/backup/list.js +2 -2
- package/dist/esm/commands/context/get.js +27 -5
- package/dist/esm/commands/context/set.d.ts +1 -0
- package/dist/esm/commands/context/set.js +10 -0
- package/dist/esm/commands/conversation/show.js +1 -2
- package/dist/esm/commands/cronjob/create.d.ts +23 -0
- package/dist/esm/commands/cronjob/create.js +97 -0
- package/dist/esm/commands/cronjob/delete.d.ts +13 -0
- package/dist/esm/commands/cronjob/delete.js +21 -0
- package/dist/esm/commands/cronjob/execute.d.ts +17 -0
- package/dist/esm/commands/cronjob/execute.js +42 -0
- package/dist/esm/commands/cronjob/execution/abort.d.ts +18 -0
- package/dist/esm/commands/cronjob/execution/abort.js +41 -0
- package/dist/esm/commands/cronjob/execution/list.js +4 -5
- package/dist/esm/commands/cronjob/get.d.ts +7 -9
- package/dist/esm/commands/cronjob/get.js +22 -12
- package/dist/esm/commands/cronjob/list.js +4 -6
- package/dist/esm/commands/database/mysql/charsets.d.ts +2 -4
- package/dist/esm/commands/database/mysql/charsets.js +2 -6
- package/dist/esm/commands/database/mysql/create.js +2 -2
- package/dist/esm/commands/database/mysql/delete.js +2 -2
- package/dist/esm/commands/database/mysql/list.d.ts +1 -2
- package/dist/esm/commands/database/mysql/list.js +2 -2
- package/dist/esm/commands/database/mysql/phpmyadmin.js +1 -1
- package/dist/esm/commands/database/mysql/user/list.d.ts +2 -3
- package/dist/esm/commands/database/mysql/user/list.js +3 -4
- package/dist/esm/commands/database/mysql/versions.d.ts +1 -2
- package/dist/esm/commands/database/mysql/versions.js +1 -3
- package/dist/esm/commands/database/redis/create.js +2 -2
- package/dist/esm/commands/database/redis/get.d.ts +1 -3
- package/dist/esm/commands/database/redis/get.js +0 -3
- package/dist/esm/commands/database/redis/list.d.ts +1 -2
- package/dist/esm/commands/database/redis/list.js +3 -5
- package/dist/esm/commands/database/redis/versions.d.ts +1 -2
- package/dist/esm/commands/database/redis/versions.js +2 -3
- package/dist/esm/commands/domain/dnszone/get.d.ts +9 -8
- package/dist/esm/commands/domain/dnszone/get.js +22 -9
- package/dist/esm/commands/domain/dnszone/list.d.ts +11 -6
- package/dist/esm/commands/domain/dnszone/list.js +65 -10
- package/dist/esm/commands/domain/dnszone/update.d.ts +28 -0
- package/dist/esm/commands/domain/dnszone/update.js +176 -0
- package/dist/esm/commands/domain/get.d.ts +9 -7
- package/dist/esm/commands/domain/get.js +23 -10
- package/dist/esm/commands/domain/list.d.ts +4 -3
- package/dist/esm/commands/domain/list.js +30 -5
- package/dist/esm/commands/domain/virtualhost/create.d.ts +1 -3
- package/dist/esm/commands/domain/virtualhost/create.js +9 -25
- package/dist/esm/commands/domain/virtualhost/delete.js +1 -1
- package/dist/esm/commands/domain/virtualhost/get.js +2 -14
- package/dist/esm/commands/domain/virtualhost/list.d.ts +1 -3
- package/dist/esm/commands/domain/virtualhost/list.js +5 -8
- package/dist/esm/commands/mail/address/create.d.ts +4 -0
- package/dist/esm/commands/mail/address/create.js +59 -5
- package/dist/esm/commands/mail/address/delete.js +1 -1
- package/dist/esm/commands/mail/address/list.d.ts +2 -2
- package/dist/esm/commands/mail/address/list.js +2 -4
- package/dist/esm/commands/mail/deliverybox/list.js +2 -2
- package/dist/esm/commands/org/invite/list-own.d.ts +1 -1
- package/dist/esm/commands/org/invite/revoke.js +2 -2
- package/dist/esm/commands/org/membership/list-own.d.ts +1 -1
- package/dist/esm/commands/org/membership/revoke.js +2 -2
- package/dist/esm/commands/project/create.js +2 -2
- package/dist/esm/commands/project/delete.d.ts +0 -1
- package/dist/esm/commands/project/delete.js +4 -8
- package/dist/esm/commands/project/filesystem/usage.d.ts +1 -1
- package/dist/esm/commands/project/filesystem/usage.js +3 -3
- package/dist/esm/commands/project/get.js +5 -5
- package/dist/esm/commands/project/invite/get.js +1 -1
- package/dist/esm/commands/project/invite/list.js +2 -2
- package/dist/esm/commands/project/membership/get.js +1 -1
- package/dist/esm/commands/project/membership/list.js +5 -5
- package/dist/esm/commands/project/ssh.d.ts +2 -2
- package/dist/esm/commands/project/ssh.js +4 -5
- package/dist/esm/commands/project/update.d.ts +2 -2
- package/dist/esm/commands/project/update.js +4 -5
- package/dist/esm/commands/server/get.d.ts +1 -3
- package/dist/esm/commands/server/get.js +2 -5
- package/dist/esm/commands/sftp-user/list.js +2 -2
- package/dist/esm/commands/ssh-user/list.js +2 -2
- package/dist/esm/lib/app/flags.d.ts +2 -3
- package/dist/esm/lib/app/flags.js +18 -8
- package/dist/esm/lib/assert_success.d.ts +3 -0
- package/dist/esm/lib/assert_success.js +7 -0
- package/dist/esm/lib/context.d.ts +26 -5
- package/dist/esm/lib/context.js +23 -16
- package/dist/esm/lib/context_flags.d.ts +25 -7
- package/dist/esm/lib/context_flags.js +29 -20
- package/dist/esm/lib/context_terraform.d.ts +6 -0
- package/dist/esm/lib/context_terraform.js +61 -0
- package/dist/esm/lib/context_user.d.ts +10 -0
- package/dist/esm/lib/context_user.js +41 -0
- package/dist/esm/lib/database/mysql/connect.js +1 -1
- package/dist/esm/lib/domain/dnszone/flags.d.ts +1 -0
- package/dist/esm/lib/domain/dnszone/flags.js +19 -0
- package/dist/esm/lib/domain/dnszone/records.d.ts +17 -0
- package/dist/esm/lib/domain/dnszone/records.js +18 -0
- package/dist/esm/lib/domain/flags.d.ts +1 -0
- package/dist/esm/lib/domain/flags.js +20 -0
- package/dist/esm/lib/org/flags.d.ts +1 -13
- package/dist/esm/lib/org/flags.js +1 -1
- package/dist/esm/lib/project/flags.d.ts +15 -13
- package/dist/esm/lib/project/flags.js +52 -2
- package/dist/esm/lib/project/ingress.js +4 -2
- package/dist/esm/lib/server/flags.d.ts +1 -13
- package/dist/esm/lib/server/flags.js +1 -1
- package/dist/esm/rendering/process/components/ProcessValidationErrors.js +3 -1
- package/dist/esm/rendering/react/RenderBaseCommand.d.ts +3 -0
- package/dist/esm/rendering/react/RenderBaseCommand.js +7 -0
- package/dist/esm/rendering/react/components/AppInstallation/AppInstallationDetails.js +8 -1
- package/dist/esm/rendering/react/components/BooleanValue.d.ts +4 -0
- package/dist/esm/rendering/react/components/BooleanValue.js +9 -0
- package/dist/esm/rendering/react/components/CronJob/CronJobDetails.d.ts +8 -0
- package/dist/esm/rendering/react/components/CronJob/CronJobDetails.js +48 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneDetails.d.ts +6 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneDetails.js +12 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecords.d.ts +6 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecords.js +17 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsA.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsA.js +14 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsAAAA.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsAAAA.js +14 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsMX.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsMX.js +13 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsSRV.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsSRV.js +9 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsTXT.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/DnsZoneRecordsTXT.js +9 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordComponent.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordComponent.js +1 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordSetManagedByMittwald.d.ts +1 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordSetManagedByMittwald.js +3 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordSetValues.d.ts +4 -0
- package/dist/esm/rendering/react/components/DnsZone/RecordSetValues.js +5 -0
- package/dist/esm/rendering/react/components/Domain/DomainBaseDetails.d.ts +6 -0
- package/dist/esm/rendering/react/components/Domain/DomainBaseDetails.js +13 -0
- package/dist/esm/rendering/react/components/Domain/DomainDetails.d.ts +6 -0
- package/dist/esm/rendering/react/components/Domain/DomainDetails.js +7 -0
- package/dist/esm/rendering/react/components/Domain/DomainHandle.d.ts +7 -0
- package/dist/esm/rendering/react/components/Domain/DomainHandle.js +24 -0
- package/dist/esm/rendering/react/components/LocalFilename.d.ts +5 -0
- package/dist/esm/rendering/react/components/LocalFilename.js +14 -0
- package/dist/esm/rendering/react/components/Note.d.ts +1 -0
- package/dist/esm/rendering/react/components/Note.js +1 -1
- package/dist/esm/rendering/react/components/Project/ProjectSimpleStatus.d.ts +7 -0
- package/dist/esm/rendering/react/components/Project/ProjectSimpleStatus.js +19 -0
- package/dist/esm/rendering/react/components/Project/ProjectStatus.d.ts +2 -2
- package/dist/esm/rendering/react/components/Project/ProjectStatus.js +2 -2
- package/dist/esm/rendering/react/components/Value.js +1 -1
- package/package.json +14 -13
- package/dist/esm/commands/domain/ownership/get.d.ts +0 -15
- package/dist/esm/commands/domain/ownership/get.js +0 -19
- package/dist/esm/commands/domain/ownership/list.d.ts +0 -16
- package/dist/esm/commands/domain/ownership/list.js +0 -21
- package/dist/esm/rendering/react/components/Ingress/DomainOwnership.d.ts +0 -8
- package/dist/esm/rendering/react/components/Ingress/DomainOwnership.js +0 -7
- package/dist/esm/rendering/react/components/Project/ProjectReadiness.d.ts +0 -7
- package/dist/esm/rendering/react/components/Project/ProjectReadiness.js +0 -16
|
@@ -1,3 +1,53 @@
|
|
|
1
1
|
import { normalizeProjectIdToUuid } from "../../Helpers.js";
|
|
2
|
-
import { makeFlagSet } from "../context_flags.js";
|
|
3
|
-
|
|
2
|
+
import { makeFlagSet, makeMissingContextInputError, } from "../context_flags.js";
|
|
3
|
+
import { Args, Flags } from "@oclif/core";
|
|
4
|
+
export const { flags: projectFlags, args: projectArgs, withId: withProjectId, } = makeFlagSet("project", "p", { normalize: normalizeProjectIdToUuid });
|
|
5
|
+
export function makeProjectFlagSet(name, char, opts = {}) {
|
|
6
|
+
const { normalize = (_1, _2, id) => id, shortIDName = "short ID", displayName = name, supportsContext = false, } = opts;
|
|
7
|
+
const article = displayName.match(/^[aeiou]/i) ? "an" : "a";
|
|
8
|
+
const flagName = `${name}-id`;
|
|
9
|
+
const flags = {
|
|
10
|
+
...projectFlags,
|
|
11
|
+
[flagName]: Flags.string({
|
|
12
|
+
char,
|
|
13
|
+
required: !supportsContext,
|
|
14
|
+
summary: `ID or ${shortIDName} of ${article} ${displayName}`,
|
|
15
|
+
description: `May contain a ${shortIDName} or a full ID of ${article} ${displayName}.`,
|
|
16
|
+
default: undefined,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
const args = {
|
|
20
|
+
[flagName]: Args.string({
|
|
21
|
+
description: `ID or ${shortIDName} of ${article} ${displayName}`,
|
|
22
|
+
required: !supportsContext,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
if (supportsContext) {
|
|
26
|
+
flags[flagName].summary += `; this flag is optional if a default ${displayName} is set in the context`;
|
|
27
|
+
flags[flagName].description += `; you can also use the "<%= config.bin %> context set --${flagName}=<VALUE>" command to persistently set a default ${displayName} for all commands that accept this flag.`;
|
|
28
|
+
args[flagName].description += `; this argument is optional if a default ${displayName} is set in the context`;
|
|
29
|
+
}
|
|
30
|
+
const idFromArgsOrFlag = (flags, args) => {
|
|
31
|
+
if (args[flagName]) {
|
|
32
|
+
return args[flagName];
|
|
33
|
+
}
|
|
34
|
+
if (flags[flagName]) {
|
|
35
|
+
return flags[flagName];
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
};
|
|
39
|
+
const withId = async (apiClient, commandType, flags, args, cfg) => {
|
|
40
|
+
const projectId = await withProjectId(apiClient, commandType, flags, args, cfg);
|
|
41
|
+
const idInput = idFromArgsOrFlag(flags, args);
|
|
42
|
+
if (idInput) {
|
|
43
|
+
return normalize(apiClient, projectId, idInput);
|
|
44
|
+
}
|
|
45
|
+
throw makeMissingContextInputError(commandType, name, flagName, false);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
name,
|
|
49
|
+
flags,
|
|
50
|
+
args,
|
|
51
|
+
withId,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -2,8 +2,10 @@ import { assertStatus } from "@mittwald/api-client-commons";
|
|
|
2
2
|
import { normalizeProjectIdToUuid } from "../../Helpers.js";
|
|
3
3
|
export async function getDefaultIngressForProject(apiClient, projectId) {
|
|
4
4
|
const projectUuid = await normalizeProjectIdToUuid(apiClient, projectId);
|
|
5
|
-
const projectIngresses = await apiClient.domain.
|
|
6
|
-
|
|
5
|
+
const projectIngresses = await apiClient.domain.ingressListIngresses({
|
|
6
|
+
queryParameters: {
|
|
7
|
+
projectId: projectUuid,
|
|
8
|
+
},
|
|
7
9
|
});
|
|
8
10
|
assertStatus(projectIngresses, 200);
|
|
9
11
|
const foundIngress = projectIngresses.data.find((item) => {
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export declare const serverFlags:
|
|
2
|
-
"server-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
3
|
-
}, serverArgs: {
|
|
4
|
-
"server-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
|
|
5
|
-
}, withServerId: (apiClient: import("@mittwald/api-client").MittwaldAPIV2Client, command: "flag" | "arg" | ({
|
|
6
|
-
flags: {
|
|
7
|
-
"server-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
|
|
8
|
-
};
|
|
9
|
-
} | {
|
|
10
|
-
args: {
|
|
11
|
-
"server-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string>;
|
|
12
|
-
};
|
|
13
|
-
}), flags: import("@oclif/core/lib/interfaces/parser.js").FlagOutput, args: import("@oclif/core/lib/interfaces/parser.js").ArgOutput, cfg: import("@oclif/core").Config) => Promise<string>;
|
|
1
|
+
export declare const serverFlags: import("../context_flags.js").ContextFlags<"server", "server-id">, serverArgs: import("../context_flags.js").ContextArgs<"server", "server-id">, withServerId: (apiClient: import("@mittwald/api-client").MittwaldAPIV2Client, command: "flag" | "arg" | import("../context_flags.js").CommandType<"server", "server-id">, flags: import("@oclif/core/lib/interfaces/parser.js").FlagOutput, args: import("@oclif/core/lib/interfaces/parser.js").ArgOutput, cfg: import("@oclif/core").Config) => Promise<string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { normalizeServerIdToUuid } from "../../Helpers.js";
|
|
2
2
|
import { makeFlagSet } from "../context_flags.js";
|
|
3
|
-
export const { flags: serverFlags, args: serverArgs, withId: withServerId, } = makeFlagSet("server", "s", normalizeServerIdToUuid);
|
|
3
|
+
export const { flags: serverFlags, args: serverArgs, withId: withServerId, } = makeFlagSet("server", "s", { normalize: normalizeServerIdToUuid });
|
|
@@ -10,6 +10,8 @@ const boxProps = {
|
|
|
10
10
|
width: 80,
|
|
11
11
|
};
|
|
12
12
|
export const ProcessValidationErrors = ({ err, color = "red" }) => {
|
|
13
|
-
const errorItems = err.validationErrors.map((e, idx) =>
|
|
13
|
+
const errorItems = err.validationErrors.map((e, idx) => {
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "row", children: [e.path && (_jsx(Box, { minWidth: e.path + 2, children: _jsxs(Text, { color: color, bold: true, children: [e.path, ":", " "] }) })), _jsx(Text, { color: color, children: e.message })] }, idx));
|
|
15
|
+
});
|
|
14
16
|
return (_jsxs(Box, { ...boxProps, children: [_jsx(Text, { color: color, children: "Your input contained invalid data:" }), _jsx(Box, { flexDirection: "column", marginY: 1, children: errorItems }), _jsx(Text, { color: color, children: "Please correct the errors and try again. Consult this command's help page (by invoking it with the --help flag) for more information." })] }));
|
|
15
17
|
};
|
|
@@ -3,6 +3,7 @@ import { ReactNode } from "react";
|
|
|
3
3
|
import { ExtendedBaseCommand } from "../../ExtendedBaseCommand.js";
|
|
4
4
|
import { Interfaces } from "@oclif/core";
|
|
5
5
|
import { FlagInput } from "@oclif/core/lib/interfaces/parser.js";
|
|
6
|
+
import { CommandType } from "../../lib/context_flags.js";
|
|
6
7
|
declare const renderFlags: {
|
|
7
8
|
output: Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
8
9
|
};
|
|
@@ -15,5 +16,7 @@ export declare abstract class RenderBaseCommand<T extends typeof BaseCommand> ex
|
|
|
15
16
|
init(): Promise<void>;
|
|
16
17
|
run(): Promise<void>;
|
|
17
18
|
protected abstract render(): ReactNode;
|
|
19
|
+
protected useAppInstallationId(command: CommandType<"installation" | "project"> | "flag" | "arg"): string;
|
|
20
|
+
protected useProjectId(command: CommandType<"project"> | "flag" | "arg"): string;
|
|
18
21
|
}
|
|
19
22
|
export {};
|
|
@@ -7,6 +7,7 @@ import { JsonCollectionProvider } from "./json/JsonCollectionProvider.js";
|
|
|
7
7
|
import { Flags } from "@oclif/core";
|
|
8
8
|
import { Render } from "./components/Render.js";
|
|
9
9
|
import { useIncreaseInkStdoutColumns } from "./hooks/useIncreaseInkStdoutColumns.js";
|
|
10
|
+
import { usePromise } from "@mittwald/react-use-promise";
|
|
10
11
|
const renderFlags = {
|
|
11
12
|
output: Flags.string({
|
|
12
13
|
description: "The output format to use; use 'txt' for a human readable text representation, and 'json' for a machine-readable JSON representation.",
|
|
@@ -46,4 +47,10 @@ export class RenderBaseCommand extends ExtendedBaseCommand {
|
|
|
46
47
|
return this.render();
|
|
47
48
|
} }) }) }) }));
|
|
48
49
|
}
|
|
50
|
+
useAppInstallationId(command) {
|
|
51
|
+
return usePromise(() => this.withAppInstallationId(command), []);
|
|
52
|
+
}
|
|
53
|
+
useProjectId(command) {
|
|
54
|
+
return usePromise(() => this.withProjectId(command), []);
|
|
55
|
+
}
|
|
49
56
|
}
|
|
@@ -9,6 +9,7 @@ import { phpInstaller } from "../../../../commands/app/create/php.js";
|
|
|
9
9
|
import { nodeInstaller } from "../../../../commands/app/create/node.js";
|
|
10
10
|
import { useProject } from "../../../../lib/project/hooks.js";
|
|
11
11
|
import { IDAndShortID } from "../IDAndShortID.js";
|
|
12
|
+
import path from "path";
|
|
12
13
|
export const AppInstallationDetails = ({ app, appInstallation }) => {
|
|
13
14
|
const customInstallation = [phpInstaller.appId, nodeInstaller.appId].includes(app.id);
|
|
14
15
|
const desiredAppVersion = useAppVersion(app.id, appInstallation.appVersion.desired);
|
|
@@ -18,6 +19,9 @@ export const AppInstallationDetails = ({ app, appInstallation }) => {
|
|
|
18
19
|
const project = appInstallation.projectId
|
|
19
20
|
? useProject(appInstallation.projectId)
|
|
20
21
|
: null;
|
|
22
|
+
const absoluteInstallPath = project
|
|
23
|
+
? path.join(project.directories["Web"], appInstallation.installationPath)
|
|
24
|
+
: null;
|
|
21
25
|
const rows = {
|
|
22
26
|
"Installation ID": _jsx(Value, { children: appInstallation.id }),
|
|
23
27
|
App: (_jsx(SingleResultTable, { rows: {
|
|
@@ -28,7 +32,7 @@ export const AppInstallationDetails = ({ app, appInstallation }) => {
|
|
|
28
32
|
ID: _jsx(IDAndShortID, { object: project }),
|
|
29
33
|
Description: _jsx(Value, { children: project.description }),
|
|
30
34
|
} })) : (_jsx(Value, { notSet: true })),
|
|
31
|
-
"Installation Path": _jsx(Value, { children:
|
|
35
|
+
"Installation Path": absoluteInstallPath ? (_jsx(Value, { children: absoluteInstallPath })) : (_jsx(Value, { notSet: true })),
|
|
32
36
|
"Document root (in installation path)": (_jsx(Value, { children: appInstallation.customDocumentRoot ?? "/" })),
|
|
33
37
|
Description: _jsx(Value, { children: appInstallation.description }),
|
|
34
38
|
Status: customInstallation ? (_jsx(Text, { children: "custom application" })) : (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
|
|
@@ -36,6 +40,9 @@ export const AppInstallationDetails = ({ app, appInstallation }) => {
|
|
|
36
40
|
const title = (_jsxs(_Fragment, { children: ["APP INSTALLATION: ", _jsx(Value, { children: app.name }), " in", " ", _jsx(Value, { children: appInstallation.installationPath })] }));
|
|
37
41
|
const sections = [
|
|
38
42
|
_jsx(SingleResult, { title: title, rows: rows }, "primary"),
|
|
43
|
+
_jsx(SingleResult, { title: "Access", rows: {
|
|
44
|
+
"SSH/SFTP Host": (_jsxs(Text, { children: [_jsxs(Value, { children: ["ssh.", project?.clusterID, ".", project?.clusterDomain] }), " ", _jsx(Text, { color: "gray", children: "(Use the \"app ssh\" command to connect directly using the CLI)" })] })),
|
|
45
|
+
} }, "access"),
|
|
39
46
|
_jsx(AppSystemSoftware, { appInstallation: appInstallation }, "systemsoftware"),
|
|
40
47
|
];
|
|
41
48
|
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: sections }));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
import { Value } from "./Value.js";
|
|
4
|
+
export const BooleanValue = ({ value }) => {
|
|
5
|
+
if (value === undefined) {
|
|
6
|
+
return _jsx(Value, { notSet: true });
|
|
7
|
+
}
|
|
8
|
+
return value ? _jsx(Text, { color: "green", children: "yes" }) : _jsx(Text, { color: "red", children: "no" });
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
3
|
+
import CronjobCronjob = MittwaldAPIV2.Components.Schemas.CronjobCronjob;
|
|
4
|
+
type CronJobComponent = FC<{
|
|
5
|
+
cronjob: CronjobCronjob;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const CronJobDetails: CronJobComponent;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { SingleResult } from "../SingleResult.js";
|
|
3
|
+
import { Value } from "../Value.js";
|
|
4
|
+
import { Box, Text } from "ink";
|
|
5
|
+
import { IDAndShortID } from "../IDAndShortID.js";
|
|
6
|
+
import { CreatedAt } from "../CreatedAt.js";
|
|
7
|
+
import { useProject } from "../../../../lib/project/hooks.js";
|
|
8
|
+
import { useAppInstallation } from "../../../../lib/app/hooks.js";
|
|
9
|
+
import { FormattedDate } from "../FormattedDate.js";
|
|
10
|
+
const CronJobNextExecution = ({ cronjob }) => {
|
|
11
|
+
if (!cronjob.nextExecutionTime) {
|
|
12
|
+
return _jsx(Value, { notSet: true });
|
|
13
|
+
}
|
|
14
|
+
return (_jsx(Value, { children: _jsx(FormattedDate, { relative: true, date: cronjob.nextExecutionTime }) }));
|
|
15
|
+
};
|
|
16
|
+
const CronJobExecutionTargetURL = ({ dest, }) => {
|
|
17
|
+
return (_jsx(SingleResult, { title: "EXECUTION TARGET", rows: {
|
|
18
|
+
URL: _jsx(Value, { children: dest.url }),
|
|
19
|
+
} }));
|
|
20
|
+
};
|
|
21
|
+
const CronJobExecutionTargetCommand = ({ command, }) => {
|
|
22
|
+
return (_jsx(SingleResult, { title: "EXECUTION TARGET", rows: {
|
|
23
|
+
Interpreter: _jsx(Value, { children: command.interpreter }),
|
|
24
|
+
Script: _jsx(Value, { children: command.path }),
|
|
25
|
+
Parameters: command.parameters ? (_jsxs(Value, { children: [command.parameters, " "] })) : (_jsx(Value, { notSet: true })),
|
|
26
|
+
} }));
|
|
27
|
+
};
|
|
28
|
+
export const CronJobDetails = ({ cronjob }) => {
|
|
29
|
+
const project = cronjob.projectId ? useProject(cronjob.projectId) : null;
|
|
30
|
+
const app = useAppInstallation(cronjob.appId);
|
|
31
|
+
const rows = {
|
|
32
|
+
"Cron Job ID": _jsx(IDAndShortID, { object: cronjob }),
|
|
33
|
+
"Created At": _jsx(CreatedAt, { object: cronjob }),
|
|
34
|
+
Project: project ? _jsx(IDAndShortID, { object: project }) : _jsx(Value, { notSet: true }),
|
|
35
|
+
App: _jsx(IDAndShortID, { object: app }),
|
|
36
|
+
Schedule: (_jsxs(Text, { children: [_jsx(Value, { children: cronjob.interval }), " (next execution:", " ", _jsx(CronJobNextExecution, { cronjob: cronjob }), ")"] })),
|
|
37
|
+
};
|
|
38
|
+
const sections = [
|
|
39
|
+
_jsx(SingleResult, { title: _jsxs(_Fragment, { children: ["CRON JOB DETAILS: ", _jsx(Value, { children: cronjob.description })] }), rows: rows }, "primary"),
|
|
40
|
+
];
|
|
41
|
+
if ("url" in cronjob.destination) {
|
|
42
|
+
sections.push(_jsx(CronJobExecutionTargetURL, { dest: cronjob.destination }, "destination"));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
sections.push(_jsx(CronJobExecutionTargetCommand, { command: cronjob.destination }, "destination"));
|
|
46
|
+
}
|
|
47
|
+
return (_jsx(Box, { flexDirection: "column", marginBottom: 1, children: sections }));
|
|
48
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Value } from "../Value.js";
|
|
3
|
+
import { SingleResult } from "../SingleResult.js";
|
|
4
|
+
import { Box } from "ink";
|
|
5
|
+
import { DnsZoneRecords } from "./DnsZoneRecords.js";
|
|
6
|
+
export const DnsZoneDetails = ({ dnsZone }) => {
|
|
7
|
+
const title = (_jsxs(_Fragment, { children: ["DNS Zone: ", _jsx(Value, { children: dnsZone.domain })] }));
|
|
8
|
+
const rows = {
|
|
9
|
+
ID: _jsx(Value, { children: dnsZone.id }),
|
|
10
|
+
};
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(SingleResult, { title: title, rows: rows }), _jsx(DnsZoneRecords, { dnsZone: dnsZone })] }));
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DnsZoneRecordsA } from "./DnsZoneRecordsA.js";
|
|
3
|
+
import { DnsZoneRecordsAAAA } from "./DnsZoneRecordsAAAA.js";
|
|
4
|
+
import { DnsZoneRecordsMX } from "./DnsZoneRecordsMX.js";
|
|
5
|
+
import { DnsZoneRecordsTXT } from "./DnsZoneRecordsTXT.js";
|
|
6
|
+
import { DnsZoneRecordsSRV } from "./DnsZoneRecordsSRV.js";
|
|
7
|
+
import { SingleResult } from "../SingleResult.js";
|
|
8
|
+
export const DnsZoneRecords = ({ dnsZone }) => {
|
|
9
|
+
const rows = {
|
|
10
|
+
A: _jsx(DnsZoneRecordsA, { record: dnsZone.recordSet.combinedARecords }),
|
|
11
|
+
AAAA: _jsx(DnsZoneRecordsAAAA, { record: dnsZone.recordSet.combinedARecords }),
|
|
12
|
+
MX: _jsx(DnsZoneRecordsMX, { record: dnsZone.recordSet.mx }),
|
|
13
|
+
TXT: _jsx(DnsZoneRecordsTXT, { record: dnsZone.recordSet.txt }),
|
|
14
|
+
SRV: _jsx(DnsZoneRecordsSRV, { record: dnsZone.recordSet.srv }),
|
|
15
|
+
};
|
|
16
|
+
return _jsx(SingleResult, { title: "DNS records", rows: rows });
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isCustomARecord, isManagedARecord, } from "../../../../lib/domain/dnszone/records.js";
|
|
3
|
+
import { RecordSetManagedByMittwald } from "./RecordSetManagedByMittwald.js";
|
|
4
|
+
import { RecordSetValues } from "./RecordSetValues.js";
|
|
5
|
+
import { Value } from "../Value.js";
|
|
6
|
+
export const DnsZoneRecordsA = ({ record, }) => {
|
|
7
|
+
if (isManagedARecord(record)) {
|
|
8
|
+
return _jsx(RecordSetManagedByMittwald, {});
|
|
9
|
+
}
|
|
10
|
+
if (isCustomARecord(record) && record.a.length > 0) {
|
|
11
|
+
return _jsx(RecordSetValues, { records: record.a });
|
|
12
|
+
}
|
|
13
|
+
return _jsx(Value, { notSet: true });
|
|
14
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RecordComponent } from "./RecordComponent.js";
|
|
2
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
3
|
+
import DnsRecordCombinedA = MittwaldAPIV2.Components.Schemas.DnsRecordCombinedA;
|
|
4
|
+
export declare const DnsZoneRecordsAAAA: RecordComponent<DnsRecordCombinedA>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isCustomARecord, isManagedARecord, } from "../../../../lib/domain/dnszone/records.js";
|
|
3
|
+
import { RecordSetManagedByMittwald } from "./RecordSetManagedByMittwald.js";
|
|
4
|
+
import { RecordSetValues } from "./RecordSetValues.js";
|
|
5
|
+
import { Value } from "../Value.js";
|
|
6
|
+
export const DnsZoneRecordsAAAA = ({ record, }) => {
|
|
7
|
+
if (isManagedARecord(record)) {
|
|
8
|
+
return _jsx(RecordSetManagedByMittwald, {});
|
|
9
|
+
}
|
|
10
|
+
if (isCustomARecord(record) && record.aaaa.length > 0) {
|
|
11
|
+
return _jsx(RecordSetValues, { records: record.aaaa });
|
|
12
|
+
}
|
|
13
|
+
return _jsx(Value, { notSet: true });
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isCustomMXRecord, isManagedMXRecord, } from "../../../../lib/domain/dnszone/records.js";
|
|
3
|
+
import { RecordSetManagedByMittwald } from "./RecordSetManagedByMittwald.js";
|
|
4
|
+
import { Value } from "../Value.js";
|
|
5
|
+
export const DnsZoneRecordsMX = ({ record }) => {
|
|
6
|
+
if (isManagedMXRecord(record)) {
|
|
7
|
+
return _jsx(RecordSetManagedByMittwald, {});
|
|
8
|
+
}
|
|
9
|
+
if (isCustomMXRecord(record)) {
|
|
10
|
+
return record.records.map((a, idx) => (_jsxs(Value, { children: [a.priority, " ", a.fqdn] }, idx)));
|
|
11
|
+
}
|
|
12
|
+
return _jsx(Value, { notSet: true });
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isSRVRecord } from "../../../../lib/domain/dnszone/records.js";
|
|
3
|
+
import { Value } from "../Value.js";
|
|
4
|
+
export const DnsZoneRecordsSRV = ({ record, }) => {
|
|
5
|
+
if (isSRVRecord(record)) {
|
|
6
|
+
return record.records.map((a, idx) => (_jsxs(Value, { children: [a.priority, " ", a.weight, " ", a.port, " ", a.fqdn] }, idx)));
|
|
7
|
+
}
|
|
8
|
+
return _jsx(Value, { notSet: true });
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isTXTRecord } from "../../../../lib/domain/dnszone/records.js";
|
|
3
|
+
import { Value } from "../Value.js";
|
|
4
|
+
export const DnsZoneRecordsTXT = ({ record, }) => {
|
|
5
|
+
if (isTXTRecord(record)) {
|
|
6
|
+
return record.entries.map((a, idx) => _jsx(Value, { children: a }, idx));
|
|
7
|
+
}
|
|
8
|
+
return _jsx(Value, { notSet: true });
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RecordSetManagedByMittwald: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Value } from "../Value.js";
|
|
3
|
+
import { SingleResult } from "../SingleResult.js";
|
|
4
|
+
import { BooleanValue } from "../BooleanValue.js";
|
|
5
|
+
export const DomainBaseDetails = ({ domain }) => {
|
|
6
|
+
const title = (_jsxs(_Fragment, { children: ["DOMAIN: ", _jsx(Value, { children: domain.domain })] }));
|
|
7
|
+
const rows = {
|
|
8
|
+
ID: _jsx(Value, { children: domain.domainId }),
|
|
9
|
+
Connected: _jsx(BooleanValue, { value: domain.connected }),
|
|
10
|
+
Nameservers: _jsx(Value, { children: domain.nameservers.join("\n") }),
|
|
11
|
+
};
|
|
12
|
+
return _jsx(SingleResult, { title: title, rows: rows });
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "ink";
|
|
3
|
+
import { DomainHandle } from "./DomainHandle.js";
|
|
4
|
+
import { DomainBaseDetails } from "./DomainBaseDetails.js";
|
|
5
|
+
export const DomainDetails = ({ domain }) => {
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(DomainBaseDetails, { domain: domain }), _jsx(DomainHandle, { title: "OWNER", handle: domain.handles.ownerC }), _jsx(DomainHandle, { title: "ADMIN", handle: domain.handles.adminC })] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
3
|
+
import DomainHandleReadable = MittwaldAPIV2.Components.Schemas.DomainHandleReadable;
|
|
4
|
+
export declare const DomainHandle: FC<{
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
handle: DomainHandleReadable | undefined;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SingleResult } from "../SingleResult.js";
|
|
3
|
+
import { Value } from "../Value.js";
|
|
4
|
+
import { Text } from "ink";
|
|
5
|
+
export const DomainHandle = ({ title, handle }) => {
|
|
6
|
+
if (handle === undefined) {
|
|
7
|
+
return (_jsx(SingleResult, { title: title, rows: {
|
|
8
|
+
"Handle reference": _jsx(Value, { notSet: true }),
|
|
9
|
+
} }));
|
|
10
|
+
}
|
|
11
|
+
const rows = {
|
|
12
|
+
"Handle reference": _jsx(Value, { children: handle.current.handleRef }),
|
|
13
|
+
};
|
|
14
|
+
for (const handleField of handle.current.handleFields ?? []) {
|
|
15
|
+
const desired = (handle.desired?.handleFields ?? []).find((f) => f.name === handleField.name)?.value;
|
|
16
|
+
if (desired) {
|
|
17
|
+
rows[handleField.name] = (_jsxs(Text, { children: [_jsx(Value, { children: handleField.value }), " updating to", " ", _jsx(Value, { children: desired })] }));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
rows[handleField.name] = _jsx(Value, { children: handleField.value });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return _jsx(SingleResult, { title: title, rows: rows });
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Filename } from "./Filename.js";
|
|
3
|
+
import { getHomeDir } from "@oclif/core/lib/util/os.js";
|
|
4
|
+
import path from "path";
|
|
5
|
+
export const LocalFilename = ({ filename, relative = false, }) => {
|
|
6
|
+
if (relative) {
|
|
7
|
+
filename = path.relative(process.cwd(), filename);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
filename = filename.replace(getHomeDir(), "~");
|
|
11
|
+
}
|
|
12
|
+
filename = filename.replace(process.cwd(), ".");
|
|
13
|
+
return _jsx(Filename, { filename: filename });
|
|
14
|
+
};
|
|
@@ -4,5 +4,5 @@ export const noteColor = "#407FF8";
|
|
|
4
4
|
export const Note = (props) => {
|
|
5
5
|
const { title = "Note", color = noteColor, marginY = 0, raw = false } = props;
|
|
6
6
|
const contents = raw ? (props.children) : (_jsx(Text, { wrap: "wrap", color: color, children: props.children }));
|
|
7
|
-
return (_jsxs(Box, { width: 80, borderStyle: "round", borderColor: color, flexDirection: "column", paddingX: 2, marginY: marginY, children: [_jsx(Text, { bold: true, underline: true, color: color, children: title.toUpperCase() }), contents] }));
|
|
7
|
+
return (_jsxs(Box, { width: 80, borderStyle: "round", borderColor: color, flexDirection: "column", paddingX: 2, marginY: marginY, marginBottom: props.marginBottom, children: [_jsx(Text, { bold: true, underline: true, color: color, children: title.toUpperCase() }), contents] }));
|
|
8
8
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "ink";
|
|
3
|
+
import { Value } from "../Value.js";
|
|
4
|
+
export const ProjectSimpleStatus = (props) => {
|
|
5
|
+
const { status } = props;
|
|
6
|
+
switch (status) {
|
|
7
|
+
case "ready":
|
|
8
|
+
return _jsxs(Text, { color: "green", children: [status, " \uD83D\uDE80"] });
|
|
9
|
+
case "migratingVolume":
|
|
10
|
+
case "pending":
|
|
11
|
+
return _jsxs(Text, { color: "blue", children: [status, " \uD83C\uDFD7"] });
|
|
12
|
+
case "error":
|
|
13
|
+
return _jsxs(Text, { color: "red", children: [status, " \uD83D\uDC80"] });
|
|
14
|
+
case "disabled":
|
|
15
|
+
return _jsxs(Text, { color: "red", children: [status, " \uD83D\uDEAB"] });
|
|
16
|
+
default:
|
|
17
|
+
return _jsx(Value, { notSet: true });
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
3
|
-
import ProjectProjectReadinessStatus = MittwaldAPIV2.Components.Schemas.
|
|
3
|
+
import ProjectProjectReadinessStatus = MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
4
4
|
interface Props {
|
|
5
5
|
/**
|
|
6
6
|
* The project to display the status for.
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
*/
|
|
12
12
|
project: {
|
|
13
13
|
enabled: boolean;
|
|
14
|
-
|
|
14
|
+
status: ProjectProjectReadinessStatus;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export declare const ProjectStatus: FC<Props>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from "ink";
|
|
3
3
|
import { ProjectEnabled } from "./ProjectEnabled.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ProjectSimpleStatus } from "./ProjectSimpleStatus.js";
|
|
5
5
|
export const ProjectStatus = (props) => {
|
|
6
6
|
const { project } = props;
|
|
7
|
-
return (_jsxs(Text, { children: [_jsx(ProjectEnabled, { enabled: project.enabled }), _jsx(Text, { children: " / " }), _jsx(
|
|
7
|
+
return (_jsxs(Text, { children: [_jsx(ProjectEnabled, { enabled: project.enabled }), _jsx(Text, { children: " / " }), _jsx(ProjectSimpleStatus, { status: project.status })] }));
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from "ink";
|
|
3
3
|
export const Value = ({ children, notSet }) => {
|
|
4
|
-
if (notSet) {
|
|
4
|
+
if (notSet || children === undefined) {
|
|
5
5
|
return _jsx(Text, { color: "gray", children: "not set" });
|
|
6
6
|
}
|
|
7
7
|
return _jsx(Text, { color: "blue", children: children });
|