@dcmjs-org/media 1.0.0-beta.3 → 1.0.0-beta.4

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/License.txt ADDED
@@ -0,0 +1,22 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2017 Steve Pieper
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@dcmjs-org/media",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "The dcmjs bulk-data bundle: DICOMDIR building (@dcmjs-org/dicomdir), Encapsulated PDF wrapping (@dcmjs-org/encapsulated), image building (@dcmjs-org/imaging), and video encapsulation (@dcmjs-org/video) re-exported under the stable dcmjs media, encapsulated, and image namespaces",
5
5
  "main": "./src/index.js",
6
+ "files": [
7
+ "src",
8
+ "README.md"
9
+ ],
6
10
  "license": "MIT",
7
11
  "repository": {
8
12
  "type": "git",
@@ -10,9 +14,9 @@
10
14
  "directory": "packages/media"
11
15
  },
12
16
  "dependencies": {
13
- "@dcmjs-org/dicomdir": "1.0.0-beta.3",
14
- "@dcmjs-org/encapsulated": "1.0.0-beta.3",
15
- "@dcmjs-org/video": "1.0.0-beta.3",
16
- "@dcmjs-org/imaging": "1.0.0-beta.3"
17
+ "@dcmjs-org/dicomdir": "1.0.0-beta.4",
18
+ "@dcmjs-org/encapsulated": "1.0.0-beta.4",
19
+ "@dcmjs-org/imaging": "1.0.0-beta.4",
20
+ "@dcmjs-org/video": "1.0.0-beta.4"
17
21
  }
18
22
  }
@@ -1,87 +0,0 @@
1
- // packages/media/test/bundle.test.js
2
- //
3
- // The bundle adds no behavior: every name it re-exports must be the very
4
- // same object as the underlying package's export (identity, not a copy or
5
- // a wrapper), and the namespace shapes must match dcmjs v2's src/index.js.
6
-
7
- import * as dicomdir from "@dcmjs-org/dicomdir";
8
- import * as encapsulatedPackage from "@dcmjs-org/encapsulated";
9
- import * as imaging from "@dcmjs-org/imaging";
10
- import * as video from "@dcmjs-org/video";
11
- import bundle, {
12
- media,
13
- encapsulated,
14
- image,
15
- createVideoEventSource
16
- } from "../src/index.js";
17
-
18
- /** Each name of `namespace` is the same object as the export of `source`. */
19
- function expectSameExports(namespace, source, names) {
20
- for (const name of names) {
21
- expect(source[name]).toBeDefined();
22
- expect(namespace[name]).toBe(source[name]);
23
- }
24
- }
25
-
26
- test("media namespace re-exports the @dcmjs-org/dicomdir surface by identity", () => {
27
- expectSameExports(media, dicomdir, [
28
- "buildDicomDirDataset",
29
- "writeDicomDir",
30
- "MEDIA_STORAGE_DIRECTORY_SOP_CLASS_UID"
31
- ]);
32
- });
33
-
34
- test("encapsulated namespace re-exports the encapsulated and video surfaces by identity", () => {
35
- expectSameExports(encapsulated, encapsulatedPackage, [
36
- "encapsulate",
37
- "encapsulatedBase",
38
- "encapsulatePdf",
39
- "encapsulatedPdfBase",
40
- "extractEncapsulatedPdf",
41
- "ENCAPSULATED_PDF_SOP_CLASS_UID",
42
- "PDF_MIME_TYPE"
43
- ]);
44
- expectSameExports(encapsulated, video, [
45
- "buildVideoDataset",
46
- "videoBase",
47
- "encapsulateVideo",
48
- "extractEncapsulatedVideo",
49
- "VIDEO_PHOTOGRAPHIC_SOP_CLASS_UID",
50
- "DEFAULT_FRAGMENT_BYTES"
51
- ]);
52
- });
53
-
54
- test("image namespace re-exports the imaging and MP4 surfaces by identity", () => {
55
- expectSameExports(image, imaging, [
56
- "buildImageDataset",
57
- "imageBase",
58
- "derivedImageBase",
59
- "SECONDARY_CAPTURE_SOP_CLASS_UID",
60
- "parseJpegInfo",
61
- "h264TransferSyntaxUID"
62
- ]);
63
- expectSameExports(image, video, ["parseMp4Info"]);
64
- });
65
-
66
- test("the streaming video source and the default export ride along", () => {
67
- expect(createVideoEventSource).toBe(video.createVideoEventSource);
68
- expect(bundle.media).toBe(media);
69
- expect(bundle.encapsulated).toBe(encapsulated);
70
- expect(bundle.image).toBe(image);
71
- expect(bundle.createVideoEventSource).toBe(createVideoEventSource);
72
- });
73
-
74
- test("a re-exported builder actually works through the bundle", () => {
75
- const pdfBytes = new Uint8Array([
76
- 0x25, 0x50, 0x44, 0x46, 0x2d, 0x31, 0x2e, 0x34
77
- ]); // "%PDF-1.4"
78
- const dataset = encapsulated.encapsulatePdf(pdfBytes, {
79
- overrides: { PatientName: "DOE^JANE" }
80
- });
81
- expect(dataset.SOPClassUID).toBe(
82
- encapsulated.ENCAPSULATED_PDF_SOP_CLASS_UID
83
- );
84
- expect(dataset.PatientName).toBe("DOE^JANE");
85
- const { bytes } = encapsulated.extractEncapsulatedPdf(dataset);
86
- expect(Array.from(new Uint8Array(bytes))).toEqual(Array.from(pdfBytes));
87
- });