Skip to content

Commit 3a867b0

Browse files
authored
Merge pull request #24 from modzy/mds/v2
Add v2 code
2 parents a55e60a + 7629e86 commit 3a867b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5687
-14145
lines changed

.gitignore

+14-45
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,15 @@ npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
77

8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
148
# Directory for instrumented libs generated by jscoverage/JSCover
159
lib-cov
1610

17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (https://nodejs.org/api/addons.html)
33-
build/Release
3411

3512
# Dependency directories
36-
node_modules/
37-
jspm_packages/
13+
node_modules
3814
.yarn/cache/
3915
.yarn/unplugged/
4016

41-
# TypeScript v1 declaration files
42-
typings/
43-
44-
# Optional npm cache directory
45-
.npm
46-
47-
# Optional eslint cache
48-
.eslintcache
49-
50-
# Optional REPL history
51-
.node_repl_history
52-
5317
# Output of 'npm pack'
5418
*.tgz
5519

@@ -59,13 +23,18 @@ typings/
5923
# dotenv environment variables file
6024
.env
6125

62-
# next.js build output
63-
.next
64-
65-
.idea/
66-
67-
68-
.yarn/build-state.yml
69-
26+
# build
7027
dist
28+
types
7129
docs
30+
31+
# misc
32+
.DS_Store
33+
.env.local
34+
.env.development.local
35+
.env.test.local
36+
.env.production.local
37+
38+
npm-debug.log*
39+
yarn-debug.log*
40+
yarn-error.log*

CHANGES.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Changes from v1
2+
3+
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.
4+
5+
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.
6+
7+
- modzyClient initialization parameter change to single object. The `url` key is optional as it defaults to app.modzy.com
8+
- Removed `.getAllModels`. use getActiveModels() or call getModels() with no params.
9+
- Added `.getActiveModels`. Returns only the active models with more useful details
10+
- `.getModels` parameter change to single object.
11+
- `.getModel` renamed to `.getModelById`
12+
- `.getModelByName` unchanged
13+
- `.getRelatedModels` removed because not useful
14+
- `.getModelVersions` renamed `.getModelVersionsById`
15+
- `.getModelVersion` renamed to `.getModelDetails`; parameter change to single object
16+
- `.getModelVersionInputSample` parameter change to single object
17+
- `.getModelVersionOutputSample` parameter change to single object
18+
- `.getJobHistory` parameter change to single object
19+
- `.submitJobText` parameter change to single object
20+
- `.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.
21+
- `.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.
22+
- `.submitJobAWSS3` renamed to `.submitJobAwsS3`; parameter change to single object
23+
- `.submitJobJDBC` parameter change to single object
24+
- `.getJob` unchanged
25+
- `.cancelJob` unchanged
26+
- `.getResult` unchanged
27+
- Added `.getOutputContents` which gets the contents of a specific job output
28+
- `.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.
29+
- Adds `.getProcessingEngineStatus` which returns an array of actively running processing engines and their statuses
30+
- Adds `.fileToDataUrl`, (browser only) a utility to convert a File blob to a base64 data URL
31+
- Adds `.pathToDataUrl`, (Node only) a utility to convert a file to a base64 data URL

0 commit comments

Comments
 (0)