Skip to content

Releases: modzy/sdk-javascript

v2.0.1 (April 18, 2022)

18 Apr 14:17
74686a8
Compare
Choose a tag to compare

Added documentation and made minor type improvements

v2.0.0 (February 24, 2022)

24 Feb 12:08
3a867b0
Compare
Choose a tag to compare

Version 2 of the Modzy Javascript SDK brings four major improvements:

  1. The SDK has been re-written in native TypeScript and includes types for most api call returns;
  2. Method signatures have been improved across the board — methods that require more than one argument now take single object instead;
  3. The SDK previously only supported Node.js; version 2 also supports browser JavaScript if using a build tool that supports the package.json's browser field;
  4. And finally, we've added new methods to improve binary file handling and to check processing engine statuses.

Client initialization

  • ModzyClient constructor parameter changed to single object. The url key is optional as it defaults to app.modzy.com

Model methods

  • Added getActiveModels. It always returns all active models with more useful details. This api call does not support pagination.
  • Removed getAllModels. Use getModels with no params to get the first 500 models or getActiveModels().
  • Removed getRelatedModels as the results were most often not useful
  • Renamed getModel to getModelById
  • Rename getModelVersions to getModelVersionsById
  • Renamed getModelVersion to getModelDetails; parameter change to single object
  • getModels parameter change to single object.
  • getModelVersionInputSample parameter change to single object
  • getModelVersionOutputSample parameter change to single object

Job status and result methods

  • Added getOutputContents which gets the contents of a specific job output - especially useful if the output is a binary file
  • Added getProcessingEngineStatus which returns an array of actively running processing engines and their statuses
  • Renamed blockUntilComplete to blockUntilJobComplete. It takes just the jobId as a parameter; adds an optional second parameter that is a config object to specify the number of milliseconds between checks for job completion.
  • getJobHistory parameter change to single object

Job submission methods

  • submitJobText parameter change to single object
  • submitJobEmbedded parameter change to single object. This method no longer handles any parsing of the embedded file and assumes that the sources object has the file as a proper data URL. You can use the new utilities pathToDataUrl(path, mimeType) for Node or fileToDataUrl(file) for browser to construct the sources object.
  • submitJobFile parameter change to single object. For the browser, the file needs to be base64 encoded. The modzyClient includes a built-in utility fileToDataUrl to convert a File blob to base64. For Node JS, you specify the relative path as a string.
  • submitJobAWSS3 renamed to submitJobAwsS3; parameter change to single object
  • submitJobJDBC parameter change to single object

New utilities

  • Added fileToDataUrl, (browser only) a utility to convert a File blob to a base64 data URL
  • Added pathToDataUrl, (Node only) a utility to convert a file to a base64 data URL

Samples

  • Added sample React components

v1.0.2

26 Mar 15:47
1e9e086
Compare
Choose a tag to compare
Merge pull request #12 from modzy/readmeUpdates

readme updates