@mittwald/cli 1.0.0-alpha.22 → 1.0.0-alpha.25

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.
Files changed (31) hide show
  1. package/README.md +126 -43
  2. package/dist/esm/commands/app/create/php.d.ts +2 -2
  3. package/dist/esm/commands/app/create/php.js +1 -1
  4. package/dist/esm/commands/app/create/static.d.ts +12 -0
  5. package/dist/esm/commands/app/create/static.js +13 -0
  6. package/dist/esm/commands/database/mysql/list.js +0 -6
  7. package/dist/esm/commands/mail/deliverybox/list.d.ts +11 -4
  8. package/dist/esm/commands/mail/deliverybox/list.js +13 -8
  9. package/dist/esm/commands/project/sftp-user/list.d.ts +9 -3
  10. package/dist/esm/commands/project/sftp-user/list.js +15 -10
  11. package/dist/esm/commands/project/ssh-user/list.d.ts +9 -3
  12. package/dist/esm/commands/project/ssh-user/list.js +13 -10
  13. package/dist/esm/commands/user/get.d.ts +14 -2
  14. package/dist/esm/commands/user/get.js +19 -5
  15. package/dist/esm/lib/app/flags.d.ts +1 -0
  16. package/dist/esm/lib/app/flags.js +6 -0
  17. package/dist/esm/lib/app/install.js +23 -0
  18. package/dist/esm/rendering/react/components/AppInstallation/AppInstallationDetails.js +10 -0
  19. package/package.json +1 -1
  20. package/dist/esm/generated/mail/deliveryboxList.d.ts +0 -13
  21. package/dist/esm/generated/mail/deliveryboxList.js +0 -22
  22. package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.d.ts +0 -16
  23. package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.js +0 -25
  24. package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.d.ts +0 -13
  25. package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.js +0 -22
  26. package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.d.ts +0 -16
  27. package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.js +0 -25
  28. package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.d.ts +0 -13
  29. package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.js +0 -22
  30. package/dist/esm/generated/user/getUser.d.ts +0 -14
  31. package/dist/esm/generated/user/getUser.js +0 -16
