@pixwel/pixwel-sdk 1.1.11 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -1
- package/README.md +60 -0
- package/coverage/clover.xml +375 -226
- package/coverage/coverage-final.json +11 -5
- package/coverage/lcov-report/Ass.js.html +1 -1
- package/coverage/lcov-report/Asset.js.html +4 -4
- package/coverage/lcov-report/AssetType.js.html +98 -0
- package/coverage/lcov-report/Encode.js.html +98 -0
- package/coverage/lcov-report/File.js.html +98 -0
- package/coverage/lcov-report/Filename.js.html +11 -719
- package/coverage/lcov-report/Ingest.js.html +1240 -280
- package/coverage/lcov-report/IngestFile.js.html +5 -5
- package/coverage/lcov-report/Model.js.html +821 -0
- package/coverage/lcov-report/Order.js.html +25 -25
- package/coverage/lcov-report/Srt.js.html +1 -1
- package/coverage/lcov-report/Sub.js.html +1 -1
- package/coverage/lcov-report/Tag.js.html +98 -0
- package/coverage/lcov-report/TimeFormat.js.html +1 -1
- package/coverage/lcov-report/fileType.js.html +188 -0
- package/coverage/lcov-report/index.html +114 -36
- package/coverage/lcov.info +787 -474
- package/dist/index.js +74 -22
- package/dist/src/Asset.js +10 -5
- package/dist/src/AssetType.js +54 -0
- package/dist/src/Encode.js +54 -0
- package/dist/src/File.js +54 -0
- package/dist/src/Filename.js +7 -222
- package/dist/src/Ingest.js +370 -35
- package/dist/src/IngestFile.js +6 -2
- package/dist/src/Model.js +569 -0
- package/dist/src/Order.js +20 -9
- package/dist/src/Srt.js +5 -1
- package/dist/src/Tag.js +54 -0
- package/dist/src/fileType.js +43 -0
- package/index.js +14 -0
- package/package.json +9 -3
- package/src/AssetType.js +11 -0
- package/src/Encode.js +11 -0
- package/src/File.js +11 -0
- package/src/Filename.js +0 -236
- package/src/Ingest.js +350 -30
- package/src/Model.js +252 -0
- package/src/Tag.js +11 -0
- package/src/fileType.js +41 -0
- package/test/Filename.spec.js +9 -685
- package/test/Ingest.spec.js +1107 -152
- package/test/Model.spec.js +328 -0
package/.babelrc
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# PIXWEL-SDK
|
|
2
|
+
|
|
3
|
+
An overview of the Pixwel SDK.
|
|
4
|
+
|
|
5
|
+
## Data Resources
|
|
6
|
+
|
|
7
|
+
##### Saving a resource
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
let ingest = Ingest.find('a1b2c3');
|
|
11
|
+
ingest.source = 'different.mov';
|
|
12
|
+
ingest.save();
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### Validating a resource
|
|
16
|
+
```
|
|
17
|
+
let ingest = new Ingest({ source: 'cool.mov'});
|
|
18
|
+
let bool = ingest.validate();
|
|
19
|
+
let errors = ingest.errors();
|
|
20
|
+
// returns
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
##### Getting data from a resource
|
|
25
|
+
```
|
|
26
|
+
let asset = new Asset({ name: 'Cool' });
|
|
27
|
+
console.log(asset.name);
|
|
28
|
+
let data = asset.data();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
##### Cloning an existing resource
|
|
32
|
+
```
|
|
33
|
+
let project = Project.find('a1b2c3');
|
|
34
|
+
let newProject = project.clone();
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
##### Registering a find callback
|
|
38
|
+
```
|
|
39
|
+
Model.registerCallback('find', result => {
|
|
40
|
+
updateRedux(result);
|
|
41
|
+
});
|
|
42
|
+
let res = Model.all();
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
##### Registering a save callback`
|
|
46
|
+
```
|
|
47
|
+
Model.registerCallback('save', res => {
|
|
48
|
+
updateRedux(res);
|
|
49
|
+
});
|
|
50
|
+
let model = new Model({ name: 'Jeff' });
|
|
51
|
+
let res = model.save();
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
##### Handles API errors gracefully
|
|
55
|
+
```
|
|
56
|
+
let asset = new Asset();
|
|
57
|
+
asset.save();
|
|
58
|
+
// throws Exception
|
|
59
|
+
// HTTP 400: POST https://api.pixwel.com/assets {}
|
|
60
|
+
```
|