Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Feb 25, 2019
1 parent b44dbfa commit 2313c5e
Show file tree
Hide file tree
Showing 8 changed files with 5,036 additions and 2,977 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"Hashcash",
"jrpc",
"urlsum"
]
],
"typescript.tsdk": "node_modules/typescript/lib"
}
7,836 changes: 4,931 additions & 2,905 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kprpc",
"version": "1.0.14",
"version": "1.0.15",
"description": "A KeePassRPC server",
"main": "main.js",
"types": "main.d.ts",
Expand All @@ -13,18 +13,18 @@
"lint": "tslint '*.ts'"
},
"devDependencies": {
"@types/jest": "^23.1.0",
"jest": "^22.0.0",
"@types/jest": "^24.0.6",
"jest": "^24.1.0",
"punycode": "^2.1.1",
"ts-jest": "^22.4.6",
"tslint": "^5.5.0",
"tslint-config-standard": "^6.0.1",
"typescript": "^2.9.2"
"ts-jest": "^24.0.0",
"tslint": "^5.13.0",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.3.3333"
},
"dependencies": {
"jrpc": "3.1.2",
"kdbx-placeholders": "^1.1.7",
"kdbxweb": "^1.2.4",
"kdbx-placeholders": "^1.1.10",
"kdbxweb": "^1.2.5",
"secure-remote-password": "^0.3.1"
}
}
62 changes: 31 additions & 31 deletions tests/handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { mapStandardToBase64PNG } from "../icons";
import suffixList from "../testDeps/publicsuffixlist";
import punycode from "punycode/";
import punycode from "punycode";
import pslData from "../testDeps/pslData";
import { MatchAccuracyMethod } from "../MatchAccuracyMethod";
import * as kdbxweb from "kdbxweb";
Expand Down Expand Up @@ -33,64 +33,64 @@ describe("icons", async () => {
describe("getURLSummary", async () => {
test("standardHttpWithPath", async () => {
const result = model.getURLSummary("http://www.google.com/any/path", getDomain);
expect (result.hostAndPort).toEqual("www.google.com");
expect (result.port).toEqual("");
expect (result.domain).toEqual("google.com");
expect(result.hostAndPort).toEqual("www.google.com");
expect(result.port).toEqual("");
expect(result.domain).toEqual("google.com");
});
test("standardLocalFile", async () => {
const result = model.getURLSummary("file://c/any/path/file.ext", getDomain);
expect (result.port).toEqual("");
expect (result.domain).toEqual(null);
expect(result.port).toEqual("");
expect(result.domain).toEqual(null);
});
test("malformedLocalFileWithoutExtension", async () => {
const result = model.getURLSummary("c:\\any\\path\\file", getDomain);
expect (result.hostAndPort).toEqual("c:\\any\\path\\file");
expect (result.port).toEqual("");
expect (result.domain).toEqual("");
expect(result.hostAndPort).toEqual("c:\\any\\path\\file");
expect(result.port).toEqual("");
expect(result.domain).toEqual("");
//TODO: The C# version tests for: Assert.IsNull(summary.Domain.RegistrableDomain);
// I think the difference between null and "" is insignificant in all real-world
// cases but this needs verification and refactoring if proven correct
});
test("malformedLocalFileWithExtension", async () => {
const result = model.getURLSummary("c:\\any\\path\\file.ext", getDomain);
expect (result.hostAndPort).toEqual("c:\\any\\path\\file.ext");
expect (result.port).toEqual("");
expect (result.domain).toEqual("c:\\any\\path\\file.ext"); //Assert.AreEqual("ext", summary.Domain.TLD);
expect(result.hostAndPort).toEqual("c:\\any\\path\\file.ext");
expect(result.port).toEqual("");
expect(result.domain).toEqual("c:\\any\\path\\file.ext"); //Assert.AreEqual("ext", summary.Domain.TLD);
});
test("standardHttpsWithPortAndPath", async () => {
const result = model.getURLSummary("http://www.google.com:12345/any/path", getDomain);
expect (result.hostAndPort).toEqual("www.google.com:12345");
expect (result.port).toEqual("12345");
expect (result.domain).toEqual("google.com");
expect(result.hostAndPort).toEqual("www.google.com:12345");
expect(result.port).toEqual("12345");
expect(result.domain).toEqual("google.com");
});

test("standardData", async () => {
const result = model.getURLSummary("data:,_www.google.com", getDomain);
expect (result.hostAndPort).toEqual("");
expect (result.port).toEqual("");
expect (result.domain).toEqual(null);
expect(result.hostAndPort).toEqual("");
expect(result.port).toEqual("");
expect(result.domain).toEqual(null);
});
test("dataEndingWithQSAndFile", async () => {
const result = model.getURLSummary("data:,_www.google.com?anything.file://", getDomain);
expect (result.hostAndPort).toEqual("");
expect (result.port).toEqual("");
expect (result.domain).toEqual(null);
expect(result.hostAndPort).toEqual("");
expect(result.port).toEqual("");
expect(result.domain).toEqual(null);
});
test("dataEndingWithFile", async () => {
const result = model.getURLSummary("data:,_www.google.com.file://", getDomain);
expect (result.hostAndPort).toEqual("");
expect (result.port).toEqual("");
expect (result.domain).toEqual(null);
expect(result.hostAndPort).toEqual("");
expect(result.port).toEqual("");
expect(result.domain).toEqual(null);
});
test("dataEndingWithQSAndHttps", async () => {
const result = model.getURLSummary("data:,_www.google.com?anything.https://", getDomain);
expect (result.hostAndPort).toEqual("");
expect (result.port).toEqual("");
expect (result.domain).toEqual(null);
expect(result.hostAndPort).toEqual("");
expect(result.port).toEqual("");
expect(result.domain).toEqual(null);
});
});

describe ("URLMatchTest", async () => {
describe("URLMatchTest", async () => {

function testCase (expectedResult: MatchAccuracyMethod, urlSearch: string, entryMam: MatchAccuracyMethod, defaultMam: MatchAccuracyMethod, overrideURLs: string[] = [], overrideMethods: MatchAccuracyMethod[] = []) {
const name = "" + expectedResult + urlSearch + entryMam + defaultMam + overrideURLs + overrideMethods;
Expand All @@ -100,7 +100,7 @@ describe ("URLMatchTest", async () => {
const group = newDb.createGroup(newDb.getDefaultGroup(), "subgroup");
const pwe = newDb.createEntry(group);

const conf = new EntryConfig(null, entryMam);
const conf = new EntryConfig(undefined, entryMam);
model.setEntryConfig(pwe, conf);
const urlSummary = model.getURLSummary(urlSearch, getDomain);
const dbConf = new DatabaseConfig();
Expand Down Expand Up @@ -130,7 +130,7 @@ describe ("URLMatchTest", async () => {

});

describe ("CalculatesCorrectMatchAccuracyScore", async () => {
describe("CalculatesCorrectMatchAccuracyScore", async () => {

function testCase (expectedResult: MatchAccuracyEnum, urlEntry: string, urlSearch: string, entryMam: MatchAccuracyMethod) {
const name = "" + expectedResult + urlEntry + urlSearch + entryMam;
Expand All @@ -141,7 +141,7 @@ describe ("CalculatesCorrectMatchAccuracyScore", async () => {
const group = newDb.createGroup(newDb.getDefaultGroup(), "subgroup");
const pwe = newDb.createEntry(group);
pwe.fields.URL = urlEntry;
const conf = new EntryConfig(null, entryMam);
const conf = new EntryConfig(undefined, entryMam);
model.setEntryConfig(pwe, conf);
const urlSummary = model.getURLSummary(urlSearch, getDomain);

Expand Down
28 changes: 28 additions & 0 deletions tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"sourceMap": true,
"target": "es5",
"module": "commonjs",
"esModuleInterop": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"strict": false,
"noImplicitAny": false,
"strictNullChecks": true,
"strictPropertyInitialization": false,
"noImplicitThis": true,
"alwaysStrict": false,
"declaration": true,
"lib": [
"dom", "es2015", "es2016.array.include"
],
"outDir": "dist",
"moduleResolution": "node",
"downlevelIteration": true
},
"exclude": [
"node_modules",
"tests",
"dist"
]
}
1 change: 1 addition & 0 deletions tests/types
3 changes: 2 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
},
"no-duplicate-switch-case": true,
"no-implicit-dependencies": true,
"no-return-await": true
"no-return-await": true,
"object-curly-spacing": false
}
}
62 changes: 32 additions & 30 deletions types/kdbxweb/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ declare module 'kdbxweb' {
IRCommunication: number;
Identity: number;
Info: number;
Key: number;
List: number;
LockOpen: number;
MarkedDirectory: number;
Expand Down Expand Up @@ -398,13 +399,13 @@ class ProtectedValue {
* Creates protected value from string with new random salt
* @param {string} str
*/
static fromString(str: string): void;
static fromString(str: string): ProtectedValue;

/**
* Creates protected value from binary with new random salt
* @param {ArrayBuffer} binary
*/
static fromBinary(binary: ArrayBuffer): void;
static fromBinary(binary: ArrayBuffer): ProtectedValue;

/**
* Determines whether the value is included as substring (safe check; doesn't decrypt full string)
Expand Down Expand Up @@ -476,7 +477,7 @@ class KdbxContext {
* @param {String|ArrayBuffer|Uint8Array} [keyFile]
* @constructor
*/
class KdbxCredentials {
class Credentials {
constructor(password: ProtectedValue, keyFile?: string | ArrayBuffer | Uint8Array);

/**
Expand Down Expand Up @@ -535,12 +536,13 @@ class KdbxDeletedObject {

}

/**
* Entry
* @constructor
*/
class KdbxEntry {
constructor();
export class KdbxEntry {

/**
* Entry
* @constructor
*/
public constructor();

uuid;
icon;
Expand All @@ -556,7 +558,7 @@ class KdbxEntry {
enabled: boolean, obfuscation: any, defaultSequence: any, items: any[]
};
history: any[];
parentGroup: KdbxGroup;
parentGroup;
customData;

/**
Expand Down Expand Up @@ -831,19 +833,19 @@ class KdbxTimes {
class KdbxUuid {
constructor(ab: ArrayBuffer | string);

/**
* Checks whether two uuids are equal
* @param {KdbxUuid|string} other
*/
equals(other: KdbxUuid | string): void;

/**
* Generated random uuid
* @return {KdbxUuid}
* @static
*/
static random(): KdbxUuid;

id: string;
empty: boolean;

equals(other: KdbxUuid): boolean;

toBytes(): Uint8Array | undefined;

toString(): string;

valueOf(): string | undefined;

}

/**
Expand All @@ -852,7 +854,7 @@ class KdbxUuid {
*/
class Kdbx {
header: KdbxHeader;
credentials: KdbxCredentials;
credentials: Credentials;
meta: KdbxMeta;
xml: any;
binaries: any;
Expand All @@ -865,25 +867,25 @@ class Kdbx {
* Creates new database
* @return {Kdbx}
*/
static create(): Kdbx;
static create(credentials: Credentials, name: string): Kdbx;

/**
* Load kdbx file
* If there was an error loading file, throws an exception
* @param {ArrayBuffer} data - database file contents
* @param {KdbxCredentials} credentials
* @param {Credentials} credentials
* @return {Promise.<Kdbx>}
*/
static load(data: ArrayBuffer, credentials: KdbxCredentials): any;
static load(data: ArrayBuffer, credentials: Credentials): any;

/**
* Import database from xml file
* If there was an error loading xml file, throws an exception
* @param {String} data - xml file contents
* @param {KdbxCredentials} credentials
* @param {Credentials} credentials
* @return {Promise.<Kdbx>}
*/
static loadXml(data: string, credentials: KdbxCredentials): any;
static loadXml(data: string, credentials: Credentials): any;

/**
* Save db to ArrayBuffer
Expand Down Expand Up @@ -913,7 +915,7 @@ class Kdbx {
* @param {KdbxGroup} group - parent group
* @return {KdbxGroup}
*/
createGroup(name: string, group: KdbxGroup): KdbxGroup;
createGroup(group: KdbxGroup, name: string): KdbxGroup;

/**
* Adds new entry to group
Expand All @@ -930,11 +932,11 @@ class Kdbx {

/**
* Get group by uuid
* @param {KdbxUuid} uuid
* @param {KdbxUuid|string} uuid
* @param {KdbxGroup} [parentGroup]
* @return {KdbxGroup|undefined}
*/
getGroup(uuid: KdbxUuid, parentGroup?: KdbxGroup): KdbxGroup | undefined;
getGroup(uuid: KdbxUuid | string, parentGroup?: KdbxGroup): KdbxGroup | undefined;

/**
* Move object from one group to another
Expand Down

0 comments on commit 2313c5e

Please sign in to comment.