Skip to content

Commit

Permalink
Merge pull request #24 from modzy/mds/v2
Browse files Browse the repository at this point in the history
Add v2 code
  • Loading branch information
mstanaland authored Feb 24, 2022
2 parents a55e60a + 7629e86 commit 3a867b0
Show file tree
Hide file tree
Showing 58 changed files with 5,687 additions and 14,145 deletions.
59 changes: 14 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,15 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
node_modules
.yarn/cache/
.yarn/unplugged/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

Expand All @@ -59,13 +23,18 @@ typings/
# dotenv environment variables file
.env

# next.js build output
.next

.idea/


.yarn/build-state.yml

# build
dist
types
docs

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
31 changes: 31 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changes from v1

Version 1 of the SDK client only supported Node application because the final bundle included references to the `fs` module. Version 2 uses a hybrid approach that includes code for both Node and the browser. It does this using the package.json file’s `browser` field that specifies browser-specific overrides. As such, any use of this SDK for the browser requires the use of a bundler or build tool. Note that the split only applies to the part of the sdk for submitting job files - most of the SDK code is pure JavaScript.

The previous documentation often incorrectly showed the results of the methods having direct returns. In reality, all methods return a promise that resolves to the data shown.

- modzyClient initialization parameter change to single object. The `url` key is optional as it defaults to app.modzy.com
- Removed `.getAllModels`. use getActiveModels() or call getModels() with no params.
- Added `.getActiveModels`. Returns only the active models with more useful details
- `.getModels` parameter change to single object.
- `.getModel` renamed to `.getModelById`
- `.getModelByName` unchanged
- `.getRelatedModels` removed because not useful
- `.getModelVersions` renamed `.getModelVersionsById`
- `.getModelVersion` renamed to `.getModelDetails`; parameter change to single object
- `.getModelVersionInputSample` parameter change to single object
- `.getModelVersionOutputSample` parameter change to single object
- `.getJobHistory` parameter change to single object
- `.submitJobText` parameter change to single object
- `.submitJobEmbedded` parameter change to single object. No longer handles any parsing of the embedded file, assumes that the sources object has the file as a proper data URL. Use the utility `pathToDataUrl(path, mimeType)` for Node and `fileToDataUrl(file)` for browser.
- `.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
- `.getJob` unchanged
- `.cancelJob` unchanged
- `.getResult` unchanged
- Added `.getOutputContents` which gets the contents of a specific job output
- `.blockUntilComplete` renamed to `.blockUntilJobComplete`; takes just the jobId as a parameter; adds an optional second parameter that is a config object. Currently the only config key is `timeout` where you specify the number of milliseconds between checks for job completion.
- Adds `.getProcessingEngineStatus` which returns an array of actively running processing engines and their statuses
- Adds `.fileToDataUrl`, (browser only) a utility to convert a File blob to a base64 data URL
- Adds `.pathToDataUrl`, (Node only) a utility to convert a file to a base64 data URL
Loading

0 comments on commit 3a867b0

Please sign in to comment.