@pixwel/pixwel-sdk 1.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.
Files changed (65) hide show
  1. package/.babelrc +3 -0
  2. package/.editorconfig +36 -0
  3. package/.vs/slnx.sqlite +0 -0
  4. package/.vscode/launch.json +0 -0
  5. package/coverage/clover.xml +7 -0
  6. package/coverage/coverage-final.json +1 -0
  7. package/coverage/lcov-report/Ass.js.html +651 -0
  8. package/coverage/lcov-report/Asset.js.html +129 -0
  9. package/coverage/lcov-report/Filename.js.html +849 -0
  10. package/coverage/lcov-report/Ingest.js.html +591 -0
  11. package/coverage/lcov-report/IngestFile.js.html +87 -0
  12. package/coverage/lcov-report/IngestFileDrop.js.html +540 -0
  13. package/coverage/lcov-report/Order.js.html +162 -0
  14. package/coverage/lcov-report/Srt.js.html +333 -0
  15. package/coverage/lcov-report/Sub.js.html +177 -0
  16. package/coverage/lcov-report/TimeFormat.js.html +210 -0
  17. package/coverage/lcov-report/base.css +223 -0
  18. package/coverage/lcov-report/block-navigation.js +63 -0
  19. package/coverage/lcov-report/index.html +84 -0
  20. package/coverage/lcov-report/lib/Filename.js.html +720 -0
  21. package/coverage/lcov-report/lib/index.html +97 -0
  22. package/coverage/lcov-report/prettify.css +1 -0
  23. package/coverage/lcov-report/prettify.js +1 -0
  24. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  25. package/coverage/lcov-report/sorter.js +158 -0
  26. package/coverage/lcov-report/test/index.html +97 -0
  27. package/coverage/lcov-report/test/mocks.js.html +423 -0
  28. package/coverage/lcov.info +0 -0
  29. package/dist/index.js +61 -0
  30. package/dist/src/Ass.js +200 -0
  31. package/dist/src/Asset.js +41 -0
  32. package/dist/src/Filename.js +252 -0
  33. package/dist/src/Ingest.js +200 -0
  34. package/dist/src/IngestFile.js +17 -0
  35. package/dist/src/IngestFileDrop.js +178 -0
  36. package/dist/src/Order.js +58 -0
  37. package/dist/src/Srt.js +102 -0
  38. package/dist/src/Sub.js +42 -0
  39. package/dist/src/TimeFormat.js +48 -0
  40. package/index.js +6 -0
  41. package/package.json +26 -0
  42. package/src/Ass.js +195 -0
  43. package/src/Asset.js +20 -0
  44. package/src/Filename.js +260 -0
  45. package/src/Ingest.js +175 -0
  46. package/src/IngestFile.js +6 -0
  47. package/src/IngestFileDrop.js +157 -0
  48. package/src/Order.js +31 -0
  49. package/src/Srt.js +89 -0
  50. package/src/Sub.js +37 -0
  51. package/src/TimeFormat.js +48 -0
  52. package/src/docs.json +1 -0
  53. package/test/Ass.spec.js +150 -0
  54. package/test/Asset.spec.js +24 -0
  55. package/test/Filename.spec.js +728 -0
  56. package/test/Ingest.spec.js +95 -0
  57. package/test/Srt.spec.js +111 -0
  58. package/test/Sub.spec.js +75 -0
  59. package/test/TimeFormat.spec.js +84 -0
  60. package/test/mocks/mediainfo.mock.js +67 -0
  61. package/test/mocks/mediainfo.png.mock.js +22 -0
  62. package/test/mocks/mocks.js +118 -0
  63. package/test/mocks/prores.mock.js +71 -0
  64. package/test/parse.spec.ts +927 -0
  65. package/tsconfig.json +11 -0
