Upgrade typescript version

This commit is contained in:
Martin Kleinschrodt 2021-09-25 10:06:45 +02:00
parent 93ce9de764
commit 7dfdd3a27b
17 changed files with 30348 additions and 30492 deletions

16
package-lock.json generated
View File

@ -5,14 +5,13 @@
"requires": true,
"packages": {
"": {
"name": "padloc",
"version": "3.1.1",
"hasInstallScript": true,
"license": "GPL-3.0",
"devDependencies": {
"lerna": "^4.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
}
},
"node_modules/@babel/code-frame": {
@ -6980,11 +6979,10 @@
}
},
"node_modules/typescript": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz",
"integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -13255,9 +13253,9 @@
}
},
"typescript": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz",
"integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true
},
"uglify-js": {

View File

@ -14,7 +14,7 @@
"devDependencies": {
"lerna": "^4.0.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
},
"scripts": {
"postinstall": "lerna bootstrap",
@ -29,4 +29,4 @@
"test": "lerna run test",
"locale:extract": "lerna run extract --scope '@padloc/locale'"
}
}
}

View File

@ -29,7 +29,7 @@
"papaparse": "^5.3.1",
"qrcode": "^1.4.4",
"reflect-metadata": "^0.1.13",
"typescript": "^4.3.2",
"typescript": "^4.4.3",
"ua-parser-js": "^0.7.28",
"workbox-precaching": "^6.2.0",
"workbox-sw": "^6.1.5",
@ -1807,9 +1807,9 @@
}
},
"node_modules/typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -3441,9 +3441,9 @@
"dev": true
},
"typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA=="
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA=="
},
"ua-parser-js": {
"version": "0.7.28",

View File

@ -38,7 +38,7 @@
"papaparse": "^5.3.1",
"qrcode": "^1.4.4",
"reflect-metadata": "^0.1.13",
"typescript": "^4.3.2",
"typescript": "^4.4.3",
"ua-parser-js": "^0.7.28",
"workbox-precaching": "^6.2.0",
"workbox-sw": "^6.1.5",
@ -52,4 +52,4 @@
"mocha": "^8.4.0"
},
"description": "Padloc Web-Based UI package"
}
}

View File

