@transloadit/node 6.9.0 → 6.9.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 (47) hide show
  1. package/README.md +6 -5
  2. package/dist/bearerToken.d.ts +2 -0
  3. package/dist/bearerToken.d.ts.map +1 -1
  4. package/dist/bearerToken.js +6 -9
  5. package/dist/bearerToken.js.map +1 -1
  6. package/dist/cli/commands/assemblies.d.ts.map +1 -1
  7. package/dist/cli/commands/assemblies.js +6 -4
  8. package/dist/cli/commands/assemblies.js.map +1 -1
  9. package/dist/cli/commands/auth.d.ts.map +1 -1
  10. package/dist/cli/commands/auth.js +2 -1
  11. package/dist/cli/commands/auth.js.map +1 -1
  12. package/dist/cli/commands/image.js +3 -3
  13. package/dist/cli/commands/image.js.map +1 -1
  14. package/dist/cli/commands/login.d.ts.map +1 -1
  15. package/dist/cli/commands/login.js +10 -9
  16. package/dist/cli/commands/login.js.map +1 -1
  17. package/dist/cli/commands/notifications.js +2 -2
  18. package/dist/cli/commands/notifications.js.map +1 -1
  19. package/dist/cli/commands/storage.d.ts.map +1 -1
  20. package/dist/cli/commands/storage.js +10 -10
  21. package/dist/cli/commands/storage.js.map +1 -1
  22. package/dist/cli/commands/upload.d.ts.map +1 -1
  23. package/dist/cli/commands/upload.js +2 -1
  24. package/dist/cli/commands/upload.js.map +1 -1
  25. package/dist/cli/deviceLogin.d.ts.map +1 -1
  26. package/dist/cli/deviceLogin.js +3 -3
  27. package/dist/cli/deviceLogin.js.map +1 -1
  28. package/dist/cli/helpers.d.ts +2 -1
  29. package/dist/cli/helpers.d.ts.map +1 -1
  30. package/dist/cli/helpers.js +26 -1
  31. package/dist/cli/helpers.js.map +1 -1
  32. package/dist/cli/storagePublic.d.ts +1 -1
  33. package/dist/cli/storagePublic.d.ts.map +1 -1
  34. package/dist/cli/storagePublic.js +5 -4
  35. package/dist/cli/storagePublic.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/bearerToken.ts +8 -10
  38. package/src/cli/commands/assemblies.ts +7 -4
  39. package/src/cli/commands/auth.ts +2 -0
  40. package/src/cli/commands/image.ts +3 -3
  41. package/src/cli/commands/login.ts +12 -10
  42. package/src/cli/commands/notifications.ts +2 -2
  43. package/src/cli/commands/storage.ts +19 -11
  44. package/src/cli/commands/upload.ts +2 -1
  45. package/src/cli/deviceLogin.ts +3 -2
  46. package/src/cli/helpers.ts +31 -1
  47. package/src/cli/storagePublic.ts +11 -4
@@ -1,15 +1,22 @@
1
1
  import { ApiError } from '../ApiError.ts'
2
+ import { formatAPIError } from './helpers.ts'
2
3
 
3
- /** Actionable CLI advice without printing remote response bodies or credentials. */
4
+ /** Keep Storage advice alongside sanitized text reasons, without dumping response bodies. */
4
5
  export function storagePublicError(error: unknown, workspace?: string): string {
5
6
  if (error instanceof ApiError && error.code === 'STORAGE_PUBLIC_PREFIX_NEEDS_SMART_CDN_KEY') {
6
7
  const slug =
7
8
  workspace !== undefined && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.test(workspace)
8
9
  ? workspace
9
10
  : '<workspace>'
10
- return `Enable Smart CDN on an Auth Key at https://transloadit.com/c/${slug}/template-credentials/ and retry. The same key can serve Assemblies and Smart CDN.`
11
+ return formatAPIError(
12
+ error,
13
+ `Enable Smart CDN on an Auth Key at https://transloadit.com/c/${slug}/template-credentials/ and retry. The same key can serve Assemblies and Smart CDN.`,
14
+ )
11
15
  }
12
16
  if (error instanceof TypeError) return error.message
13
- // Keep unrecognized server errors out of CLI output; only known codes select specific advice.
14
- return 'Could not update or list public Storage prefixes. Check the API endpoint and Auth Key dam:write scope, then retry.'
17
+ // Unknown codes keep generic advice; only the textual reason is added by the shared formatter.
18
+ return formatAPIError(
19
+ error,
20
+ 'Could not update or list public Storage prefixes. Check the API endpoint and Auth Key dam:write scope, then retry.',
21
+ )
15
22
  }