diff --git a/package-lock.json b/package-lock.json index 30bcf86..f9e7ed6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "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" }, "xml-js": { diff --git a/src/index.ts b/src/index.ts index 973ac14..510e106 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,8 +7,8 @@ import { ISsnFileEntry } from './interfaces/ISsnFileEntry'; import findReleasePath from './ssn/findReleasePath'; import getManifest from './ssn/getManifest'; import getPatch from './ssn/getPatch'; -import getReleaseZip from './ssn/getReleaseZip'; +import getPatchZip from './ssn/getPatchZip'; import getSolidpkg from './ssn/getSolidpkg'; 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 }; diff --git a/src/ssn/getManifest.ts b/src/ssn/getManifest.ts index b11e2e2..c8eca05 100644 --- a/src/ssn/getManifest.ts +++ b/src/ssn/getManifest.ts @@ -11,6 +11,10 @@ import streamToString from './streams/streamToString'; import verifyPatchmanifest from './verify/verifyPatchmanifest'; 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 { //Verify function arguments if (!verifyProductName(product)) { diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index 2be23d2..340aa1b 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -25,7 +25,7 @@ interface IGetPatchArgs { 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) { //Verify function arguments diff --git a/src/ssn/getReleaseZip.ts b/src/ssn/getPatchZip.ts similarity index 75% rename from src/ssn/getReleaseZip.ts rename to src/ssn/getPatchZip.ts index 266a2a8..9c9ee4a 100644 --- a/src/ssn/getReleaseZip.ts +++ b/src/ssn/getPatchZip.ts @@ -5,7 +5,12 @@ import getSolidpkg from './getSolidpkg'; import readSsnFile from './reader/readSsnFile'; import verifyPatch from './verify/verifyPatch'; -export default async function getSolidpkgZip(product: Product, from: number, to: number): Promise { +/** 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 { const solidpkg = await getSolidpkg(product, from, to); function createUrlObject({ name, length }: {name: string, length: number}) { diff --git a/src/ssn/getSolidpkg.ts b/src/ssn/getSolidpkg.ts index be865da..d1f2bce 100644 --- a/src/ssn/getSolidpkg.ts +++ b/src/ssn/getSolidpkg.ts @@ -11,6 +11,10 @@ import streamToArrayBuffer from './streams/streamToArrayBuffer'; import verifyProductName from './verify/verifyProductName'; 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 { //Verify function arguments if (!verifyProductName(product)) {