@file-viewer/renderer-signature 3.0.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/LICENSE +160 -0
- package/README.en.md +87 -0
- package/README.md +89 -0
- package/THIRD_PARTY_LICENSES.json +3867 -0
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/container.worker.d.ts +1 -0
- package/dist/container.worker.js +39 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +53 -0
- package/dist/inspect.d.ts +7 -0
- package/dist/inspect.js +4 -0
- package/dist/openpgp/client.d.ts +16 -0
- package/dist/openpgp/client.js +148 -0
- package/dist/openpgp/formatDetection.d.ts +3 -0
- package/dist/openpgp/formatDetection.js +45 -0
- package/dist/openpgp/types.d.ts +72 -0
- package/dist/openpgp/types.js +1 -0
- package/dist/rpgp-wasm/rpgp_wrapper.d.ts +43 -0
- package/dist/rpgp-wasm/rpgp_wrapper.js +578 -0
- package/dist/rpgp-wasm/rpgp_wrapper_bg.wasm +0 -0
- package/dist/rpgp-wasm/rpgp_wrapper_bg.wasm.d.ts +10 -0
- package/dist/signature.d.ts +24 -0
- package/dist/signature.js +1040 -0
- package/dist/signature.worker.d.ts +1 -0
- package/dist/signature.worker.js +108 -0
- package/dist/signatureAsn1.d.ts +150 -0
- package/dist/signatureAsn1.js +1486 -0
- package/dist/structured/asic.d.ts +3 -0
- package/dist/structured/asic.js +188 -0
- package/dist/structured/containerClient.d.ts +12 -0
- package/dist/structured/containerClient.js +71 -0
- package/dist/structured/containerProtocol.d.ts +20 -0
- package/dist/structured/containerProtocol.js +1 -0
- package/dist/structured/jws.d.ts +3 -0
- package/dist/structured/jws.js +382 -0
- package/dist/structured/limits.d.ts +20 -0
- package/dist/structured/limits.js +41 -0
- package/dist/structured/types.d.ts +53 -0
- package/dist/structured/types.js +1 -0
- package/dist/structured/zipPreflight.d.ts +14 -0
- package/dist/structured/zipPreflight.js +173 -0
- package/dist/workerProtocol.d.ts +40 -0
- package/dist/workerProtocol.js +1 -0
- package/file-viewer.capability.json +56 -0
- package/package.json +106 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const CENTRAL_DIRECTORY_SIGNATURE = 0x02014b50;
|
|
2
|
+
const END_OF_CENTRAL_DIRECTORY_SIGNATURE = 0x06054b50;
|
|
3
|
+
const LOCAL_FILE_HEADER_SIGNATURE = 0x04034b50;
|
|
4
|
+
const DATA_DESCRIPTOR_SIGNATURE = 0x08074b50;
|
|
5
|
+
const DATA_DESCRIPTOR_FLAG = 0x0008;
|
|
6
|
+
const ZIP64_SENTINEL_16 = 0xffff;
|
|
7
|
+
const ZIP64_SENTINEL_32 = 0xffffffff;
|
|
8
|
+
const assertZip = (condition, message) => {
|
|
9
|
+
if (!condition)
|
|
10
|
+
throw new Error(`Unsafe ASiC ZIP: ${message}`);
|
|
11
|
+
};
|
|
12
|
+
const decodeName = (bytes, utf8) => {
|
|
13
|
+
const name = new TextDecoder(utf8 ? 'utf-8' : 'windows-1252', { fatal: true })
|
|
14
|
+
.decode(bytes)
|
|
15
|
+
.normalize('NFC');
|
|
16
|
+
assertZip(!Array.from(name).some((character) => {
|
|
17
|
+
const codePoint = character.codePointAt(0);
|
|
18
|
+
return codePoint === 0x7f || codePoint < 0x20;
|
|
19
|
+
}), 'entry name contains control characters.');
|
|
20
|
+
assertZip(!name.includes('\\'), 'backslash paths are rejected.');
|
|
21
|
+
assertZip(!name.startsWith('/') && !/^[A-Za-z]:/u.test(name), 'absolute entry paths are rejected.');
|
|
22
|
+
const segments = name.split('/').filter(Boolean);
|
|
23
|
+
assertZip(segments.length > 0, 'empty entry name.');
|
|
24
|
+
assertZip(segments.every((segment) => segment !== '.' && segment !== '..'), 'entry path traversal is rejected.');
|
|
25
|
+
return name;
|
|
26
|
+
};
|
|
27
|
+
const locateEndRecord = (view) => {
|
|
28
|
+
const minimum = Math.max(0, view.byteLength - 65557);
|
|
29
|
+
for (let offset = view.byteLength - 22; offset >= minimum; offset -= 1) {
|
|
30
|
+
if (view.getUint32(offset, true) === END_OF_CENTRAL_DIRECTORY_SIGNATURE)
|
|
31
|
+
return offset;
|
|
32
|
+
}
|
|
33
|
+
throw new Error('Unsafe ASiC ZIP: end-of-central-directory record is missing.');
|
|
34
|
+
};
|
|
35
|
+
const equalBytes = (left, right) => {
|
|
36
|
+
if (left.byteLength !== right.byteLength)
|
|
37
|
+
return false;
|
|
38
|
+
let mismatch = 0;
|
|
39
|
+
for (let index = 0; index < left.byteLength; index += 1) {
|
|
40
|
+
mismatch |= left[index] ^ right[index];
|
|
41
|
+
}
|
|
42
|
+
return mismatch === 0;
|
|
43
|
+
};
|
|
44
|
+
export const inspectZipCentralDirectory = (input, limits) => {
|
|
45
|
+
const bytes = input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
46
|
+
assertZip(bytes.byteLength > 0 && bytes.byteLength <= limits.maxContainerBytes, `container exceeds ${limits.maxContainerBytes} bytes.`);
|
|
47
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
48
|
+
const eocd = locateEndRecord(view);
|
|
49
|
+
const diskNumber = view.getUint16(eocd + 4, true);
|
|
50
|
+
const centralDisk = view.getUint16(eocd + 6, true);
|
|
51
|
+
const diskEntries = view.getUint16(eocd + 8, true);
|
|
52
|
+
const totalEntries = view.getUint16(eocd + 10, true);
|
|
53
|
+
const centralSize = view.getUint32(eocd + 12, true);
|
|
54
|
+
const centralOffset = view.getUint32(eocd + 16, true);
|
|
55
|
+
const commentLength = view.getUint16(eocd + 20, true);
|
|
56
|
+
assertZip(eocd + 22 + commentLength === bytes.byteLength, 'trailing bytes after the ZIP end record are rejected.');
|
|
57
|
+
assertZip(diskNumber === 0 && centralDisk === 0 && diskEntries === totalEntries, 'multi-disk ZIP archives are rejected.');
|
|
58
|
+
assertZip(totalEntries !== ZIP64_SENTINEL_16 &&
|
|
59
|
+
centralSize !== ZIP64_SENTINEL_32 &&
|
|
60
|
+
centralOffset !== ZIP64_SENTINEL_32, 'ZIP64 archives are not accepted by this bounded preview path.');
|
|
61
|
+
assertZip(totalEntries > 0 && totalEntries <= limits.maxEntries, `entry count exceeds ${limits.maxEntries}.`);
|
|
62
|
+
assertZip(centralOffset + centralSize === eocd, 'central-directory bounds are inconsistent.');
|
|
63
|
+
const entries = [];
|
|
64
|
+
const physicalRanges = [];
|
|
65
|
+
const normalizedNames = new Set();
|
|
66
|
+
let totalUncompressedBytes = 0;
|
|
67
|
+
let cursor = centralOffset;
|
|
68
|
+
for (let index = 0; index < totalEntries; index += 1) {
|
|
69
|
+
assertZip(cursor + 46 <= eocd && view.getUint32(cursor, true) === CENTRAL_DIRECTORY_SIGNATURE, 'central-directory entry is malformed.');
|
|
70
|
+
const flags = view.getUint16(cursor + 8, true);
|
|
71
|
+
const compressionMethod = view.getUint16(cursor + 10, true);
|
|
72
|
+
const crc32 = view.getUint32(cursor + 16, true);
|
|
73
|
+
const compressedSize = view.getUint32(cursor + 20, true);
|
|
74
|
+
const uncompressedSize = view.getUint32(cursor + 24, true);
|
|
75
|
+
const nameLength = view.getUint16(cursor + 28, true);
|
|
76
|
+
const extraLength = view.getUint16(cursor + 30, true);
|
|
77
|
+
const entryCommentLength = view.getUint16(cursor + 32, true);
|
|
78
|
+
const diskStart = view.getUint16(cursor + 34, true);
|
|
79
|
+
const externalAttributes = view.getUint32(cursor + 38, true);
|
|
80
|
+
const localHeaderOffset = view.getUint32(cursor + 42, true);
|
|
81
|
+
const next = cursor + 46 + nameLength + extraLength + entryCommentLength;
|
|
82
|
+
assertZip(next <= eocd, 'central-directory entry exceeds its boundary.');
|
|
83
|
+
assertZip((flags & 0x0001) === 0, 'encrypted entries are rejected.');
|
|
84
|
+
assertZip(compressionMethod === 0 || compressionMethod === 8, `compression method ${compressionMethod} is unsupported.`);
|
|
85
|
+
assertZip(compressedSize !== ZIP64_SENTINEL_32 &&
|
|
86
|
+
uncompressedSize !== ZIP64_SENTINEL_32 &&
|
|
87
|
+
localHeaderOffset !== ZIP64_SENTINEL_32 &&
|
|
88
|
+
diskStart !== ZIP64_SENTINEL_16, 'ZIP64 entry fields are rejected.');
|
|
89
|
+
assertZip(diskStart === 0, 'multi-disk entries are rejected.');
|
|
90
|
+
const nameBytes = bytes.subarray(cursor + 46, cursor + 46 + nameLength);
|
|
91
|
+
assertZip(nameBytes.byteLength <= limits.maxPathBytes, `entry path exceeds ${limits.maxPathBytes} bytes.`);
|
|
92
|
+
const name = decodeName(nameBytes, (flags & 0x0800) !== 0);
|
|
93
|
+
const collisionKey = name.toLocaleLowerCase('en-US');
|
|
94
|
+
assertZip(!normalizedNames.has(collisionKey), `duplicate or case-colliding entry ${name}.`);
|
|
95
|
+
normalizedNames.add(collisionKey);
|
|
96
|
+
const unixMode = externalAttributes >>> 16;
|
|
97
|
+
assertZip((unixMode & 0xf000) !== 0xa000, `symbolic link ${name} is rejected.`);
|
|
98
|
+
const directory = name.endsWith('/') || (externalAttributes & 0x10) !== 0;
|
|
99
|
+
if (!directory) {
|
|
100
|
+
assertZip(uncompressedSize <= limits.maxEntryBytes, `entry ${name} exceeds ${limits.maxEntryBytes} bytes.`);
|
|
101
|
+
assertZip(compressedSize > 0 || uncompressedSize === 0, `entry ${name} has an impossible compressed size.`);
|
|
102
|
+
if (compressedSize > 0) {
|
|
103
|
+
assertZip(uncompressedSize / compressedSize <= limits.maxCompressionRatio, `entry ${name} exceeds compression ratio ${limits.maxCompressionRatio}.`);
|
|
104
|
+
}
|
|
105
|
+
totalUncompressedBytes += uncompressedSize;
|
|
106
|
+
assertZip(Number.isSafeInteger(totalUncompressedBytes) &&
|
|
107
|
+
totalUncompressedBytes <= limits.maxTotalUncompressedBytes, `uncompressed total exceeds ${limits.maxTotalUncompressedBytes} bytes.`);
|
|
108
|
+
}
|
|
109
|
+
assertZip(localHeaderOffset + 30 <= centralOffset &&
|
|
110
|
+
view.getUint32(localHeaderOffset, true) === LOCAL_FILE_HEADER_SIGNATURE, `local header for ${name} is invalid.`);
|
|
111
|
+
const localFlags = view.getUint16(localHeaderOffset + 6, true);
|
|
112
|
+
const localCompressionMethod = view.getUint16(localHeaderOffset + 8, true);
|
|
113
|
+
const localCrc32 = view.getUint32(localHeaderOffset + 14, true);
|
|
114
|
+
const localCompressedSize = view.getUint32(localHeaderOffset + 18, true);
|
|
115
|
+
const localUncompressedSize = view.getUint32(localHeaderOffset + 22, true);
|
|
116
|
+
const localNameLength = view.getUint16(localHeaderOffset + 26, true);
|
|
117
|
+
const localExtraLength = view.getUint16(localHeaderOffset + 28, true);
|
|
118
|
+
assertZip(localFlags === flags, `local and central flags differ for ${name}.`);
|
|
119
|
+
assertZip(localCompressionMethod === compressionMethod, `local and central compression methods differ for ${name}.`);
|
|
120
|
+
assertZip(localCompressedSize !== ZIP64_SENTINEL_32 && localUncompressedSize !== ZIP64_SENTINEL_32, `local ZIP64 size fields are rejected for ${name}.`);
|
|
121
|
+
const localNameStart = localHeaderOffset + 30;
|
|
122
|
+
const localNameEnd = localNameStart + localNameLength;
|
|
123
|
+
const dataStart = localNameEnd + localExtraLength;
|
|
124
|
+
assertZip(localNameEnd <= centralOffset && dataStart <= centralOffset, `local header fields for ${name} escape the data section.`);
|
|
125
|
+
assertZip(localNameLength <= limits.maxPathBytes, `local entry path for ${name} exceeds ${limits.maxPathBytes} bytes.`);
|
|
126
|
+
const localNameBytes = bytes.subarray(localNameStart, localNameEnd);
|
|
127
|
+
assertZip(equalBytes(localNameBytes, nameBytes), `local and central entry names differ for ${name}.`);
|
|
128
|
+
const usesDataDescriptor = (flags & DATA_DESCRIPTOR_FLAG) !== 0;
|
|
129
|
+
if (usesDataDescriptor) {
|
|
130
|
+
assertZip((localCrc32 === 0 || localCrc32 === crc32) &&
|
|
131
|
+
(localCompressedSize === 0 || localCompressedSize === compressedSize) &&
|
|
132
|
+
(localUncompressedSize === 0 || localUncompressedSize === uncompressedSize), `local placeholder fields conflict with the central directory for ${name}.`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
assertZip(localCrc32 === crc32 &&
|
|
136
|
+
localCompressedSize === compressedSize &&
|
|
137
|
+
localUncompressedSize === uncompressedSize, `local CRC or size fields differ from the central directory for ${name}.`);
|
|
138
|
+
}
|
|
139
|
+
const dataEnd = dataStart + compressedSize;
|
|
140
|
+
assertZip(dataEnd <= centralOffset, `compressed data for ${name} escapes the data section.`);
|
|
141
|
+
let recordEnd = dataEnd;
|
|
142
|
+
if (usesDataDescriptor) {
|
|
143
|
+
let descriptorStart = dataEnd;
|
|
144
|
+
assertZip(descriptorStart + 12 <= centralOffset, `data descriptor for ${name} is truncated.`);
|
|
145
|
+
if (view.getUint32(descriptorStart, true) === DATA_DESCRIPTOR_SIGNATURE) {
|
|
146
|
+
descriptorStart += 4;
|
|
147
|
+
assertZip(descriptorStart + 12 <= centralOffset, `signed data descriptor for ${name} is truncated.`);
|
|
148
|
+
}
|
|
149
|
+
assertZip(view.getUint32(descriptorStart, true) === crc32 &&
|
|
150
|
+
view.getUint32(descriptorStart + 4, true) === compressedSize &&
|
|
151
|
+
view.getUint32(descriptorStart + 8, true) === uncompressedSize, `data descriptor differs from the central directory for ${name}.`);
|
|
152
|
+
recordEnd = descriptorStart + 12;
|
|
153
|
+
}
|
|
154
|
+
physicalRanges.push({ name, start: localHeaderOffset, end: recordEnd });
|
|
155
|
+
entries.push({
|
|
156
|
+
name,
|
|
157
|
+
compressedSize,
|
|
158
|
+
uncompressedSize,
|
|
159
|
+
compressionMethod: compressionMethod,
|
|
160
|
+
localHeaderOffset,
|
|
161
|
+
directory
|
|
162
|
+
});
|
|
163
|
+
cursor = next;
|
|
164
|
+
}
|
|
165
|
+
assertZip(cursor === eocd, 'central-directory size does not match parsed entries.');
|
|
166
|
+
physicalRanges.sort((left, right) => left.start - right.start || left.end - right.end);
|
|
167
|
+
for (let index = 1; index < physicalRanges.length; index += 1) {
|
|
168
|
+
const previous = physicalRanges[index - 1];
|
|
169
|
+
const current = physicalRanges[index];
|
|
170
|
+
assertZip(previous.end <= current.start, `local record ranges overlap between ${previous.name} and ${current.name}.`);
|
|
171
|
+
}
|
|
172
|
+
return { entries, totalUncompressedBytes };
|
|
173
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { OpenPgpInspectionResult, OpenPgpVerificationResult, OpenPgpWorkerError, SignatureParseLimits } from './openpgp/types.js';
|
|
2
|
+
export type SignatureWorkerRequest = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'classify';
|
|
5
|
+
input: ArrayBuffer;
|
|
6
|
+
limits: SignatureParseLimits;
|
|
7
|
+
} | {
|
|
8
|
+
id: string;
|
|
9
|
+
type: 'inspect';
|
|
10
|
+
input: ArrayBuffer;
|
|
11
|
+
publicKeys: ArrayBuffer[];
|
|
12
|
+
limits: SignatureParseLimits;
|
|
13
|
+
} | {
|
|
14
|
+
id: string;
|
|
15
|
+
type: 'verify-detached';
|
|
16
|
+
content: ArrayBuffer;
|
|
17
|
+
signature: ArrayBuffer;
|
|
18
|
+
publicKeys: ArrayBuffer[];
|
|
19
|
+
limits: SignatureParseLimits;
|
|
20
|
+
};
|
|
21
|
+
export type SignatureWorkerResponse = {
|
|
22
|
+
id: string;
|
|
23
|
+
ok: true;
|
|
24
|
+
type: 'classify';
|
|
25
|
+
result: OpenPgpInspectionResult;
|
|
26
|
+
} | {
|
|
27
|
+
id: string;
|
|
28
|
+
ok: true;
|
|
29
|
+
type: 'inspect';
|
|
30
|
+
result: OpenPgpInspectionResult;
|
|
31
|
+
} | {
|
|
32
|
+
id: string;
|
|
33
|
+
ok: true;
|
|
34
|
+
type: 'verify-detached';
|
|
35
|
+
result: OpenPgpVerificationResult;
|
|
36
|
+
} | {
|
|
37
|
+
id: string;
|
|
38
|
+
ok: false;
|
|
39
|
+
error: OpenPgpWorkerError;
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../ecosystem/capability-manifest.schema.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"id": "signature",
|
|
5
|
+
"packageName": "@file-viewer/renderer-signature",
|
|
6
|
+
"activation": {
|
|
7
|
+
"kind": "renderer-export",
|
|
8
|
+
"import": "@file-viewer/renderer-signature",
|
|
9
|
+
"export": "signatureRenderer"
|
|
10
|
+
},
|
|
11
|
+
"rendererIds": ["signature"],
|
|
12
|
+
"formats": [
|
|
13
|
+
"p7m",
|
|
14
|
+
"p7s",
|
|
15
|
+
"p7c",
|
|
16
|
+
"p7b",
|
|
17
|
+
"pkcs7",
|
|
18
|
+
"cms",
|
|
19
|
+
"cmsc",
|
|
20
|
+
"tsd",
|
|
21
|
+
"tst",
|
|
22
|
+
"tsq",
|
|
23
|
+
"tsr",
|
|
24
|
+
"asics",
|
|
25
|
+
"scs",
|
|
26
|
+
"asice",
|
|
27
|
+
"sce",
|
|
28
|
+
"ers",
|
|
29
|
+
"asc",
|
|
30
|
+
"sig",
|
|
31
|
+
"pgp",
|
|
32
|
+
"gpg",
|
|
33
|
+
"jws"
|
|
34
|
+
],
|
|
35
|
+
"assets": {
|
|
36
|
+
"rendererIds": []
|
|
37
|
+
},
|
|
38
|
+
"license": {
|
|
39
|
+
"spdx": "Apache-2.0",
|
|
40
|
+
"policy": "permissive",
|
|
41
|
+
"notices": [
|
|
42
|
+
{
|
|
43
|
+
"packageName": "rPGP / pgp",
|
|
44
|
+
"spdx": "MIT OR Apache-2.0",
|
|
45
|
+
"notice": "Pinned at 0.20.0 and compiled to a lazy Web Worker/WASM module; exact transitive versions are locked in rust/Cargo.lock."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"packageName": "JSZip",
|
|
49
|
+
"spdx": "MIT OR GPL-3.0-or-later",
|
|
50
|
+
"notice": "Pinned at 3.10.1 and used under its MIT license after a bounded ZIP central-directory preflight."
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"weight": "heavy",
|
|
55
|
+
"profiles": []
|
|
56
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@file-viewer/renderer-signature",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"description": "Opt-in browser-local CMS, CAdES, timestamp, ASiC, evidence-record, JWS and OpenPGP renderer for File Viewer.",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"file-viewer",
|
|
10
|
+
"renderer",
|
|
11
|
+
"signature",
|
|
12
|
+
"cms",
|
|
13
|
+
"pkcs7",
|
|
14
|
+
"cades",
|
|
15
|
+
"rfc3161",
|
|
16
|
+
"timestamp",
|
|
17
|
+
"asic",
|
|
18
|
+
"evidence-record",
|
|
19
|
+
"jws",
|
|
20
|
+
"document-preview",
|
|
21
|
+
"self-hosted",
|
|
22
|
+
"openpgp",
|
|
23
|
+
"rpgp",
|
|
24
|
+
"wasm",
|
|
25
|
+
"web-worker"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"registry": "https://registry.npmjs.org/"
|
|
30
|
+
},
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "Yu Wang",
|
|
33
|
+
"email": "admin@flyfish.dev"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/flyfish-dev/file-viewer.git",
|
|
38
|
+
"directory": "packages/renderers/signature"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://doc.file-viewer.app/guide/on-demand-renderers",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/flyfish-dev/file-viewer/issues"
|
|
43
|
+
},
|
|
44
|
+
"funding": {
|
|
45
|
+
"type": "individual",
|
|
46
|
+
"url": "https://dev.flyfish.group/donate?source=npm"
|
|
47
|
+
},
|
|
48
|
+
"fileViewer": {
|
|
49
|
+
"capabilityManifest": "file-viewer.capability.json"
|
|
50
|
+
},
|
|
51
|
+
"main": "./dist/index.js",
|
|
52
|
+
"module": "./dist/index.js",
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
54
|
+
"exports": {
|
|
55
|
+
".": {
|
|
56
|
+
"types": "./dist/index.d.ts",
|
|
57
|
+
"import": "./dist/index.js",
|
|
58
|
+
"default": "./dist/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./package.json": "./package.json",
|
|
61
|
+
"./capability": "./file-viewer.capability.json",
|
|
62
|
+
"./inspect": {
|
|
63
|
+
"types": "./dist/inspect.d.ts",
|
|
64
|
+
"import": "./dist/inspect.js",
|
|
65
|
+
"default": "./dist/inspect.js"
|
|
66
|
+
},
|
|
67
|
+
"./worker/signature.worker.js": "./dist/signature.worker.js",
|
|
68
|
+
"./worker/container.worker.js": "./dist/container.worker.js",
|
|
69
|
+
"./wasm/rpgp_wrapper.js": "./dist/rpgp-wasm/rpgp_wrapper.js",
|
|
70
|
+
"./wasm/rpgp_wrapper_bg.wasm": "./dist/rpgp-wasm/rpgp_wrapper_bg.wasm"
|
|
71
|
+
},
|
|
72
|
+
"files": [
|
|
73
|
+
"dist",
|
|
74
|
+
"README.md",
|
|
75
|
+
"README.en.md",
|
|
76
|
+
"file-viewer.capability.json",
|
|
77
|
+
"LICENSE",
|
|
78
|
+
"THIRD_PARTY_NOTICES.md",
|
|
79
|
+
"THIRD_PARTY_LICENSES.json"
|
|
80
|
+
],
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@file-viewer/core": "3.0.0",
|
|
83
|
+
"jszip": "3.10.1"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"typescript": "^6.0.3"
|
|
87
|
+
},
|
|
88
|
+
"license": "Apache-2.0",
|
|
89
|
+
"scripts": {
|
|
90
|
+
"build:ts": "tsc -b tsconfig.json --force",
|
|
91
|
+
"build:wasm": "node scripts/build-wasm.mjs",
|
|
92
|
+
"build": "pnpm build:ts && pnpm build:wasm",
|
|
93
|
+
"type-check": "tsc -b tsconfig.json",
|
|
94
|
+
"verify:github-206": "pnpm build:ts && node scripts/verify-github-206.mjs",
|
|
95
|
+
"verify:fixtures": "bash test/fixtures/github-206-contributed/scripts/verify_all.sh",
|
|
96
|
+
"verify:openpgp-architecture": "node scripts/verify-openpgp-architecture.mjs",
|
|
97
|
+
"verify:openpgp-detection": "pnpm build:ts && node scripts/verify-openpgp-detection.mjs",
|
|
98
|
+
"verify:openpgp-runtime": "node scripts/verify-openpgp-runtime.mjs",
|
|
99
|
+
"verify:structured": "pnpm build:ts && node scripts/verify-structured-formats.mjs",
|
|
100
|
+
"generate:licenses": "node scripts/generate-license-ledger.mjs",
|
|
101
|
+
"verify:licenses": "node scripts/generate-license-ledger.mjs --check",
|
|
102
|
+
"verify:artifacts": "node scripts/verify-artifacts.mjs",
|
|
103
|
+
"verify:openpgp": "pnpm build:wasm && pnpm verify:openpgp-architecture && pnpm verify:openpgp-detection && pnpm verify:openpgp-runtime",
|
|
104
|
+
"verify": "pnpm verify:licenses && pnpm verify:fixtures && pnpm verify:github-206 && pnpm verify:structured && pnpm verify:openpgp && pnpm verify:artifacts"
|
|
105
|
+
}
|
|
106
|
+
}
|