upfilesh 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/upload.js +6 -2
  2. package/package.json +4 -3
package/dist/upload.js CHANGED
@@ -19,13 +19,17 @@ const config_js_1 = require("./config.js");
19
19
  function getAuth() {
20
20
  const config = (0, config_js_1.loadConfig)();
21
21
  const apiKey = config.apiKey || process.env.UPFILE_API_KEY;
22
- const endpoint = config.endpoint || config_js_1.DEFAULT_ENDPOINT;
22
+ const endpoint = getEndpoint();
23
23
  if (!apiKey)
24
24
  throw new Error("No API key. Run: upfile signup --email your@email.com");
25
25
  return { apiKey, endpoint };
26
26
  }
27
+ function getEndpoint() {
28
+ const config = (0, config_js_1.loadConfig)();
29
+ return config.endpoint || config_js_1.DEFAULT_ENDPOINT;
30
+ }
27
31
  async function signup(email, ownerEmail) {
28
- const { endpoint } = getAuth();
32
+ const endpoint = getEndpoint();
29
33
  const res = await (0, node_fetch_1.default)(`${endpoint}/signup`, {
30
34
  method: "POST",
31
35
  headers: { "Content-Type": "application/json" },
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "upfilesh",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Instant file uploads from the command line — upfile.sh",
5
5
  "bin": {
6
- "upfile": "./bin/upfile"
6
+ "upfile": "bin/upfile"
7
7
  },
8
8
  "main": "dist/index.js",
9
+ "packageManager": "yarn@1.22.22",
9
10
  "files": [
10
11
  "bin/",
11
12
  "dist/",
@@ -29,7 +30,7 @@
29
30
  "license": "MIT",
30
31
  "repository": {
31
32
  "type": "git",
32
- "url": "https://github.com/upfilesh/cli.git"
33
+ "url": "git+https://github.com/upfilesh/cli.git"
33
34
  },
34
35
  "bugs": {
35
36
  "url": "https://github.com/upfilesh/cli/issues"