filecafe 0.1.0 → 0.1.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/cli.js +4 -7
  2. package/package.json +5 -1
package/dist/cli.js CHANGED
@@ -82,6 +82,7 @@ function createApiClient(options) {
82
82
  };
83
83
  if (body !== void 0) headers["Content-Type"] = "application/json";
84
84
  let response;
85
+ let text;
85
86
  try {
86
87
  response = await fetch(url, {
87
88
  method,
@@ -90,6 +91,7 @@ function createApiClient(options) {
90
91
  redirect: "manual",
91
92
  signal: AbortSignal.timeout(timeoutMs)
92
93
  });
94
+ text = await response.text();
93
95
  } catch (error) {
94
96
  if (requestOptions.idempotent && networkRetries < maxNetworkRetries) {
95
97
  networkRetries++;
@@ -98,12 +100,7 @@ function createApiClient(options) {
98
100
  }
99
101
  throw new ApiError(`Could not reach ${baseUrl} (${describeNetworkError(error)}).`, null);
100
102
  }
101
- if (response.status >= 300 && response.status < 400) {
102
- const location = response.headers.get("Location");
103
- await response.body?.cancel();
104
- throw new ApiError(`${url} redirected to ${location ?? "another location"}. Check the --url option / FILECAFE_URL (e.g. use https:// instead of http://).`, response.status);
105
- }
106
- const text = await response.text();
103
+ if (response.status >= 300 && response.status < 400) throw new ApiError(`${url} redirected to ${response.headers.get("Location") ?? "another location"}. Check the --url option / FILECAFE_URL (e.g. use https:// instead of http://).`, response.status);
107
104
  let json = null;
108
105
  if (text) try {
109
106
  json = JSON.parse(text);
@@ -245,7 +242,7 @@ async function resolveSettings(environment, urlOption) {
245
242
  };
246
243
  }
247
244
  // src/version.ts
248
- const VERSION = "0.1.0";
245
+ const VERSION = "0.1.1";
249
246
  // src/context.ts
250
247
  /** Open a URL in the default browser without ever throwing. */
251
248
  function openBrowser(url, platform = process.platform) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "filecafe",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Upload files to file.cafe from the command line. Built for AI coding agents, humans, and CI.",
5
5
  "keywords": [
6
6
  "file.cafe",
@@ -34,5 +34,9 @@
34
34
  "@types/node": "^24.19.2",
35
35
  "tsdown": "^0.23.1",
36
36
  "typescript": "^7.0.2"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/filecafe/cli.git"
37
41
  }
38
42
  }