eoas 3.2.0-beta3 → 3.2.0

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.
@@ -9,7 +9,7 @@ const auth_1 = require("./auth");
9
9
  const crypto_1 = require("./crypto");
10
10
  const expoConfig_1 = require("./expoConfig");
11
11
  const fetch_1 = require("./fetch");
12
- const log_1 = tslib_1.__importDefault(require("./log"));
12
+ const log_1 = tslib_1.__importStar(require("./log"));
13
13
  const fileMetadataJoi = joi_1.default.object({
14
14
  assets: joi_1.default.array()
15
15
  .required()
@@ -295,6 +295,9 @@ class NoChangesDetectedError extends Error {
295
295
  }
296
296
  }
297
297
  exports.NoChangesDetectedError = NoChangesDetectedError;
298
+ function outdatedServerHint() {
299
+ return `Hint: the server did not understand the file list, so it runs a version older than 3.2.0. Upgrade the server to 3.2.0 or later, or pin eoas@3.1.X in devDependencies until then. ${(0, log_1.learnMore)('https://xprem.dev/changelog/bundle-diffing-and-cas')}`;
300
+ }
298
301
  async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, rolloutPercentage, publishGroup, branch, }) {
299
302
  const uploadUrl = new URL(requestUploadUrl);
300
303
  uploadUrl.searchParams.set('runtimeVersion', runtimeVersion);
@@ -325,7 +328,10 @@ async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion,
325
328
  throw new NoChangesDetectedError(platform);
326
329
  }
327
330
  if (!response.ok) {
328
- const text = await response.text();
331
+ const text = (await response.text()).trimEnd();
332
+ if (response.status === 400 && text === 'No file names provided') {
333
+ throw new Error(`Failed to request upload URL: ${text}\n${outdatedServerHint()}`);
334
+ }
329
335
  throw new Error(`Failed to request upload URL: ${text}${(0, auth_1.missingEooTokenHint)(response.status)}`);
330
336
  }
331
337
  const json = await response.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoas",
3
- "version": "3.2.0-beta3",
3
+ "version": "3.2.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",