Releases: transloadit/node-sdk
v3.0.2
v3.0.1
v3.0.0
This release marks the first stable release of transloadit Node.js SDK v3 🎉
The release contains no changes to the library itself from v3.0.0-rc.4. For (breaking) changes from v2 to v3, see the previous RC releases:
Full commit log since v3.0.0-rc.4
- declutter heading (#102) 65018a9
- log every assemblyId for createAssembly against API (#101) 3cd7ea7
- Transloadit Linter Upgrade (#100) 243c60f
- Set absolute paths to examples (#98) 16fdf69
- Revert "export sdk docs (#96)" (#97) 78b64b1
- export sdk docs (#96) 1161786
- Eslint airbnb transloadit (#95) 0534c1c
- Run tests every morning at 08:00 #89 8df4138
- Improve readme cb3d026
- Remove TransloaditClientLegacy f3c7904
- update tests to reflect API change 6b380d8
- test for trailing slash in endpoint due to TUS error 3c9038d
- enable replayedAssembly.assembly_ssl_url acb5d49
v3.0.0-rc.4
- Add undocumented assemblyId parameter to createAssembly (not recommended for general use) 563bcec
v3.0.0-rc.3
Breaking changes
Replaced constructor options useSsl
and service
with endpoint
:
// Before:
useSsl: true,
service: 'api2.transloadit.com'
// Now:
endpoint: 'https://api2.transloadit.com'
See also RC1 breaking changes
Other
Minor fixes
- Don't publish unnecessary files in npm package
- Improve typescript defs (errors)
- Improve readme
v3.0.0-rc.1
v3
is a complete rewrite of node-sdk with many bugfixes and improvements, as well as a new promise based API. See #87 for all changes.
Breaking changes
I have made some changes to make the API more consistent and easy to understand. This is an almost complete rewrite so there may be some unforeseen changes. These are the known breaking changes:
- All previous callback methods now return a promise and do not accept a callback
replayAssembly(opts)
changed toreplayAssembly(assemblyId, params)
(previouslyassemblyId
was a key inside opts, but it was not optional, it was required)
-replayAssembly(opts, callback)
+await replayAssembly(assemblyId, params)
replayAssemblyNotification(opts)
changed toreplayAssemblyNotification(assemblyId, params)
(previously assemblyId was a key inside opts, but it was not optional, it was required)
-replayAssemblyNotification(opts, callback)
+await replayAssemblyNotification(assemblyId, params)
deleteAssembly
renamed tocancelAssembly
to reflect the official terminology- Removed undocumented
fields
option (directly undercreateAssembly(opts)
). Please use thefields
key insideparams
instead. - Changed
createAssembly(options[, onProgress])
to:createAssembly({ onUploadProgress: Function({ uploadedBytes, totalBytes }), onAssemblyProgress: Function(assembly) })
(see readme)
Before:
createAssembly({
params: { ... },
fields: { field1: 'val' },
}, callback, progressCb)
Now:
await createAssembly({
params: {
fields: { field1: 'val' },
},
onUploadProgress,
onAssemblyProgress,
})
- Increase default request timeout from 5000 to 60000
- Now returns from
waitForCompletion
with the assembly result instead of throwing unknown error if result.ok isASSEMBLY_CANCELED
orREQUEST_ABORTED
Declarative createAssembly
addFile
and addStream
have been removed and are instead part of createAssembly
:
// Before:
transloadit.addFile('file1', '/path/to/file')
transloadit.createAssembly({ ... })
// Now:
transloadit.createAssembly({
files: {
file1: '/path/to/file'
},
...
})
// Before:
transloadit.addStream('file2', process.stdin)
transloadit.createAssembly({ ... })
// Now:
transloadit.createAssembly({
uploads: {
file2: process.stdin
},
...
})
Auto retry logic
- Will now only auto retry 5 times on RATE_LIMIT_REACHED (previous retry logic was overly aggressive: Used to retry on almost all errors, even unrecoverable ones, e.g. INVALID_FILE_META_DATA). Relevant code: 1 2
- Will no longer automatically retry if
assembly_url == null
orassembly_ssl_url == null
. Will instead throw aTransloaditClient.InconsistentResponseError
. (relevant code)
Errors
Thrown errors have changed:
When HTTP response code is not successful, the error will now be a TransloaditClient.HTTPError
object with an additional transloaditErrorCode
property (used to be a normal Error
object)
- Message has been improved
Error
propertyerror
has been renamed totransloaditErrorCode
Error
propertyassembly_id
has been renamed toassemblyId
- All other JSON response properties from the Transloadit JSON response are no longer added directly to the
Error
object, but can instead be found inHTTPError.response.body
. - The rest of the response JSON properties can be found on under
HTTPError.response?.body
(e.g.catch (err) { err.response.assembly_id }
) - Note thaterr.response
will be undefined for non-server errors - Will now also await
ASSEMBLY_REPLAYING
whenwaitForCompletion
- Assemblies that have an error status (
assembly.error
) (but HTTP 200) will now result in an error thrown also when callingreplayAssembly
, to make it consistent withcreateAssembly
- No longer throwing "Unknown error" for createTemplate and editTemplate if result.ok happens to be not defined
- 404 response from the server will now throw a
TransloaditClient.HTTPError
(previously 404 gave a successful result)
See also README
Release v1.10.0
Add functionality to wait for the completion of an assembly to createAssembly()
.
Release v1.8.0
Release 1.8.0