transloadit 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.
- package/README.md +6 -5
- package/dist/bearerToken.d.ts +2 -0
- package/dist/bearerToken.d.ts.map +1 -1
- package/dist/bearerToken.js +6 -9
- package/dist/bearerToken.js.map +1 -1
- package/dist/cli/commands/assemblies.d.ts.map +1 -1
- package/dist/cli/commands/assemblies.js +6 -4
- package/dist/cli/commands/assemblies.js.map +1 -1
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +2 -1
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/image.js +3 -3
- package/dist/cli/commands/image.js.map +1 -1
- package/dist/cli/commands/login.d.ts.map +1 -1
- package/dist/cli/commands/login.js +10 -9
- package/dist/cli/commands/login.js.map +1 -1
- package/dist/cli/commands/notifications.js +2 -2
- package/dist/cli/commands/notifications.js.map +1 -1
- package/dist/cli/commands/storage.d.ts.map +1 -1
- package/dist/cli/commands/storage.js +10 -10
- package/dist/cli/commands/storage.js.map +1 -1
- package/dist/cli/commands/upload.d.ts.map +1 -1
- package/dist/cli/commands/upload.js +2 -1
- package/dist/cli/commands/upload.js.map +1 -1
- package/dist/cli/deviceLogin.d.ts.map +1 -1
- package/dist/cli/deviceLogin.js +3 -3
- package/dist/cli/deviceLogin.js.map +1 -1
- package/dist/cli/helpers.d.ts +2 -1
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/helpers.js +26 -1
- package/dist/cli/helpers.js.map +1 -1
- package/dist/cli/storagePublic.d.ts +1 -1
- package/dist/cli/storagePublic.d.ts.map +1 -1
- package/dist/cli/storagePublic.js +5 -4
- package/dist/cli/storagePublic.js.map +1 -1
- package/package.json +1 -1
- package/src/bearerToken.ts +8 -10
- package/src/cli/commands/assemblies.ts +7 -4
- package/src/cli/commands/auth.ts +2 -0
- package/src/cli/commands/image.ts +3 -3
- package/src/cli/commands/login.ts +12 -10
- package/src/cli/commands/notifications.ts +2 -2
- package/src/cli/commands/storage.ts +19 -11
- package/src/cli/commands/upload.ts +2 -1
- package/src/cli/deviceLogin.ts +3 -2
- package/src/cli/helpers.ts +31 -1
- package/src/cli/storagePublic.ts +11 -4
package/src/cli/storagePublic.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { ApiError } from '../ApiError.ts'
|
|
2
|
+
import { formatAPIError } from './helpers.ts'
|
|
2
3
|
|
|
3
|
-
/**
|
|
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
|
|
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
|
-
//
|
|
14
|
-
return
|
|
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
|
}
|