@ -15,28 +15,28 @@ export const CSV: ImportFormat = {
format: "csv",
toString() {
return "CSV";
}
},
};
export const PADLOCK_LEGACY: ImportFormat = {
format: "padlock-legacy",
toString() {
return "Padlock (v2)";
}
},
};
export const LASTPASS: ImportFormat = {
format: "lastpass",
toString() {
return "LastPass";
}
},
};
export const PBES2: ImportFormat = {
format: "padloc",
toString() {
return "Encrypted Container";
}
},
};
export const supportedFormats: ImportFormat[] = [CSV, PADLOCK_LEGACY, LASTPASS, PBES2];
@ -72,7 +72,7 @@ export async function fromTable(data: string[][], nameColIndex?: number, tagsCol
}
// All subsequent rows should contain values
let items = data.slice(1).map(function(row) {
let items = data.slice(1).map(function (row) {
// Construct an array of field object from column names and values
let fields: Field[] = [];
for (let i = 0; i < row.length; i++) {
@ -83,7 +83,7 @@ export async function fromTable(data: string[][], nameColIndex?: number, tagsCol
fields.push(
new Field().fromRaw({
name,
value
value,
})
);
}
@ -140,7 +140,7 @@ export async function importLegacyContainer(container: PBES2Container) {
tags: tags || [category],
updated,
updatedBy: "",
attachments: []
attachments: [],
});
});
@ -187,13 +187,13 @@ export async function asPBES2Container(data: string, password: string): Promise<
function lpParseNotes(str: string): Field[] {
let lines = str.split("\n");
let fields = lines
.filter(line => !!line)
.map(line => {
.filter((line) => !!line)
.map((line) => {
let split = line.indexOf(":");
return new Field({
name: line.substring(0, split),
value: line.substring(split + 1),
type: FieldType.Text
type: FieldType.Text,
});
});
return fields;
@ -215,7 +215,7 @@ async function lpParseRow(row: string[]): Promise<VaultItem> {
let fields: Field[] = [
new Field({ name: $l("Username"), value: row[usernameIndex], type: FieldType.Username }),
new Field({ name: $l("Password"), value: row[passwordIndex], type: FieldType.Password }),
new Field({ name: $l("URL"), value: row[urlIndex], type: FieldType.Url })
new Field({ name: $l("URL"), value: row[urlIndex], type: FieldType.Url }),
];
let notes = row[notesIndex];
@ -224,7 +224,7 @@ async function lpParseRow(row: string[]): Promise<VaultItem> {
// we'll have to parse the 'extra' column to retrieve the individual fields
fields.push(...lpParseNotes(notes));
// In case of 'secure notes' we don't want the url and NoteType field
fields = fields.filter(f => f.name != "url" && f.name != "NoteType");
fields = fields.filter((f) => f.name != "url" && f.name != "NoteType");
} else {
// We've got a regular 'site' item, so the 'extra' column simply contains notes
fields.push(new Field({ name: $l("Notes"), value: notes, type: FieldType.Note }));
@ -256,13 +256,5 @@ export function isLastPass(data: string): boolean {
}
export function guessFormat(data: string): ImportFormat | null {
return isPBES2Container(data)
? PBES2
: isPadlockV1(data)
? PADLOCK_LEGACY
: isLastPass(data)
? LASTPASS
: isCSV(data)
? CSV
: null;
return isPBES2Container(data) ? PBES2 : isPadlockV1(data) ? PADLOCK_LEGACY : isLastPass(data) ? LASTPASS : CSV;
}

View File

@ -26,6 +26,7 @@ export class Router extends EventTarget {
const canceled =
!this._forceNextUpdate &&
!this.dispatchEvent(
// @ts-ignore
new CustomEvent("before-route-changed", { detail: { path, direction }, cancelable: true })
);
@ -37,6 +38,7 @@ export class Router extends EventTarget {
this._forceNextUpdate = false;
}
// @ts-ignore
this.dispatchEvent(new CustomEvent("route-changed", { detail: { path, direction } }));
}
@ -58,6 +60,7 @@ export class Router extends EventTarget {
"",
this.basePath + this.path + "?" + new URLSearchParams(params).toString()
);
// @ts-ignore
this.dispatchEvent(new CustomEvent("params-changed", { detail: { params } }));
}

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
],
"dependencies": {
"@padloc/locale": "^4.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
},
"devDependencies": {
"@types/chai": "^4.2.18",
@ -20,7 +20,7 @@
"chai": "^4.3.4",
"mocha": "^8.4.0",
"ts-node": "^10.0.0",
"typedoc": "^0.21.5"
"typedoc": "^0.22.4"
},
"scripts": {
"test": "cd test && mocha -r ts-node/register *.ts",
@ -31,4 +31,4 @@
"url": "https://github.com/padloc/padloc.git",
"directory": "packages/core"
}
}
}

View File

@ -23,7 +23,7 @@
"style-loader": "^2.0.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "^4.3.2",
"typescript": "^4.4.3",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0"
}
@ -4933,9 +4933,9 @@
"peer": true
},
"node_modules/typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@ -9221,9 +9221,9 @@
"peer": true
},
"typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true
},
"union": {

View File

@ -32,11 +32,11 @@
"style-loader": "^2.0.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "^4.3.2",
"typescript": "^4.4.3",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0"
},
"scripts": {
"build": "webpack"
}
}
}

View File

@ -10,7 +10,7 @@
"license": "GPLv3",
"devDependencies": {
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
}
},
"node_modules/@tsconfig/node10": {
@ -139,9 +139,9 @@
}
},
"node_modules/typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@ -258,9 +258,9 @@
}
},
"typescript": {
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true
},
"yn": {

View File

@ -2,7 +2,7 @@
"name": "@padloc/locale",
"version": "4.0.0",
"description": "Package containing translations and wordlists for Padloc as well as various other localization tools",
"main": "index.js",
"main": "src/index.js",
"files": [
"src",
"res"
@ -14,11 +14,11 @@
"license": "GPLv3",
"devDependencies": {
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
},
"repository": {
"type": "git",
"url": "https://github.com/padloc/padloc.git",
"directory": "packages/locale"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@
"style-loader": "^2.0.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "^4.3.2",
"typescript": "^4.4.3",
"webpack": "^5.52.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.2.1",
@ -42,4 +42,4 @@
"start": "http-server ${PL_PWA_DIR:-dist} -s -p ${PL_PWA_PORT:-8080} --proxy ${PL_PWA_URL:-http://0.0.0.0:${PL_PWA_PORT:-8080}}?",
"build_and_start": "npm run build && npm start"
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
"nodemailer": "^6.6.1",
"stripe": "^8.150.0",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
"typescript": "^4.4.3"
},
"scripts": {
"start": "ts-node src/init.ts",
@ -51,4 +51,4 @@
"url": "https://github.com/padloc/padloc.git",
"directory": "packages/server"
}
}
}

View File

@ -20,6 +20,7 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"allowJs": true
"allowJs": true,
"useUnknownInCatchVariables": false
}
}