@mittwald/cli 1.0.0-alpha.30 → 1.0.0-alpha.32

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 CHANGED
@@ -2925,7 +2925,7 @@ DESCRIPTION
2925
2925
  Display help for mw.
2926
2926
  ```
2927
2927
 
2928
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.9/src/commands/help.ts)_
2928
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.12/src/commands/help.ts)_
2929
2929
 
2930
2930
  ## `mw login reset`
2931
2931
 
@@ -4242,7 +4242,7 @@ EXAMPLES
4242
4242
  $ mw update --available
4243
4243
  ```
4244
4244
 
4245
- _See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v4.1.7/src/commands/update.ts)_
4245
+ _See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v4.1.8/src/commands/update.ts)_
4246
4246
 
4247
4247
  ## `mw user api-token create`
4248
4248
 
@@ -36,6 +36,7 @@ export class UserContextProvider {
36
36
  output[k] = val;
37
37
  }
38
38
  }
39
+ await fs.mkdir(this.config.configDir, { recursive: true });
39
40
  await fs.writeFile(path.join(this.config.configDir, "context.json"), JSON.stringify(output), "utf-8");
40
41
  }
41
42
  }
@@ -1,5 +1,6 @@
1
- import { normalizeProjectIdToUuid } from "../../Helpers.js";
1
+ import { isUuid, normalizeProjectIdToUuid } from "../../Helpers.js";
2
2
  import { makeFlagSet, makeMissingContextInputError, } from "../context_flags.js";
3
+ import { Context } from "../context.js";
3
4
  import { Args, Flags } from "@oclif/core";
4
5
  export const { flags: projectFlags, args: projectArgs, withId: withProjectId, } = makeFlagSet("project", "p", { normalize: normalizeProjectIdToUuid });
5
6
  export function makeProjectFlagSet(name, char, opts = {}) {
@@ -37,11 +38,18 @@ export function makeProjectFlagSet(name, char, opts = {}) {
37
38
  return undefined;
38
39
  };
39
40
  const withId = async (apiClient, commandType, flags, args, cfg) => {
40
- const projectId = await withProjectId(apiClient, commandType, flags, args, cfg);
41
41
  const idInput = idFromArgsOrFlag(flags, args);
42
42
  if (idInput) {
43
+ if (isUuid(idInput)) {
44
+ return idInput;
45
+ }
46
+ const projectId = await withProjectId(apiClient, commandType, flags, args, cfg);
43
47
  return normalize(apiClient, projectId, idInput);
44
48
  }
49
+ const idFromContext = await new Context(cfg).getContextValue(flagName);
50
+ if (idFromContext) {
51
+ return idFromContext.value;
52
+ }
45
53
  throw makeMissingContextInputError(commandType, name, flagName, false);
46
54
  };
47
55
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/cli",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.32",
4
4
  "description": "Hand-crafted CLI for the mittwald API",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -66,7 +66,7 @@
66
66
  "marked": "^11.1.0",
67
67
  "marked-terminal": "^6.0.0",
68
68
  "node-notifier": "^10.0.1",
69
- "open": "^9.1.0",
69
+ "open": "^10.0.3",
70
70
  "parse-duration": "^1.1.0",
71
71
  "pretty-bytes": "^6.1.0",
72
72
  "react": "^18.2.0",