♻️ Split SsnDiffType interface into separate file
This commit is contained in:
parent
9aff99ae86
commit
bddaef0373
9 changed files with 23 additions and 23 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
export { default as IManifest } from './interfaces/IManifest';
|
||||
export { default as ISolidSimple } from './interfaces/ISolidSimple';
|
||||
export { ISsnFileEntry } from './interfaces/ISsnFileEntry';
|
||||
export { default as ISsnFileEntry } from './interfaces/ISsnFileEntry';
|
||||
export { default as Product } from './interfaces/Product';
|
||||
export { default as findReleasePath } from './ssn/findReleasePath';
|
||||
export { default as getManifest } from './ssn/getManifest';
|
||||
|
|
|
@ -20,7 +20,7 @@ interface ISolidInfo {
|
|||
uniqueid: string;
|
||||
}
|
||||
|
||||
interface ISolid {
|
||||
export default interface ISolid {
|
||||
/** Timestamp when this torrent was created, given in seconds since 1970. Can be read with `new Date(... * 1000)`. */
|
||||
'creation date': number;
|
||||
/** Internal tracker URL used to announce this torrent. */
|
||||
|
@ -36,5 +36,3 @@ interface ISolid {
|
|||
/** Contains further information about this torrent, including the list of files. */
|
||||
info: ISolidInfo;
|
||||
}
|
||||
|
||||
export default ISolid;
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
enum SsnDiffType {
|
||||
/** We included the original file contents, not just the differences, because file is new or it's in a format that's not suitable for diffing. */
|
||||
NewFile = 0,
|
||||
/** File is not included in the .zip archive because it has been deleted. */
|
||||
Deleted = 1,
|
||||
/** File has changed and we include the differences, encoded in vcdiff/xdelta3 */
|
||||
Changed = 2,
|
||||
/** File is not included in the .zip archive because it hasn't changed */
|
||||
Unchanged = 3,
|
||||
}
|
||||
import SsnDiffType from './SsnDiffType';
|
||||
|
||||
interface ISsnFileEntry {
|
||||
export default interface ISsnFileEntry {
|
||||
/** CRC-32 checksum of this file. */
|
||||
crc: number;
|
||||
/** If we only store the differences, the size of the destination file. */
|
||||
|
@ -33,5 +24,3 @@ interface ISsnFileEntry {
|
|||
/** Offset into the disk to where the local file header starts. */
|
||||
offset: number;
|
||||
}
|
||||
|
||||
export { ISsnFileEntry, SsnDiffType };
|
||||
|
|
12
src/interfaces/SsnDiffType.ts
Normal file
12
src/interfaces/SsnDiffType.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
enum SsnDiffType {
|
||||
/** We included the original file contents, not just the differences, because file is new or it's in a format that's not suitable for diffing. */
|
||||
NewFile = 0,
|
||||
/** File is not included in the .zip archive because it has been deleted. */
|
||||
Deleted = 1,
|
||||
/** File has changed and we include the differences, encoded in vcdiff/xdelta3 */
|
||||
Changed = 2,
|
||||
/** File is not included in the .zip archive because it hasn't changed */
|
||||
Unchanged = 3,
|
||||
}
|
||||
|
||||
export default SsnDiffType;
|
|
@ -1,6 +1,6 @@
|
|||
import * as stream from 'stream';
|
||||
import * as zlib from 'zlib';
|
||||
import { ISsnFileEntry } from '../interfaces/ISsnFileEntry';
|
||||
import ISsnFileEntry from '../interfaces/ISsnFileEntry';
|
||||
import decryptTransform from './streams/decryptTransform';
|
||||
import readBytesFromStream from './streams/readBytesFromStream';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import getUrlContents from '../cdn/getUrlContents';
|
||||
import { ISsnFileEntry } from '../interfaces/ISsnFileEntry';
|
||||
import ISsnFileEntry from '../interfaces/ISsnFileEntry';
|
||||
import Product from '../interfaces/Product';
|
||||
import getSolidpkg from './getSolidpkg';
|
||||
import readSsnFile from './reader/readSsnFile';
|
||||
|
|
|
@ -3,8 +3,9 @@ import * as path from 'path';
|
|||
import downloadWrapper from '../cdn/downloadWrapper';
|
||||
import createDirRecursively from '../cdn/funcs/createDirRecursively';
|
||||
import getUrlContents from '../cdn/getUrlContents';
|
||||
import { ISsnFileEntry, SsnDiffType } from '../interfaces/ISsnFileEntry';
|
||||
import ISsnFileEntry from '../interfaces/ISsnFileEntry';
|
||||
import Product from '../interfaces/Product';
|
||||
import SsnDiffType from '../interfaces/SsnDiffType';
|
||||
import getSolidpkg from './getSolidpkg';
|
||||
import launch from './installation/launch';
|
||||
import taskManager from './installation/taskManager';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Check the .ZIP File Format Specification <https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT>.
|
||||
*/
|
||||
|
||||
import { ISsnFileEntry } from '../../interfaces/ISsnFileEntry';
|
||||
import ISsnFileEntry from '../../interfaces/ISsnFileEntry';
|
||||
import getDecryptionKeys from '../decryption/getDecryptionKeys';
|
||||
import modifyPassword from '../decryption/modifyPassword';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ISsnFileEntry } from '../../interfaces/ISsnFileEntry';
|
||||
import { SsnDiffType } from '../../interfaces/ISsnFileEntry';
|
||||
import ISsnFileEntry from '../../interfaces/ISsnFileEntry';
|
||||
import Product from '../../interfaces/Product';
|
||||
import SsnDiffType from '../../interfaces/SsnDiffType';
|
||||
|
||||
/** Receives a list of file entries from the .zip file and checks them for correctness */
|
||||
export default function verifyPatch(fileEntries: ISsnFileEntry[], product: Product, from: number): void {
|
||||
|
|
Loading…
Reference in a new issue