@@ -0,0 +1,95 @@
1
+ import Ingest from "../lib/Ingest";
2
+
3
+ import mock from "./mocks/mediainfo.mock";
4
+ import proresMock from "./mocks/prores.mock";
5
+ import pngMock from "./mocks/mediainfo.png.mock";
6
+
7
+ describe("Ingest", () => {
8
+ describe("mapMetaToTags", () => {
9
+ it("should throw exception if missing File object", () => {
10
+ let meta = {};
11
+ expect(() => {
12
+ let ingest = Ingest.mapMetaToTags(meta, "video");
13
+ }).toThrow("missing info.File");
14
+ });
15
+ it("should throw exception if missing File.track object", () => {
16
+ let meta = {
17
+ File: {}
18
+ };
19
+ expect(() => {
20
+ let ingest = Ingest.mapMetaToTags(meta, "video");
21
+ }).toThrow("missing info.File.track");
22
+ });
23
+ it("should return empty object of tags if no metadata supplied", () => {
24
+ let meta = {
25
+ File: {
26
+ track: {}
27
+ }
28
+ };
29
+ let ingest = Ingest.mapMetaToTags(meta, "video");
30
+ expect(ingest).toEqual({
31
+ Aspect: "",
32
+ Standard: "",
33
+ Resolution: "",
34
+ Codec: "",
35
+ "Frame Mode": "",
36
+ Text: "",
37
+ Usage: "",
38
+ Extra: [],
39
+ Framerate: "",
40
+ Duration: ""
41
+ });
42
+ });
43
+ it("should correctly map h264 metadata to tags", () => {
44
+ let meta = mock;
45
+ let ingest = Ingest.mapMetaToTags(meta, "video");
46
+ let expected = {
47
+ Aspect: "16:9",
48
+ Codec: "h264",
49
+ Duration: "",
50
+ Extra: [],
51
+ "Frame Mode": "progressive",
52
+ Framerate: "23.98",
53
+ Resolution: "640x360",
54
+ Standard: "ntsc",
55
+ Text: "",
56
+ Usage: "online"
57
+ };
58
+ expect(ingest).toEqual(expected);
59
+ });
60
+ it("should correctly map prores metadata to tags", () => {
61
+ let meta = proresMock;
62
+ let ingest = Ingest.mapMetaToTags(meta, "video");
63
+ let expected = {
64
+ Aspect: "16:9",
65
+ Codec: "prores",
66
+ Duration: "",
67
+ Extra: [],
68
+ "Frame Mode": "progressive",
69
+ Framerate: "23.98",
70
+ Resolution: "1920x1080",
71
+ Standard: "ntsc",
72
+ Text: "",
73
+ Usage: "broadcast"
74
+ };
75
+ expect(ingest).toEqual(expected);
76
+ });
77
+ it("should correctly map png metadata to tags", () => {
78
+ let meta = pngMock;
79
+ let ingest = Ingest.mapMetaToTags(meta, "image");
80
+ let expected = {
81
+ Aspect: "",
82
+ Codec: "",
83
+ Duration: "",
84
+ Extra: [],
85
+ "Frame Mode": "",
86
+ Framerate: "",
87
+ Resolution: "1240x859",
88
+ Standard: "",
89
+ Text: "",
90
+ Usage: ""
91
+ };
92
+ expect(ingest).toEqual(expected);
93
+ });
94
+ });
95
+ });
@@ -0,0 +1,111 @@
1
+ import SRT from '../lib/Srt';
2
+
3
+ let translation = {
4
+ "_id": "translation-wwz",
5
+ "status": "complete",
6
+ "workRequest": "wr1",
7
+ "asset": "assetA",
8
+ "language": "ENG",
9
+ "lines": [{
10
+ "number": 1,
11
+ "startTime": "00:00:00,840",
12
+ "stopTime": "00:00:04,880",
13
+ "range": [0.84, 4.88],
14
+ "text": "They've brought you\nthe most <i>unforgettable</i> families of all time.",
15
+ "alignment": "bottom",
16
+ "inOffset": 0.1,
17
+ "outOffset": -0.1
18
+ }, {
19
+ "number": 2,
20
+ "startTime": "00:00:05,580",
21
+ "stopTime": "00:00:07,400",
22
+ "range": [5.580, 7.4],
23
+ "text": "Da, da, da!",
24
+ "alignment": "top"
25
+ }, {
26
+ "number": 3,
27
+ "startTime": "00:00:07,400",
28
+ "stopTime": "00:00:11,750",
29
+ "range": [7.4, 11.75],
30
+ "text": "Now from DreamWorks Animation\ncomes the most unexpected family of all:",
31
+ "alignment": "bottom",
32
+ "inOffset": -0.1,
33
+ "outOffset": 0.1
34
+ }]
35
+ };
36
+
37
+ describe("SRT", function() {
38
+
39
+ var testDataSrt = "1\n" +
40
+ "00:00:00,940 --> 00:00:04,780\n" +
41
+ "They've brought you\n" +
42
+ "the most <i>unforgettable</i> families of all time.\n" +
43
+ "\n" +
44
+ "2\n" +
45
+ "00:00:05,580 --> 00:00:07,400\n" +
46
+ "Da, da, da!\n" +
47
+ "\n" +
48
+ "3\n" +
49
+ "00:00:07,300 --> 00:00:11,850\n" +
50
+ "Now from DreamWorks Animation\n" +
51
+ "comes the most unexpected family of all:\n\n";
52
+
53
+ describe("parse()", function() {
54
+ it("should parse a SRT file to a collection", function() {
55
+ var lines = SRT.parse(testDataSrt.split('\n'));
56
+ expect(lines[0].startTime).toEqual('00:00:00,940');
57
+ expect(lines[0].stopTime).toEqual('00:00:04,780');
58
+ expect(lines[0].text).toEqual("They've brought you\nthe most <i>unforgettable</i> families of all time.");
59
+
60
+ expect(lines[1].startTime).toEqual('00:00:05,580');
61
+ expect(lines[1].stopTime).toEqual('00:00:07,400');
62
+ expect(lines[1].text).toEqual('Da, da, da!');
63
+
64
+ expect(lines[2].startTime).toEqual('00:00:07,300');
65
+ expect(lines[2].stopTime).toEqual('00:00:11,850');
66
+ expect(lines[2].text).toEqual('Now from DreamWorks Animation\ncomes the most unexpected family of all:');
67
+ });
68
+ });
69
+
70
+ describe("export()", function() {
71
+ it("should export data back to a plain SRT format", function() {
72
+ var out = SRT.export(translation.lines);
73
+ expect(out).toEqual(testDataSrt);
74
+ });
75
+
76
+ it("takes in/out offset into account to build startTime/stopTime", function() {
77
+ var lines = SRT.parse(SRT.export(translation.lines).split('\n'));
78
+ expect(lines[0].startTime).toEqual('00:00:00,940');
79
+ expect(lines[0].stopTime).toEqual('00:00:04,780');
80
+ });
81
+ });
82
+
83
+ describe('with malformed SRT data', function() {
84
+ var testData = [
85
+ [
86
+ "1\n" +
87
+ "00:00:00,333 --> 00:00:00,963" +
88
+ "" +
89
+ "" +
90
+ "2" +
91
+ "00:00:01,005 --> 00:00:02,461" +
92
+ "The terminators are evolving." +
93
+ "" +
94
+ "3" +
95
+ "00:00:02,505 --> 00:00:03,001" +
96
+ "THIS" +
97
+ "YEAR\n\n"
98
+ ]
99
+ ];
100
+
101
+ // describe('parse()', function() {
102
+ // it('throws an exception', function() {
103
+ // testData.forEach(function(srtData) {
104
+ // expect(function() {
105
+ // SRT.parse(srtData);
106
+ // }).toThrow(new Error('Malformed SRT file'));
107
+ // });
108
+ // });
109
+ // });
110
+ });
111
+ });
@@ -0,0 +1,75 @@
1
+ import SUB from '../lib/Sub';
2
+
3
+ let translation = {
4
+ "_id": "translation-wwz",
5
+ "status": "complete",
6
+ "workRequest": "wr1",
7
+ "asset": "assetA",
8
+ "language": "ENG",
9
+ "lines": [{
10
+ "number": 1,
11
+ "startTime": "00:00:00,840",
12
+ "stopTime": "00:00:04,880",
13
+ "range": [0.84, 4.88],
14
+ "text": "They've brought you\nthe most <i>unforgettable</i> families of all time.",
15
+ "alignment": "bottom",
16
+ "inOffset": 0.1,
17
+ "outOffset": -0.1
18
+ }, {
19
+ "number": 2,
20
+ "startTime": "00:00:05,580",
21
+ "stopTime": "00:00:07,400",
22
+ "range": [5.580, 7.4],
23
+ "text": "Da, da, da!",
24
+ "alignment": "top"
25
+ }, {
26
+ "number": 3,
27
+ "startTime": "00:00:07,400",
28
+ "stopTime": "00:00:11,750",
29
+ "range": [7.4, 11.75],
30
+ "text": "Now from DreamWorks Animation\ncomes the most unexpected family of all:",
31
+ "alignment": "bottom",
32
+ "inOffset": -0.1,
33
+ "outOffset": 0.1
34
+ }]
35
+ };
36
+
37
+ describe("SUB", function() {
38
+
39
+ describe("parse()", function() {
40
+ it('should detect the SUB format and read it', function() {
41
+ var lines = SUB.parse([
42
+ "00:00:00,00:00:04",
43
+ "They've brought you",
44
+ "the most unforgettable families of all time.",
45
+ "",
46
+ "00:00:05,00:00:07",
47
+ "here!"
48
+ ]);
49
+ expect(lines[0].startTime).toEqual('00:00:00');
50
+ expect(lines[0].stopTime).toEqual('00:00:04');
51
+ expect(lines[0].text).toEqual("They've brought you\nthe most unforgettable families of all time.");
52
+
53
+ expect(lines[1].startTime).toEqual('00:00:05');
54
+ expect(lines[1].stopTime).toEqual('00:00:07');
55
+ expect(lines[1].text).toEqual('here!');
56
+ });
57
+ });
58
+
59
+ describe('with malformed SUB data', function() {
60
+ var testData = [
61
+ "00:00:02,505 --> 00:00:03,001\nTHIS YEAR\n",
62
+ "00:00:02,505 --> 00:00:03,001\nTHIS YEAR\n"
63
+ ];
64
+
65
+ // describe('parse()', function() {
66
+ // it('throws an exception', function() {
67
+ // angular.forEach(testData, function(subData) {
68
+ // expect(function() {
69
+ // SUB.parse(subData);
70
+ // }).toThrow(new Error('Malformed SUB file'));
71
+ // });
72
+ // });
73
+ // });
74
+ });
75
+ });
@@ -0,0 +1,84 @@
1
+ import TimeFormat from '../lib/TimeFormat';
2
+
3
+ describe("TimeFormat", function() {
4
+
5
+ describe("isValidTime()", function() {
6
+ it("returns `true` for valid time", function() {
7
+ expect(TimeFormat.isValidTime('00:00:00,940')).toBe(true);
8
+ expect(TimeFormat.isValidTime('00:00:00.94')).toBe(true);
9
+ expect(TimeFormat.isValidTime('0:00:00.94')).toBe(true);
10
+ });
11
+ it("returns `false` for non valid time", function() {
12
+ expect(TimeFormat.isValidTime('00:00,940')).toBe(false);
13
+ expect(TimeFormat.isValidTime('94')).toBe(false);
14
+ expect(TimeFormat.isValidTime('hello')).toBe(false);
15
+ });
16
+ });
17
+
18
+ describe("timeToTimestamp()", function() {
19
+ it("builds a timestamp from a time string", function() {
20
+ expect(TimeFormat.timeToTimestamp('00:00:00,940')).toBe(0.94);
21
+ expect(TimeFormat.timeToTimestamp('00:00:00.94')).toBe(0.94);
22
+ expect(TimeFormat.timeToTimestamp('0:00:00.94')).toBe(0.94);
23
+ });
24
+
25
+ it("returns `0` for non valid time", function() {
26
+ expect(TimeFormat.timeToTimestamp('00:00,940')).toBe(0);
27
+ expect(TimeFormat.timeToTimestamp('94')).toBe(0);
28
+ expect(TimeFormat.timeToTimestamp('hello')).toBe(0);
29
+ });
30
+ });
31
+
32
+ describe("timeDiff()", function() {
33
+ it("returns a timestamp duration from two time string", function() {
34
+ expect(TimeFormat.timeDiff('00:00:00,940', '00:00:00,840')).toBe(-0.1);
35
+ expect(TimeFormat.timeDiff('00:00:00.94', '00:00:00.84')).toBe(-0.1);
36
+ expect(TimeFormat.timeDiff('0:00:00.94', '0:00:00.84')).toBe(-0.1);
37
+
38
+ expect(TimeFormat.timeDiff('00:00:00,840', '00:00:00,940')).toBe(0.1);
39
+ expect(TimeFormat.timeDiff('00:00:00.84', '00:00:00.94')).toBe(0.1);
40
+ expect(TimeFormat.timeDiff('0:00:00.84', '0:00:00.94')).toBe(0.1);
41
+ });
42
+
43
+ it("returns `0` when there's no time difference", function() {
44
+ expect(TimeFormat.timeDiff('00:00:00,940', '00:00:00,940')).toBe(0);
45
+ expect(TimeFormat.timeDiff('00:00:00,940', undefined)).toBe(0);
46
+ expect(TimeFormat.timeDiff(undefined, '00:00:00,940')).toBe(0);
47
+ });
48
+ });
49
+
50
+ describe("timestampDiff()", function() {
51
+ it("returns a timestamp duration from two time string", function() {
52
+ expect(TimeFormat.timestampDiff(0.94, 0.84)).toBe(-0.1);
53
+ expect(TimeFormat.timestampDiff(0.84, 0.94)).toBe(0.1);
54
+ });
55
+
56
+ it("returns `0` when there's no time difference", function() {
57
+ expect(TimeFormat.timestampDiff(0.94, 0.94)).toBe(0);
58
+ expect(TimeFormat.timestampDiff(0.94, undefined)).toBe(0);
59
+ expect(TimeFormat.timestampDiff(undefined, 0.94)).toBe(0);
60
+ });
61
+ });
62
+
63
+ describe("startTime()", function() {
64
+ it("builds the startTime from a line data", function() {
65
+ expect(TimeFormat.startTime({
66
+ startTime: '00:00:00,940',
67
+ stopTime: '00:00:01,480',
68
+ inOffset: 0.1,
69
+ outOffset: -0.1
70
+ })).toBe('00:00:01,040');
71
+ });
72
+ });
73
+
74
+ describe("stopTime()", function() {
75
+ it("builds the startTime from a line data", function() {
76
+ expect(TimeFormat.stopTime({
77
+ startTime: '00:00:00,940',
78
+ stopTime: '00:00:01,480',
79
+ inOffset: 0.1,
80
+ outOffset: -0.1
81
+ })).toBe('00:00:01,380');
82
+ });
83
+ });
84
+ });
@@ -0,0 +1,67 @@
1
+ module.exports = {
2
+ "File": {
3
+ "track": [
4
+ {
5
+ "Format": "MPEG-4",
6
+ "Format_profile": "QuickTime",
7
+ "Codec_ID": "qt 0000.02 (qt )",
8
+ "File_size": "1.11 MiB",
9
+ "Duration": "10s 55ms",
10
+ "Overall_bit_rate": "924 Kbps",
11
+ "Encoded_date": "UTC 1904-01-01 00:00:00",
12
+ "Tagged_date": "UTC 1904-01-01 00:00:00",
13
+ "Writing_application": "Lavf57.83.100",
14
+ "_type": "General"
15
+ },
16
+ {
17
+ "ID": "1",
18
+ "Format": "AVC",
19
+ "Format_Info": "Advanced Video Codec",
20
+ "Format_profile": "High@L3",
21
+ "Format_settings__CABAC": "Yes",
22
+ "Format_settings__ReFrames": "4 frames",
23
+ "Codec_ID": "avc1",
24
+ "Codec_ID_Info": "Advanced Video Coding",
25
+ "Duration": "10s 10ms",
26
+ "Bit_rate": "791 Kbps",
27
+ "Width": "640 pixels",
28
+ "Height": "360 pixels",
29
+ "Display_aspect_ratio": "16:9",
30
+ "Frame_rate_mode": "Constant",
31
+ "Frame_rate": "23.976 (24000/1001) fps",
32
+ "Color_space": "YUV",
33
+ "Chroma_subsampling": "4:2:0",
34
+ "Bit_depth": "8 bits",
35
+ "Scan_type": "Progressive",
36
+ "Bits__Pixel_Frame_": "0.143",
37
+ "Stream_size": "967 KiB (85%)",
38
+ "Language": "English",
39
+ "Encoded_date": "UTC 1904-01-01 00:00:00",
40
+ "Tagged_date": "UTC 1904-01-01 00:00:00",
41
+ "_type": "Video"
42
+ },
43
+ {
44
+ "ID": "2",
45
+ "Format": "AAC",
46
+ "Format_Info": "Advanced Audio Codec",
47
+ "Format_profile": "LC",
48
+ "Codec_ID": "40",
49
+ "Duration": "10s 55ms",
50
+ "Bit_rate_mode": "Constant",
51
+ "Bit_rate": "129 Kbps",
52
+ "Channel_s_": "2 channels",
53
+ "Channel_positions": "Front: L R",
54
+ "Sampling_rate": "44.1 KHz",
55
+ "Frame_rate": "43.066 fps (1024 spf)",
56
+ "Compression_mode": "Lossy",
57
+ "Stream_size": "158 KiB (14%)",
58
+ "Language": "English",
59
+ "Default": "Yes",
60
+ "Alternate_group": "1",
61
+ "Encoded_date": "UTC 1904-01-01 00:00:00",
62
+ "Tagged_date": "UTC 1904-01-01 00:00:00",
63
+ "_type": "Audio"
64
+ }
65
+ ]
66
+ }
67
+ }
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ File: {
3
+ track: [
4
+ {
5
+ Format: "PNG",
6
+ Format_Info: "Portable Network Graphic",
7
+ File_size: "518 KiB",
8
+ _type: "General"
9
+ },
10
+ {
11
+ Format: "PNG",
12
+ Format_Info: "Portable Network Graphic",
13
+ Width: "1 240 pixels",
14
+ Height: "859 pixels",
15
+ Bit_depth: "24 bits",
16
+ Compression_mode: "Lossless",
17
+ Stream_size: "518 KiB (100%)",
18
+ _type: "Image"
19
+ }
20
+ ]
21
+ }
22
+ };
@@ -0,0 +1,118 @@
1
+ module.exports = {
2
+ tags: [
3
+ { name: 'online', type: 'Usage' },
4
+ { name: 'broadcast', type: 'Usage' },
5
+ { name: 'dcp', type: 'Usage' },
6
+ { name: 'cmyk', type: 'Usage' },
7
+ { name: 'rgb', type: 'Usage' },
8
+ { name: 'previewonly', type: 'Usage' },
9
+ { name: 'txtd', type: 'Text' },
10
+ { name: 'txtl', type: 'Text' },
11
+ { name: 'flattened', type: 'Text'},
12
+ { name: 'layered', type: 'Text'},
13
+ { name: 'txtl2', type: 'Text' },
14
+ { name: 'h264', type: 'Codec'},
15
+ { name: '1920x1080', type: 'Resolution'},
16
+ { name: '1080p', set: ['h264', '1920x1080', 'online']}
17
+ ],
18
+
19
+ types: [
20
+ { name: 'trailer.us', category: 'av', group: 'av' },
21
+ { name: 'trailer.intl', category: 'av', group: 'av'},
22
+ { name: 'tv-spot.us', category: 'av', group: 'av' },
23
+ { name: 'tv-spot.intl', category: 'av', group: 'av'},
24
+ { name: 'film-clip.intl', category: 'av', group: 'av'},
25
+ { name: 'strategy-deck', category: 'print', group: 'print'}
26
+ ],
27
+
28
+ assets: [
29
+ {
30
+ $links: {
31
+ self: 'http://api/assets/assetA',
32
+ project: 'http://api/projects/projectA',
33
+ studio: 'http://api/studios/studio1',
34
+ type: 'http://api/assetTypes/trailer.intl',
35
+ transcription: 'http://api/translations/translationA'
36
+ },
37
+ $flags: [],
38
+ $permissions: {
39
+ tags: {
40
+ online: ['txtd'],
41
+ broadcast: ['txtl'],
42
+ dcp: ['txtl', 'txtd']
43
+ }
44
+ },
45
+ _id: 'assetA',
46
+ type: 'trailer.intl',
47
+ name: 'Test Asset A',
48
+ slug: 'test-asset-a',
49
+ length: 4,
50
+ project: 'projectA',
51
+ studio: 'studio1'
52
+ },
53
+ {
54
+ $links: {
55
+ self: 'http://api/assets/assetB',
56
+ project: 'http://api/projects/projectA',
57
+ type: 'http://api/assetTypes/trailer.intl'
58
+ },
59
+ $flags: [
60
+ 'new'
61
+ ],
62
+ $permissions: {
63
+ tags: {
64
+ online: ['txtd'],
65
+ broadcast: ['txtl', 'txtd'],
66
+ dcp: ['txtl', 'txtd']
67
+ }
68
+ },
69
+ _id: 'assetB',
70
+ name: 'Test Asset B',
71
+ type: 'trailer.us',
72
+ length: 8,
73
+ project: 'projectA'
74
+ },
75
+ {
76
+ $links: {
77
+ self: 'http://api/assets/assetC',
78
+ project: 'http://api/projects/projectC',
79
+ type: 'http://api/assetTypes/trailer.us'
80
+ },
81
+ $flags: [],
82
+ $permissions: {
83
+ tags: {
84
+ online: ['txtl'],
85
+ broadcast: ['txtl', 'txtd'],
86
+ dcp: ['txtl', 'txtd']
87
+ }
88
+ },
89
+ _id: 'assetC',
90
+ name: 'Test Asset C',
91
+ type: 'tv-spot.intl',
92
+ length: 15,
93
+ project: 'projectC'
94
+ },
95
+ {
96
+ $links: {
97
+ self: 'http://api/assets/assetD',
98
+ project: 'http://api/projects/projectC',
99
+ type: 'http://api/assetTypes/trailer.us'
100
+ },
101
+ $flags: [],
102
+ $permissions: {
103
+ tags: {
104
+ online: ['txtl'],
105
+ broadcast: ['txtl', 'txtd'],
106
+ dcp: ['txtl', 'txtd']
107
+ }
108
+ },
109
+ $feedback: {},
110
+ _id: 'assetD',
111
+ name: 'Test Asset D',
112
+ type: 'trailer.us',
113
+ creative: true,
114
+ length: 10,
115
+ project: 'projectC'
116
+ }
117
+ ]
118
+ }
@@ -0,0 +1,71 @@
1
+ module.exports = {
2
+ "File": {
3
+ "track": [{
4
+ "Format": "MPEG-4",
5
+ "Format_profile": "QuickTime",
6
+ "Codec_ID": "qt 2005.03 (qt )",
7
+ "File_size": "64.3 MiB",
8
+ "Duration": "5s 5ms",
9
+ "Overall_bit_rate_mode": "Variable",
10
+ "Overall_bit_rate": "108 Mbps",
11
+ "Encoded_date": "UTC 2018-06-12 01:13:24",
12
+ "Tagged_date": "UTC 2018-06-12 01:13:27",
13
+ "Writing_library": "Apple QuickTime",
14
+ "Media_UUID": "97BAE66D-352F-412A-BEE6-67C976369B60",
15
+ "_type": "General"
16
+ }, {
17
+ "ID": "1",
18
+ "Format": "ProRes",
19
+ "Format_profile": "422",
20
+ "Codec_ID": "apcn",
21
+ "Duration": "5s 5ms",
22
+ "Bit_rate_mode": "Variable",
23
+ "Bit_rate": "106 Mbps",
24
+ "Width": "1 920 pixels",
25
+ "Height": "1 080 pixels",
26
+ "Display_aspect_ratio": "16:9",
27
+ "Frame_rate_mode": "Constant",
28
+ "Frame_rate": "23.976 (24000/1001) fps",
29
+ "Color_space": "YUV",
30
+ "Chroma_subsampling": "4:2:2",
31
+ "Scan_type": "Progressive",
32
+ "Bits__Pixel_Frame_": "2.123",
33
+ "Stream_size": "63.0 MiB (98%)",
34
+ "Language": "English",
35
+ "Encoded_date": "UTC 2018-06-12 01:13:24",
36
+ "Tagged_date": "UTC 2018-06-12 01:13:27",
37
+ "Color_primaries": "BT.709",
38
+ "Transfer_characteristics": "BT.709",
39
+ "Matrix_coefficients": "BT.709",
40
+ "_type": "Video"
41
+ }, {
42
+ "ID": "2",
43
+ "Format": "PCM",
44
+ "Format_settings__Endianness": "Little",
45
+ "Format_settings__Sign": "Signed",
46
+ "Codec_ID": "lpcm",
47
+ "Duration": "5s 5ms",
48
+ "Bit_rate_mode": "Constant",
49
+ "Bit_rate": "2 304 Kbps",
50
+ "Channel_s_": "2 channels",
51
+ "Channel_positions": "Front: L R",
52
+ "Sampling_rate": "48.0 KHz",
53
+ "Bit_depth": "24 bits",
54
+ "Stream_size": "1.37 MiB (2%)",
55
+ "Language": "English",
56
+ "Encoded_date": "UTC 2018-06-12 01:13:27",
57
+ "Tagged_date": "UTC 2018-06-12 01:13:27",
58
+ "_type": "Audio"
59
+ }, {
60
+ "ID": "3",
61
+ "Type": "Time code",
62
+ "Format": "QuickTime TC",
63
+ "Duration": "5s 5ms",
64
+ "Title": "untitled",
65
+ "Language": "English",
66
+ "Encoded_date": "UTC 2018-06-12 01:13:27",
67
+ "Tagged_date": "UTC 2018-06-12 01:13:27",
68
+ "_type": "Other"
69
+ }]
70
+ }
71
+ }