Skip to content

Commit 058fed8

Browse files
committed
Add v2 code
1 parent a55e60a commit 058fed8

Some content is hidden

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

67 files changed

+11234
-13837
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,14 @@ typings/
6969

7070
dist
7171
docs
72+
73+
# misc
74+
.DS_Store
75+
.env.local
76+
.env.development.local
77+
.env.test.local
78+
.env.production.local
79+
80+
npm-debug.log*
81+
yarn-debug.log*
82+
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+
- Deprecated(?) `.getAllModels`. Still works; returns the same response
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)