@graphprotocol/graph-cli 0.93.0 → 0.93.1-alpha-20241218175003-595e75e105c977ee9a4a2962ae00aca6fb51eebc

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
+ ## 0.93.1-alpha-20241218175003-595e75e105c977ee9a4a2962ae00aca6fb51eebc
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1859](https://github.com/graphprotocol/graph-tooling/pull/1859)
8
+ [`1eb80f4`](https://github.com/graphprotocol/graph-tooling/commit/1eb80f4bb4830a1adb0894087328b56e4fc6ee13)
9
+ Thanks [@YaroShkvorets](https://github.com/YaroShkvorets)! - `graph auth`: fix bug with setting
10
+ deploy key
11
+
3
12
  ## 0.93.0
4
13
 
5
14
  ### Minor Changes
@@ -7,5 +7,6 @@ export default class AuthCommand extends Command {
7
7
  static flags: {
8
8
  help: import("@oclif/core/interfaces").BooleanFlag<void>;
9
9
  };
10
+ private validateStudioDeployKey;
10
11
  run(): Promise<void>;
11
12
  }
@@ -1,5 +1,5 @@
1
1
  import { print, prompt } from 'gluegun';
2
- import { Args, Command, Flags, ux } from '@oclif/core';
2
+ import { Args, Command, Flags } from '@oclif/core';
3
3
  import { saveDeployKey } from '../command-helpers/auth.js';
4
4
  import { chooseNodeUrl } from '../command-helpers/node.js';
5
5
  export default class AuthCommand extends Command {
@@ -12,19 +12,23 @@ export default class AuthCommand extends Command {
12
12
  char: 'h',
13
13
  }),
14
14
  };
15
+ validateStudioDeployKey(value) {
16
+ if (!value)
17
+ return false;
18
+ return /^[0-9a-fA-F]{32}$/.test(value);
19
+ }
15
20
  async run() {
16
21
  const { args: { 'deploy-key': initialDeployKey }, } = await this.parse(AuthCommand);
17
22
  const { node } = chooseNodeUrl({});
18
23
  const { deployKey } = await prompt.ask([
19
24
  {
20
- type: 'invisible',
25
+ type: 'input',
21
26
  name: 'deployKey',
22
- message: () => 'What is the deploy key?',
23
- initial: initialDeployKey,
27
+ message: () => 'What is your Subgraph Studio deploy key?',
24
28
  required: true,
25
- validate: value => value.length > 200
26
- ? ux.error('✖ Deploy key must not exceed 200 characters', { exit: 1 })
27
- : value,
29
+ initial: initialDeployKey,
30
+ skip: this.validateStudioDeployKey(initialDeployKey),
31
+ validate: value => this.validateStudioDeployKey(value) || `Invalid Subgraph Studio deploy key: ${value}`,
28
32
  },
29
33
  ]);
30
34
  try {
@@ -32,7 +36,7 @@ export default class AuthCommand extends Command {
32
36
  print.success(`Deploy key set for ${node}`);
33
37
  }
34
38
  catch (e) {
35
- this.error(e, { exit: 1 });
39
+ this.error(`Failed to set deploy key: ${e.message}`, { exit: 1 });
36
40
  }
37
41
  }
38
42
  }
@@ -1016,5 +1016,5 @@
1016
1016
  ]
1017
1017
  }
1018
1018
  },
1019
- "version": "0.93.0"
1019
+ "version": "0.93.1-alpha-20241218175003-595e75e105c977ee9a4a2962ae00aca6fb51eebc"
1020
1020
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.93.0",
3
+ "version": "0.93.1-alpha-20241218175003-595e75e105c977ee9a4a2962ae00aca6fb51eebc",
4
4
  "type": "module",
5
5
  "description": "CLI for building for and deploying to The Graph",
6
6
  "license": "(Apache-2.0 OR MIT)",