🚚 Rename getReleaseZip to getPatchZip, add comments

This commit is contained in:
C-3PO 2018-10-21 03:50:23 +02:00
parent f56f0c85e1
commit a6c5204b50
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
6 changed files with 18 additions and 5 deletions

2
package-lock.json generated
View file

@ -15,7 +15,7 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
}, },
"ssn-installer": { "ssn-installer": {
"version": "git+https://git.jedipedia.net/swtor/ssn-installer.git#01926cfe97a3166cff46a2061dda519f9c262d40", "version": "git+https://git.jedipedia.net/swtor/ssn-installer.git#9a5db3aa4eaa7e6b01a26de47151c2dbe6520c82",
"from": "git+https://git.jedipedia.net/swtor/ssn-installer.git" "from": "git+https://git.jedipedia.net/swtor/ssn-installer.git"
}, },
"xml-js": { "xml-js": {

View file

@ -7,8 +7,8 @@ import { ISsnFileEntry } from './interfaces/ISsnFileEntry';
import findReleasePath from './ssn/findReleasePath'; import findReleasePath from './ssn/findReleasePath';
import getManifest from './ssn/getManifest'; import getManifest from './ssn/getManifest';
import getPatch from './ssn/getPatch'; import getPatch from './ssn/getPatch';
import getReleaseZip from './ssn/getReleaseZip'; import getPatchZip from './ssn/getPatchZip';
import getSolidpkg from './ssn/getSolidpkg'; import getSolidpkg from './ssn/getSolidpkg';
import verifyProductName from './ssn/verify/verifyProductName'; import verifyProductName from './ssn/verify/verifyProductName';
export { IManifest, ISolidSimple, ISsnFileEntry, Product, findReleasePath, getManifest, getPatch, getSolidpkg, getReleaseZip, verifyProductName }; export { IManifest, ISolidSimple, ISsnFileEntry, Product, findReleasePath, getManifest, getPatch, getSolidpkg, getPatchZip, verifyProductName };

View file

@ -11,6 +11,10 @@ import streamToString from './streams/streamToString';
import verifyPatchmanifest from './verify/verifyPatchmanifest'; import verifyPatchmanifest from './verify/verifyPatchmanifest';
import verifyProductName from './verify/verifyProductName'; import verifyProductName from './verify/verifyProductName';
/** Downloads the .patchmanifest file for the given product,
* extracts the manifest.xml file inside and returns it in
* JSON format.
*/
export default async function getManifest(product: Product): Promise<IManifest> { export default async function getManifest(product: Product): Promise<IManifest> {
//Verify function arguments //Verify function arguments
if (!verifyProductName(product)) { if (!verifyProductName(product)) {

View file

@ -25,7 +25,7 @@ interface IGetPatchArgs {
targetDirectory: string; targetDirectory: string;
} }
/** Downloads and applies the specified patch. */ /** Downloads and installs the specified patch. */
export default async function getPatch({ product, from, to, sourceDirectory, targetDirectory }: IGetPatchArgs) { export default async function getPatch({ product, from, to, sourceDirectory, targetDirectory }: IGetPatchArgs) {
//Verify function arguments //Verify function arguments

View file

@ -5,7 +5,12 @@ import getSolidpkg from './getSolidpkg';
import readSsnFile from './reader/readSsnFile'; import readSsnFile from './reader/readSsnFile';
import verifyPatch from './verify/verifyPatch'; import verifyPatch from './verify/verifyPatch';
export default async function getSolidpkgZip(product: Product, from: number, to: number): Promise<ISsnFileEntry[]> { /** Downloads the .solidpkg file from from the given patch
* to get a the URL of the .zip file, then downloads that
* zip file, reads the list of file entries and returns
* them.
*/
export default async function getPatchZip(product: Product, from: number, to: number): Promise<ISsnFileEntry[]> {
const solidpkg = await getSolidpkg(product, from, to); const solidpkg = await getSolidpkg(product, from, to);
function createUrlObject({ name, length }: {name: string, length: number}) { function createUrlObject({ name, length }: {name: string, length: number}) {

View file

@ -11,6 +11,10 @@ import streamToArrayBuffer from './streams/streamToArrayBuffer';
import verifyProductName from './verify/verifyProductName'; import verifyProductName from './verify/verifyProductName';
import verifySolidpkg from './verify/verifySolidpkg'; import verifySolidpkg from './verify/verifySolidpkg';
/** Downloads the .solidpkg file from the given patch,
* extracts the metafile.solid file inside and returns
* the contents (list of .zip and .z01 disk files).
*/
export default async function getSolidpkg(product: Product, from: number, to: number): Promise<ISolidSimple> { export default async function getSolidpkg(product: Product, from: number, to: number): Promise<ISolidSimple> {
//Verify function arguments //Verify function arguments
if (!verifyProductName(product)) { if (!verifyProductName(product)) {