Skip to content

Releases: transloadit/node-sdk

v3.0.2

06 Apr 14:56
v3.0.2
b767be2
Compare
Choose a tag to compare

v3.0.1...v3.0.2

v3.0.1

31 Mar 16:50
v3.0.1
ad677e3
Compare
Choose a tag to compare
  • type: Fixed default export to match actual code (#104) e78ba68

v3.0.0...v3.0.1

v3.0.0

16 Mar 09:06
v3.0.0
74f62cb
Compare
Choose a tag to compare

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

v3.0.0-rc.4...v3.0.0

v3.0.0-rc.4

30 Jan 15:47
v3.0.0-rc.4
c2b7643
Compare
Choose a tag to compare
v3.0.0-rc.4 Pre-release
Pre-release
  • Add undocumented assemblyId parameter to createAssembly (not recommended for general use) 563bcec

v3.0.0-rc.3...v3.0.0-rc.4

v3.0.0-rc.3

29 Jan 21:57
v3.0.0-rc.3
f441e95
Compare
Choose a tag to compare
v3.0.0-rc.3 Pre-release
Pre-release

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

  • Throw proper error when passing a non-readable stream f1eef81
  • Add eslint rule from airbnb to ensure correct deps #93 #90 0612b8e

v3.0.0-rc.2...v3.0.0-rc.3

Minor fixes

20 Jan 18:40
Compare
Choose a tag to compare
Minor fixes Pre-release
Pre-release
  • Don't publish unnecessary files in npm package
  • Improve typescript defs (errors)
  • Improve readme

v3.0.0-rc.1...v3.0.0-rc.2

v3.0.0-rc.1

20 Jan 12:03
Compare
Choose a tag to compare
v3.0.0-rc.1 Pre-release
Pre-release

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 to replayAssembly(assemblyId, params) (previously assemblyId was a key inside opts, but it was not optional, it was required)
-replayAssembly(opts, callback)
+await replayAssembly(assemblyId, params)
  • replayAssemblyNotification(opts) changed to replayAssemblyNotification(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 to cancelAssembly to reflect the official terminology
  • Removed undocumented fields option (directly under createAssembly(opts)). Please use the fields key inside params 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 is ASSEMBLY_CANCELED or REQUEST_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 or assembly_ssl_url == null. Will instead throw a TransloaditClient.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 property error has been renamed to transloaditErrorCode
  • Error property assembly_id has been renamed to assemblyId
  • All other JSON response properties from the Transloadit JSON response are no longer added directly to the Error object, but can instead be found in HTTPError.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 that err.response will be undefined for non-server errors
  • Will now also await ASSEMBLY_REPLAYING when waitForCompletion
  • Assemblies that have an error status (assembly.error) (but HTTP 200) will now result in an error thrown also when calling replayAssembly, to make it consistent with createAssembly
  • 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

v2.0.10...v3.0.0-rc.1

Release v1.10.0

28 Sep 12:02
Compare
Choose a tag to compare

Add functionality to wait for the completion of an assembly to createAssembly().

Release v1.8.0

31 Aug 07:51
Compare
Choose a tag to compare
Release 1.8.0

v1.1.2

25 Jun 12:36
Compare
Choose a tag to compare

Changes how calcSignature() works, which params it takes and what it returns.