package/README.md CHANGED
@@ -82,6 +82,7 @@ USAGE
82
82
  * [`mw app copy INSTALLATION-ID`](#mw-app-copy-installation-id)
83
83
  * [`mw app create node`](#mw-app-create-node)
84
84
  * [`mw app create php`](#mw-app-create-php)
85
+ * [`mw app create static`](#mw-app-create-static)
85
86
  * [`mw app dependency list`](#mw-app-dependency-list)
86
87
  * [`mw app dependency update INSTALLATION-ID`](#mw-app-dependency-update-installation-id)
87
88
  * [`mw app dependency versions SYSTEMSOFTWARE`](#mw-app-dependency-versions-systemsoftware)
@@ -188,7 +189,7 @@ USAGE
188
189
  * [`mw user api-token get APITOKENID`](#mw-user-api-token-get-apitokenid)
189
190
  * [`mw user api-token list`](#mw-user-api-token-list)
190
191
  * [`mw user api-token revoke ID`](#mw-user-api-token-revoke-id)
191
- * [`mw user get`](#mw-user-get)
192
+ * [`mw user get USER-ID`](#mw-user-get-user-id)
192
193
  * [`mw user session get TOKENID`](#mw-user-session-get-tokenid)
193
194
  * [`mw user session list`](#mw-user-session-list)
194
195
  * [`mw user ssh-key create`](#mw-user-ssh-key-create)
@@ -265,13 +266,15 @@ Creates new custom PHP installation.
265
266
 
266
267
  ```
267
268
  USAGE
268
- $ mw app create php [-p <value>] [-q] [--site-title <value>] [-w] [--json]
269
+ $ mw app create php --document-root <value> [-p <value>] [-q] [--site-title <value>] [-w] [--json]
269
270
 
270
271
  FLAGS
271
272
  -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
272
273
  context
273
274
  -q, --quiet suppress process output and only display a machine-readable summary.
274
275
  -w, --wait Wait for your custom PHP to be ready.
276
+ --document-root=<value> (required) [default: /] The document root from which your custom PHP will be served
277
+ (relative to the installation path)
275
278
  --json
276
279
  --site-title=<value> Site Title for your custom PHP installation.
277
280
 
@@ -289,6 +292,13 @@ FLAG DESCRIPTIONS
289
292
  This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
290
293
  scripts), you can use this flag to easily get the IDs of created resources for further processing.
291
294
 
295
+ --document-root=<value>
296
+
297
+ The document root from which your custom PHP will be served (relative to the installation path)
298
+
299
+ This is the document root from which the files of your application will be served by the web server. This directory
300
+ is specified relative to the installation path.
301
+
292
302
  --site-title=<value> Site Title for your custom PHP installation.
293
303
 
294
304
  Site Title which will be displayed in the Tab and at the top of the Frontend of your custom PHP installation.
@@ -297,6 +307,54 @@ FLAG DESCRIPTIONS
297
307
  installation is finished
298
308
  ```
299
309
 
310
+ ## `mw app create static`
311
+
312
+ Creates new custom static site installation.
313
+
314
+ ```
315
+ USAGE
316
+ $ mw app create static --document-root <value> [-p <value>] [-q] [--site-title <value>] [-w] [--json]
317
+
318
+ FLAGS
319
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
320
+ context
321
+ -q, --quiet suppress process output and only display a machine-readable summary.
322
+ -w, --wait Wait for your custom static site to be ready.
323
+ --document-root=<value> (required) [default: /] The document root from which your custom static site will be served
324
+ (relative to the installation path)
325
+ --json
326
+ --site-title=<value> Site Title for your custom static site installation.
327
+
328
+ DESCRIPTION
329
+ Creates new custom static site installation.
330
+
331
+ FLAG DESCRIPTIONS
332
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the context
333
+
334
+ May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=<VALUE>" command
335
+ to persistently set a default project for all commands that accept this flag.
336
+
337
+ -q, --quiet suppress process output and only display a machine-readable summary.
338
+
339
+ This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in
340
+ scripts), you can use this flag to easily get the IDs of created resources for further processing.
341
+
342
+ --document-root=<value>
343
+
344
+ The document root from which your custom static site will be served (relative to the installation path)
345
+
346
+ This is the document root from which the files of your application will be served by the web server. This directory
347
+ is specified relative to the installation path.
348
+
349
+ --site-title=<value> Site Title for your custom static site installation.
350
+
351
+ Site Title which will be displayed in the Tab and at the top of the Frontend of your custom static site
352
+ installation.
353
+ It is also the Title shown in the App-Overview in the mStudio.
354
+ If none is given the Software Name and the given Project will be used. The Title can be changed after the
355
+ installation is finished
356
+ ```
357
+
300
358
  ## `mw app dependency list`
301
359
 
302
360
  Get all available dependencies
@@ -2283,23 +2341,30 @@ Get all deliveryboxes by project ID
2283
2341
 
2284
2342
  ```
2285
2343
  USAGE
2286
- $ mw mail deliverybox list --project-id <value> [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output
2344
+ $ mw mail deliverybox list [-p <value>] [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output
2287
2345
  csv|json|yaml | | [--csv | --no-truncate]] [--no-header | ]
2288
2346
 
2289
2347
  FLAGS
2290
- -x, --extended show extra columns
2291
- --columns=<value> only show provided columns (comma-separated)
2292
- --csv output is csv format [alias: --output=csv]
2293
- --filter=<value> filter property by partial string matching, ex: name=foo
2294
- --no-header hide table header from output
2295
- --no-truncate do not truncate output to fit screen
2296
- --output=<option> output in a more machine friendly format
2297
- <options: csv|json|yaml>
2298
- --project-id=<value> (required) Project ID the deliveryboxes are related to
2299
- --sort=<value> property to sort by (prepend '-' for descending)
2348
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
2349
+ context
2350
+ -x, --extended show extra columns
2351
+ --columns=<value> only show provided columns (comma-separated)
2352
+ --csv output is csv format [alias: --output=csv]
2353
+ --filter=<value> filter property by partial string matching, ex: name=foo
2354
+ --no-header hide table header from output
2355
+ --no-truncate do not truncate output to fit screen
2356
+ --output=<option> output in a more machine friendly format
2357
+ <options: csv|json|yaml>
2358
+ --sort=<value> property to sort by (prepend '-' for descending)
2300
2359
 
2301
2360
  DESCRIPTION
2302
2361
  Get all deliveryboxes by project ID
2362
+
2363
+ FLAG DESCRIPTIONS
2364
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the context
2365
+
2366
+ May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=<VALUE>" command
2367
+ to persistently set a default project for all commands that accept this flag.
2303
2368
  ```
2304
2369
 
2305
2370
  ## `mw org delete [ORG-ID]`
@@ -3138,27 +3203,34 @@ DESCRIPTION
3138
3203
 
3139
3204
  ## `mw project sftp-user list`
3140
3205
 
3141
- Get all SFTPUsers for a Project.
3206
+ List all SFTP users for a project.
3142
3207
 
3143
3208
  ```
3144
3209
  USAGE
3145
- $ mw project sftp-user list --project-id <value> [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output
3146
- csv|json|yaml | | [--csv | --no-truncate]] [--no-header | ]
3210
+ $ mw project sftp-user list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
3211
+ [--csv | --no-truncate]] [--no-header | ] [-p <value>]
3147
3212
 
3148
3213
  FLAGS
3149
- -x, --extended show extra columns
3150
- --columns=<value> only show provided columns (comma-separated)
3151
- --csv output is csv format [alias: --output=csv]
3152
- --filter=<value> filter property by partial string matching, ex: name=foo
3153
- --no-header hide table header from output
3154
- --no-truncate do not truncate output to fit screen
3155
- --output=<option> output in a more machine friendly format
3156
- <options: csv|json|yaml>
3157
- --project-id=<value> (required) ID of the Project to request SFTPUsers for.
3158
- --sort=<value> property to sort by (prepend '-' for descending)
3214
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
3215
+ context
3216
+ -x, --extended show extra columns
3217
+ --columns=<value> only show provided columns (comma-separated)
3218
+ --csv output is csv format [alias: --output=csv]
3219
+ --filter=<value> filter property by partial string matching, ex: name=foo
3220
+ --no-header hide table header from output
3221
+ --no-truncate do not truncate output to fit screen
3222
+ --output=<option> output in a more machine friendly format
3223
+ <options: csv|json|yaml>
3224
+ --sort=<value> property to sort by (prepend '-' for descending)
3159
3225
 
3160
3226
  DESCRIPTION
3161
- Get all SFTPUsers for a Project.
3227
+ List all SFTP users for a project.
3228
+
3229
+ FLAG DESCRIPTIONS
3230
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the context
3231
+
3232
+ May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=<VALUE>" command
3233
+ to persistently set a default project for all commands that accept this flag.
3162
3234
  ```
3163
3235
 
3164
3236
  ## `mw project ssh [PROJECT-ID]`
@@ -3178,27 +3250,34 @@ DESCRIPTION
3178
3250
 
3179
3251
  ## `mw project ssh-user list`
3180
3252
 
3181
- Get all SSHUsers for a Project.
3253
+ List all SSH users for a project.
3182
3254
 
3183
3255
  ```
3184
3256
  USAGE
3185
- $ mw project ssh-user list --project-id <value> [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output
3186
- csv|json|yaml | | [--csv | --no-truncate]] [--no-header | ]
3257
+ $ mw project ssh-user list [--columns <value> | -x] [--sort <value>] [--filter <value>] [--output csv|json|yaml | |
3258
+ [--csv | --no-truncate]] [--no-header | ] [-p <value>]
3187
3259
 
3188
3260
  FLAGS
3189
- -x, --extended show extra columns
3190
- --columns=<value> only show provided columns (comma-separated)
3191
- --csv output is csv format [alias: --output=csv]
3192
- --filter=<value> filter property by partial string matching, ex: name=foo
3193
- --no-header hide table header from output
3194
- --no-truncate do not truncate output to fit screen
3195
- --output=<option> output in a more machine friendly format
3196
- <options: csv|json|yaml>
3197
- --project-id=<value> (required) ID of the Project to retrieve SSHUsers for.
3198
- --sort=<value> property to sort by (prepend '-' for descending)
3261
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the
3262
+ context
3263
+ -x, --extended show extra columns
3264
+ --columns=<value> only show provided columns (comma-separated)
3265
+ --csv output is csv format [alias: --output=csv]
3266
+ --filter=<value> filter property by partial string matching, ex: name=foo
3267
+ --no-header hide table header from output
3268
+ --no-truncate do not truncate output to fit screen
3269
+ --output=<option> output in a more machine friendly format
3270
+ <options: csv|json|yaml>
3271
+ --sort=<value> property to sort by (prepend '-' for descending)
3199
3272
 
3200
3273
  DESCRIPTION
3201
- Get all SSHUsers for a Project.
3274
+ List all SSH users for a project.
3275
+
3276
+ FLAG DESCRIPTIONS
3277
+ -p, --project-id=<value> ID or short ID of a project; this flag is optional if a default project is set in the context
3278
+
3279
+ May contain a short ID or a full ID of a project; you can also use the "mw context set --project-id=<VALUE>" command
3280
+ to persistently set a default project for all commands that accept this flag.
3202
3281
  ```
3203
3282
 
3204
3283
  ## `mw project update [PROJECT-ID]`
@@ -3389,13 +3468,17 @@ FLAG DESCRIPTIONS
3389
3468
  scripts), you can use this flag to easily get the IDs of created resources for further processing.
3390
3469
  ```
3391
3470
 
3392
- ## `mw user get`
3471
+ ## `mw user get USER-ID`
3393
3472
 
3394
3473
  Get profile information for a user.
3395
3474
 
3396
3475
  ```
3397
3476
  USAGE
3398
- $ mw user get [-o json|yaml | | ]
3477
+ $ mw user get USER-ID [-o json|yaml | | ]
3478
+
3479
+ ARGUMENTS
3480
+ USER-ID [default: self] The user ID to get information for; defaults to the special value 'self', which references to
3481
+ the currently authenticated user.
3399
3482
 
3400
3483
  FLAGS
3401
3484
  -o, --output=<option> output in a more machine friendly format
@@ -1,10 +1,10 @@
1
1
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
2
  import React from "react";
3
3
  import { AppInstallationResult, AppInstaller } from "../../../lib/app/Installer.js";
4
- export declare const phpInstaller: AppInstaller<"site-title" | "wait">;
4
+ export declare const phpInstaller: AppInstaller<"site-title" | "document-root" | "wait">;
5
5
  export default class InstallPhp extends ExecRenderBaseCommand<typeof InstallPhp, AppInstallationResult> {
6
6
  static description: string;
7
- static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("site-title" | "wait")[]>>;
7
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("site-title" | "document-root" | "wait")[]>>;
8
8
  protected exec(): Promise<{
9
9
  appInstallationId: string;
10
10
  }>;
@@ -1,6 +1,6 @@
1
1
  import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
2
  import { AppInstaller, } from "../../../lib/app/Installer.js";
3
- export const phpInstaller = new AppInstaller("34220303-cb87-4592-8a95-2eb20a97b2ac", "custom PHP", ["site-title", "wait"]);
3
+ export const phpInstaller = new AppInstaller("34220303-cb87-4592-8a95-2eb20a97b2ac", "custom PHP", ["document-root", "site-title", "wait"]);
4
4
  export default class InstallPhp extends ExecRenderBaseCommand {
5
5
  static description = phpInstaller.description;
6
6
  static flags = phpInstaller.flags;
@@ -0,0 +1,12 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import React from "react";
3
+ import { AppInstallationResult, AppInstaller } from "../../../lib/app/Installer.js";
4
+ export declare const staticInstaller: AppInstaller<"site-title" | "document-root" | "wait">;
5
+ export default class InstallNode extends ExecRenderBaseCommand<typeof InstallNode, AppInstallationResult> {
6
+ static description: string;
7
+ static flags: import("@oclif/core/lib/interfaces/parser.js").FlagInput<import("../../../lib/app/flags.js").RelevantFlags<readonly ("site-title" | "document-root" | "wait")[]>>;
8
+ protected exec(): Promise<{
9
+ appInstallationId: string;
10
+ }>;
11
+ protected render(result: AppInstallationResult): React.ReactNode;
12
+ }
@@ -0,0 +1,13 @@
1
+ import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
2
+ import { AppInstaller, } from "../../../lib/app/Installer.js";
3
+ export const staticInstaller = new AppInstaller("d20baefd-81d2-42aa-bfba-9a3220ae839b", "custom static site", ["document-root", "site-title", "wait"]);
4
+ export default class InstallNode extends ExecRenderBaseCommand {
5
+ static description = staticInstaller.description;
6
+ static flags = staticInstaller.flags;
7
+ async exec() {
8
+ return staticInstaller.exec(this.apiClient, this.args, this.flags, this.config);
9
+ }
10
+ render(result) {
11
+ return staticInstaller.render(result, this.flags);
12
+ }
13
+ }
@@ -1,4 +1,3 @@
1
- import { formatBytes } from "../../../lib/viewhelpers/size.js";
2
1
  import { ListBaseCommand } from "../../../ListBaseCommand.js";
3
2
  import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
4
3
  export class List extends ListBaseCommand {
@@ -53,11 +52,6 @@ export class List extends ListBaseCommand {
53
52
  get: (row) => row.characterSettings?.collation,
54
53
  extended: true,
55
54
  },
56
- size: {
57
- header: "Size",
58
- // there is an error in the API mapping
59
- get: (row) => formatBytes(row.size.low),
60
- },
61
55
  createdAt: commonColumns.createdAt,
62
56
  };
63
57
  }
@@ -1,12 +1,19 @@
1
1
  import { Simplify } from "@mittwald/api-client-commons";
2
- import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
3
  import { SuccessfulResponse } from "../../../types.js";
4
- import { GeneratedMailDeliveryboxList, PathParams, Response } from "../../../generated/mail/deliveryboxList.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Responses.$200.Content.ApplicationJson[number]>;
7
- export default class List extends GeneratedMailDeliveryboxList<ResponseItem> {
7
+ export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Parameters.Path;
8
+ export type Response = Awaited<ReturnType<MittwaldAPIV2Client["mail"]["deliveryboxList"]>>;
9
+ export declare class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
14
+ };
15
+ getData(): Promise<Response>;
8
16
  protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.MailDeliverybox[];
9
- protected mapParams(input: PathParams): Promise<PathParams>;
10
17
  protected getColumns(data: ResponseItem[]): ListColumns<ResponseItem>;
11
18
  }
12
19
  export {};
@@ -1,15 +1,20 @@
1
- import { GeneratedMailDeliveryboxList, } from "../../../generated/mail/deliveryboxList.js";
2
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
3
1
  import { formatRelativeDate } from "../../../lib/viewhelpers/date.js";
4
- export default class List extends GeneratedMailDeliveryboxList {
2
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
3
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
4
+ export class List extends ListBaseCommand {
5
+ static description = "Get all deliveryboxes by project ID";
6
+ static args = {};
7
+ static flags = {
8
+ ...projectFlags,
9
+ ...ListBaseCommand.baseFlags,
10
+ };
11
+ async getData() {
12
+ const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
13
+ return await this.apiClient.mail.deliveryboxList({ projectId });
14
+ }
5
15
  mapData(data) {
6
- console.log(data);
7
16
  return data;
8
17
  }
9
- async mapParams(input) {
10
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
11
- return super.mapParams(input);
12
- }
13
18
  getColumns(data) {
14
19
  const baseColumns = super.getColumns(data);
15
20
  return {
@@ -1,13 +1,19 @@
1
- import { GeneratedSftpUserListSftpUsers, PathParams } from "../../../generated/sshsftpUser/sftpUserListSftpUsers.js";
2
1
  import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
2
  import { Simplify } from "@mittwald/api-client-commons";
4
3
  import { SuccessfulResponse } from "../../../types.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type SftpUserResponse = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserListSftpUsers"]>>;
7
7
  type SftpUserResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdSftpUsers.Get.Responses.$200.Content.ApplicationJson[number]>;
8
- export default class List extends GeneratedSftpUserListSftpUsers<SftpUserResponseItem> {
8
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserListSftpUsers"]>>;
9
+ export default class List extends ListBaseCommand<typeof List, SftpUserResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
14
+ };
15
+ getData(): Promise<Response>;
9
16
  protected mapData(data: SuccessfulResponse<SftpUserResponse, 200>["data"]): SftpUserResponseItem[];
10
- protected mapParams(input: PathParams): Promise<PathParams>;
11
17
  protected getColumns(data: SftpUserResponseItem[]): ListColumns<SftpUserResponseItem>;
12
18
  }
13
19
  export {};
@@ -1,16 +1,21 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedSftpUserListSftpUsers } from "../../../generated/sshsftpUser/sftpUserListSftpUsers.js";
5
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
6
- export default class List extends GeneratedSftpUserListSftpUsers {
1
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
3
+ export default class List extends ListBaseCommand {
4
+ static description = "List all SFTP users for a project.";
5
+ static args = {};
6
+ static flags = {
7
+ ...ListBaseCommand.baseFlags,
8
+ ...projectFlags,
9
+ };
10
+ async getData() {
11
+ const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
+ return await this.apiClient.sshsftpUser.sftpUserListSftpUsers({
13
+ projectId,
14
+ });
15
+ }
7
16
  mapData(data) {
8
17
  return data;
9
18
  }
10
- async mapParams(input) {
11
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
12
- return super.mapParams(input);
13
- }
14
19
  getColumns(data) {
15
20
  const baseColumns = super.getColumns(data);
16
21
  return {
@@ -1,13 +1,19 @@
1
- import { GeneratedSshUserListSshUsers, PathParams } from "../../../generated/sshsftpUser/sshUserListSshUsers.js";
2
1
  import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
3
2
  import { Simplify } from "@mittwald/api-client-commons";
4
3
  import { SuccessfulResponse } from "../../../types.js";
5
4
  import { ListColumns } from "../../../Formatter.js";
5
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
6
6
  type SshUserResponse = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserListSftpUsers"]>>;
7
7
  type SshUserResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdSftpUsers.Get.Responses.$200.Content.ApplicationJson[number]>;
8
- export default class Get extends GeneratedSshUserListSshUsers<SshUserResponseItem> {
8
+ type Response = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sshUserListSshUsers"]>>;
9
+ export declare class List extends ListBaseCommand<typeof List, SshUserResponseItem, Response> {
10
+ static description: string;
11
+ static args: {};
12
+ static flags: {
13
+ "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string>;
14
+ };
15
+ getData(): Promise<Response>;
9
16
  protected mapData(data: SuccessfulResponse<SshUserResponse, 200>["data"]): SshUserResponseItem[];
10
- protected mapParams(input: PathParams): Promise<PathParams>;
11
17
  protected getColumns(data: SshUserResponseItem[]): ListColumns<SshUserResponseItem>;
12
18
  }
13
19
  export {};
@@ -1,16 +1,19 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedSshUserListSshUsers } from "../../../generated/sshsftpUser/sshUserListSshUsers.js";
5
- import { normalizeProjectIdToUuid } from "../../../Helpers.js";
6
- export default class Get extends GeneratedSshUserListSshUsers {
1
+ import { ListBaseCommand } from "../../../ListBaseCommand.js";
2
+ import { projectFlags, withProjectId } from "../../../lib/project/flags.js";
3
+ export class List extends ListBaseCommand {
4
+ static description = "List all SSH users for a project.";
5
+ static args = {};
6
+ static flags = {
7
+ ...ListBaseCommand.baseFlags,
8
+ ...projectFlags,
9
+ };
10
+ async getData() {
11
+ const projectId = await withProjectId(this.apiClient, List, this.flags, this.args, this.config);
12
+ return await this.apiClient.sshsftpUser.sshUserListSshUsers({ projectId });
13
+ }
7
14
  mapData(data) {
8
15
  return data;
9
16
  }
10
- async mapParams(input) {
11
- input.projectId = await normalizeProjectIdToUuid(this.apiClient, input.projectId);
12
- return super.mapParams(input);
13
- }
14
17
  getColumns(data) {
15
18
  const baseColumns = super.getColumns(data);
16
19
  return {
@@ -1,3 +1,15 @@
1
- import { GeneratedUserGetUser } from "../../generated/user/getUser.js";
2
- export default class Get extends GeneratedUserGetUser {
1
+ import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ import { GetBaseCommand } from "../../GetBaseCommand.js";
3
+ export type PathParams = MittwaldAPIV2.Paths.V2UsersUserId.Get.Parameters.Path;
4
+ type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getUser"]>>;
5
+ export default class Get extends GetBaseCommand<typeof Get, APIResponse> {
6
+ static description: string;
7
+ static flags: {
8
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
9
+ };
10
+ static args: {
11
+ "user-id": import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
+ };
13
+ protected getData(): Promise<APIResponse>;
3
14
  }
15
+ export {};
@@ -1,6 +1,20 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { GeneratedUserGetUser } from "../../generated/user/getUser.js";
5
- export default class Get extends GeneratedUserGetUser {
1
+ import { GetBaseCommand } from "../../GetBaseCommand.js";
2
+ import { Args } from "@oclif/core";
3
+ export default class Get extends GetBaseCommand {
4
+ static description = "Get profile information for a user.";
5
+ static flags = {
6
+ ...GetBaseCommand.baseFlags,
7
+ };
8
+ static args = {
9
+ "user-id": Args.string({
10
+ description: "The user ID to get information for; defaults to the special value 'self', which references to the currently authenticated user.",
11
+ default: "self",
12
+ required: true,
13
+ }),
14
+ };
15
+ async getData() {
16
+ return await this.apiClient.user.getUser({
17
+ userId: this.args["user-id"],
18
+ });
19
+ }
6
20
  }
@@ -19,6 +19,7 @@ interface AvailableFlags {
19
19
  "shop-lang": OptionFlag<string | undefined>;
20
20
  "shop-currency": OptionFlag<string | undefined>;
21
21
  "install-mode": OptionFlag<string>;
22
+ "document-root": OptionFlag<string>;
22
23
  wait: BooleanFlag<boolean | undefined>;
23
24
  }
24
25
  export type RelevantFlags<TFlags extends readonly AvailableFlagName[]> = ProcessFlags & Pick<AvailableFlags, TFlags[number]>;
@@ -96,6 +96,12 @@ function buildFlagsWithDescription(appName) {
96
96
  options: ["composer", "symlink"],
97
97
  default: "composer",
98
98
  }),
99
+ "document-root": Flags.string({
100
+ required: true,
101
+ summary: `The document root from which your ${appName} will be served (relative to the installation path)`,
102
+ description: "This is the document root from which the files of your application will be served by the web server. This directory is specified relative to the installation path.",
103
+ default: "/",
104
+ }),
99
105
  wait: Flags.boolean({
100
106
  char: "w",
101
107
  description: `Wait for your ${appName} to be ready.`,
@@ -16,5 +16,28 @@ export async function triggerAppInstallation(apiClient, process, projectId, flag
16
16
  assertStatus(result, 201);
17
17
  return [result.data.id, result.headers["etag"]];
18
18
  });
19
+ await process.runStep("waiting for installation to be retrievable", async () => {
20
+ for (let attempts = 0; attempts < 10; attempts++) {
21
+ const result = await apiClient.app.getAppinstallation({
22
+ appInstallationId,
23
+ });
24
+ if (result.status === 200) {
25
+ return result.data;
26
+ }
27
+ await new Promise((resolve) => setTimeout(resolve, 100));
28
+ }
29
+ });
30
+ if ("document-root" in flags && flags["document-root"] !== "/") {
31
+ await process.runStep("setting document root", async () => {
32
+ const result = await apiClient.app.patchAppinstallation({
33
+ appInstallationId,
34
+ headers: { "if-event-reached": eventId },
35
+ data: {
36
+ customDocumentRoot: flags["document-root"],
37
+ },
38
+ });
39
+ assertStatus(result, 204);
40
+ });
41
+ }
19
42
  return [appInstallationId, eventId];
20
43
  }
@@ -7,19 +7,29 @@ import { AppSystemSoftware } from "./AppSystemSoftware.js";
7
7
  import { Box, Text } from "ink";
8
8
  import { phpInstaller } from "../../../../commands/app/create/php.js";
9
9
  import { nodeInstaller } from "../../../../commands/app/create/node.js";
10
+ import { useProject } from "../../../../lib/project/hooks.js";
11
+ import { IDAndShortID } from "../IDAndShortID.js";
10
12
  export const AppInstallationDetails = ({ app, appInstallation }) => {
11
13
  const customInstallation = [phpInstaller.appId, nodeInstaller.appId].includes(app.id);
12
14
  const desiredAppVersion = useAppVersion(app.id, appInstallation.appVersion.desired);
13
15
  const currentAppVersion = appInstallation.appVersion.current
14
16
  ? useAppVersion(app.id, appInstallation.appVersion.current)
15
17
  : undefined;
18
+ const project = appInstallation.projectId
19
+ ? useProject(appInstallation.projectId)
20
+ : null;
16
21
  const rows = {
17
22
  "Installation ID": _jsx(Value, { children: appInstallation.id }),
18
23
  App: (_jsx(SingleResultTable, { rows: {
19
24
  ID: _jsx(Value, { children: app.id }),
20
25
  Name: _jsx(Value, { children: app.name }),
21
26
  } })),
27
+ Project: project ? (_jsx(SingleResultTable, { rows: {
28
+ ID: _jsx(IDAndShortID, { object: project }),
29
+ Description: _jsx(Value, { children: project.description }),
30
+ } })) : (_jsx(Value, { notSet: true })),
22
31
  "Installation Path": _jsx(Value, { children: appInstallation.installationPath }),
32
+ "Document root (in installation path)": (_jsx(Value, { children: appInstallation.customDocumentRoot ?? "/" })),
23
33
  Description: _jsx(Value, { children: appInstallation.description }),
24
34
  Status: customInstallation ? (_jsx(Text, { children: "custom application" })) : (_jsx(AppInstallationStatus, { appInstallation: appInstallation, desired: desiredAppVersion, current: currentAppVersion })),
25
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/cli",
3
- "version": "1.0.0-alpha.22",
3
+ "version": "1.0.0-alpha.25",
4
4
  "description": "Hand-crafted CLI for the mittwald API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,13 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdDeliveryboxes.Get.Parameters.Path;
4
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["mail"]["deliveryboxList"]>>;
5
- export declare abstract class GeneratedMailDeliveryboxList<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedMailDeliveryboxList, TItem, Response> {
6
- static description: string;
7
- static args: {};
8
- static flags: {
9
- "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- };
11
- getData(): Promise<Response>;
12
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
13
- }
@@ -1,22 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export class GeneratedMailDeliveryboxList extends ListBaseCommand {
4
- static description = "Get all deliveryboxes by project ID";
5
- static args = {};
6
- static flags = {
7
- ...ListBaseCommand.baseFlags,
8
- "project-id": Flags.string({
9
- description: "Project ID the deliveryboxes are related to",
10
- required: true,
11
- }),
12
- };
13
- async getData() {
14
- const pathParams = {
15
- projectId: this.flags["project-id"],
16
- };
17
- return await this.apiClient.mail.deliveryboxList((await this.mapParams(pathParams)));
18
- }
19
- mapParams(input) {
20
- return input;
21
- }
22
- }
@@ -1,16 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { GetBaseCommand } from "../../GetBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2SftpUsersSftpUserId.Get.Parameters.Path;
4
- type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserGetSftpUser"]>>;
5
- export declare abstract class GeneratedSftpUserGetSftpUser extends GetBaseCommand<typeof GeneratedSftpUserGetSftpUser, APIResponse> {
6
- static description: string;
7
- static flags: {
8
- [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
9
- };
10
- static args: {
11
- sftpUserId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
- };
13
- protected getData(): Promise<APIResponse>;
14
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
15
- }
16
- export {};
@@ -1,25 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { Args } from "@oclif/core";
5
- import { GetBaseCommand } from "../../GetBaseCommand.js";
6
- export class GeneratedSftpUserGetSftpUser extends GetBaseCommand {
7
- static description = "Get an SFTPUser.";
8
- static flags = {
9
- ...GetBaseCommand.baseFlags,
10
- };
11
- static args = {
12
- sftpUserId: Args.string({
13
- description: "ID of the SFTPUser to get.",
14
- required: true,
15
- }),
16
- };
17
- async getData() {
18
- return await this.apiClient.sshsftpUser.sftpUserGetSftpUser({
19
- ...(await this.mapParams(this.args)),
20
- });
21
- }
22
- mapParams(input) {
23
- return input;
24
- }
25
- }
@@ -1,13 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdSftpUsers.Get.Parameters.Path;
4
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserListSftpUsers"]>>;
5
- export declare abstract class GeneratedSftpUserListSftpUsers<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedSftpUserListSftpUsers, TItem, Response> {
6
- static description: string;
7
- static args: {};
8
- static flags: {
9
- "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- };
11
- getData(): Promise<Response>;
12
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
13
- }
@@ -1,22 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export class GeneratedSftpUserListSftpUsers extends ListBaseCommand {
4
- static description = "Get all SFTPUsers for a Project.";
5
- static args = {};
6
- static flags = {
7
- ...ListBaseCommand.baseFlags,
8
- "project-id": Flags.string({
9
- description: "ID of the Project to request SFTPUsers for.",
10
- required: true,
11
- }),
12
- };
13
- async getData() {
14
- const pathParams = {
15
- projectId: this.flags["project-id"],
16
- };
17
- return await this.apiClient.sshsftpUser.sftpUserListSftpUsers((await this.mapParams(pathParams)));
18
- }
19
- mapParams(input) {
20
- return input;
21
- }
22
- }
@@ -1,16 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { GetBaseCommand } from "../../GetBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2SshUsersSshUserId.Get.Parameters.Path;
4
- type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sshUserGetSshUser"]>>;
5
- export declare abstract class GeneratedSshUserGetSshUser extends GetBaseCommand<typeof GeneratedSshUserGetSshUser, APIResponse> {
6
- static description: string;
7
- static flags: {
8
- [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
9
- };
10
- static args: {
11
- sshUserId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
12
- };
13
- protected getData(): Promise<APIResponse>;
14
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
15
- }
16
- export {};
@@ -1,25 +0,0 @@
1
- /* eslint-disable */
2
- /* prettier-ignore */
3
- /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
- import { Args } from "@oclif/core";
5
- import { GetBaseCommand } from "../../GetBaseCommand.js";
6
- export class GeneratedSshUserGetSshUser extends GetBaseCommand {
7
- static description = "Get an SSHUser.";
8
- static flags = {
9
- ...GetBaseCommand.baseFlags,
10
- };
11
- static args = {
12
- sshUserId: Args.string({
13
- description: "ID of the SSHUser to be retrieved.",
14
- required: true,
15
- }),
16
- };
17
- async getData() {
18
- return await this.apiClient.sshsftpUser.sshUserGetSshUser({
19
- ...(await this.mapParams(this.args)),
20
- });
21
- }
22
- mapParams(input) {
23
- return input;
24
- }
25
- }
@@ -1,13 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2ProjectsProjectIdSshUsers.Get.Parameters.Path;
4
- export type Response = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sshUserListSshUsers"]>>;
5
- export declare abstract class GeneratedSshUserListSshUsers<TItem extends Record<string, unknown>> extends ListBaseCommand<typeof GeneratedSshUserListSshUsers, TItem, Response> {
6
- static description: string;
7
- static args: {};
8
- static flags: {
9
- "project-id": import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- };
11
- getData(): Promise<Response>;
12
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
13
- }
@@ -1,22 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { ListBaseCommand } from "../../ListBaseCommand.js";
3
- export class GeneratedSshUserListSshUsers extends ListBaseCommand {
4
- static description = "Get all SSHUsers for a Project.";
5
- static args = {};
6
- static flags = {
7
- ...ListBaseCommand.baseFlags,
8
- "project-id": Flags.string({
9
- description: "ID of the Project to retrieve SSHUsers for.",
10
- required: true,
11
- }),
12
- };
13
- async getData() {
14
- const pathParams = {
15
- projectId: this.flags["project-id"],
16
- };
17
- return await this.apiClient.sshsftpUser.sshUserListSshUsers((await this.mapParams(pathParams)));
18
- }
19
- mapParams(input) {
20
- return input;
21
- }
22
- }
@@ -1,14 +0,0 @@
1
- import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
2
- import { GetBaseCommand } from "../../GetBaseCommand.js";
3
- export type PathParams = MittwaldAPIV2.Paths.V2UsersUserId.Get.Parameters.Path;
4
- type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getUser"]>>;
5
- export declare abstract class GeneratedUserGetUser extends GetBaseCommand<typeof GeneratedUserGetUser, APIResponse> {
6
- static description: string;
7
- static flags: {
8
- [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
9
- };
10
- static args: {};
11
- protected getData(): Promise<APIResponse>;
12
- protected mapParams(input: PathParams): Promise<PathParams> | PathParams;
13
- }
14
- export {};
@@ -1,16 +0,0 @@
1
- import { GetBaseCommand } from "../../GetBaseCommand.js";
2
- export class GeneratedUserGetUser extends GetBaseCommand {
3
- static description = "Get profile information for a user.";
4
- static flags = {
5
- ...GetBaseCommand.baseFlags,
6
- };
7
- static args = {};
8
- async getData() {
9
- return await this.apiClient.user.getUser({
10
- ...(await this.mapParams(this.args)),
11
- });
12
- }
13
- mapParams(input) {
14
- return input;
15
- }
16
- }