mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-01 13:13:36 +01:00
Add eslint (#610)
This commit is contained in:
parent
479d5db5f1
commit
60878cd4ed
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
**/dist
|
||||||
|
|
||||||
|
**/node_modules
|
23
.eslintrc.json
Normal file
23
.eslintrc.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"extends": ["./shared/eslintrc.json"],
|
||||||
|
"rules": {
|
||||||
|
"import/order": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc"
|
||||||
|
},
|
||||||
|
"newlines-between": "always",
|
||||||
|
"pathGroups": [
|
||||||
|
{
|
||||||
|
"pattern": "jslib-*/**",
|
||||||
|
"group": "external",
|
||||||
|
"position": "after"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"pathGroupsExcludedImportTypes": ["builtin"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -15,9 +15,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf dist/**/*",
|
"clean": "rimraf dist/**/*",
|
||||||
"build": "npm run clean && tsc",
|
"build": "npm run clean && tsc",
|
||||||
"build:watch": "npm run clean && tsc -watch",
|
"build:watch": "npm run clean && tsc -watch"
|
||||||
"lint": "tslint 'src/**/*.ts' 'spec/**/*.ts'",
|
|
||||||
"lint:fix": "tslint 'src/**/*.ts' 'spec/**/*.ts' --fix"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/duo_web_sdk": "^2.7.1",
|
"@types/duo_web_sdk": "^2.7.1",
|
||||||
|
@ -1,18 +1,14 @@
|
|||||||
import { Directive, Input, OnChanges, SimpleChanges } from "@angular/core";
|
|
||||||
|
|
||||||
import { CdkDragDrop, moveItemInArray } from "@angular/cdk/drag-drop";
|
import { CdkDragDrop, moveItemInArray } from "@angular/cdk/drag-drop";
|
||||||
|
import { Directive, Input, OnChanges, SimpleChanges } from "@angular/core";
|
||||||
|
|
||||||
import { EventService } from "jslib-common/abstractions/event.service";
|
import { EventService } from "jslib-common/abstractions/event.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
|
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
|
||||||
import { FieldView } from "jslib-common/models/view/fieldView";
|
|
||||||
|
|
||||||
import { CipherType } from "jslib-common/enums/cipherType";
|
import { CipherType } from "jslib-common/enums/cipherType";
|
||||||
import { EventType } from "jslib-common/enums/eventType";
|
import { EventType } from "jslib-common/enums/eventType";
|
||||||
import { FieldType } from "jslib-common/enums/fieldType";
|
import { FieldType } from "jslib-common/enums/fieldType";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
|
import { FieldView } from "jslib-common/models/view/fieldView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class AddEditCustomFieldsComponent implements OnChanges {
|
export class AddEditCustomFieldsComponent implements OnChanges {
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
||||||
|
|
||||||
import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType";
|
|
||||||
import { CipherType } from "jslib-common/enums/cipherType";
|
|
||||||
import { EventType } from "jslib-common/enums/eventType";
|
|
||||||
import { OrganizationUserStatusType } from "jslib-common/enums/organizationUserStatusType";
|
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
|
||||||
import { SecureNoteType } from "jslib-common/enums/secureNoteType";
|
|
||||||
import { UriMatchType } from "jslib-common/enums/uriMatchType";
|
|
||||||
|
|
||||||
import { AuditService } from "jslib-common/abstractions/audit.service";
|
import { AuditService } from "jslib-common/abstractions/audit.service";
|
||||||
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
||||||
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
||||||
@ -21,9 +13,15 @@ import { PasswordRepromptService } from "jslib-common/abstractions/passwordRepro
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType";
|
||||||
|
import { CipherType } from "jslib-common/enums/cipherType";
|
||||||
|
import { EventType } from "jslib-common/enums/eventType";
|
||||||
|
import { OrganizationUserStatusType } from "jslib-common/enums/organizationUserStatusType";
|
||||||
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
|
import { SecureNoteType } from "jslib-common/enums/secureNoteType";
|
||||||
|
import { UriMatchType } from "jslib-common/enums/uriMatchType";
|
||||||
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { Cipher } from "jslib-common/models/domain/cipher";
|
import { Cipher } from "jslib-common/models/domain/cipher";
|
||||||
|
|
||||||
import { CardView } from "jslib-common/models/view/cardView";
|
import { CardView } from "jslib-common/models/view/cardView";
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
import { CollectionView } from "jslib-common/models/view/collectionView";
|
import { CollectionView } from "jslib-common/models/view/collectionView";
|
||||||
@ -33,11 +31,9 @@ import { LoginUriView } from "jslib-common/models/view/loginUriView";
|
|||||||
import { LoginView } from "jslib-common/models/view/loginView";
|
import { LoginView } from "jslib-common/models/view/loginView";
|
||||||
import { SecureNoteView } from "jslib-common/models/view/secureNoteView";
|
import { SecureNoteView } from "jslib-common/models/view/secureNoteView";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class AddEditComponent implements OnInit {
|
export class AddEditComponent implements OnInit {
|
||||||
@Input() cloneMode: boolean = false;
|
@Input() cloneMode = false;
|
||||||
@Input() folderId: string = null;
|
@Input() folderId: string = null;
|
||||||
@Input() cipherId: string;
|
@Input() cipherId: string;
|
||||||
@Input() type: CipherType;
|
@Input() type: CipherType;
|
||||||
@ -52,7 +48,7 @@ export class AddEditComponent implements OnInit {
|
|||||||
@Output() onEditCollections = new EventEmitter<CipherView>();
|
@Output() onEditCollections = new EventEmitter<CipherView>();
|
||||||
@Output() onGeneratePassword = new EventEmitter();
|
@Output() onGeneratePassword = new EventEmitter();
|
||||||
|
|
||||||
editMode: boolean = false;
|
editMode = false;
|
||||||
cipher: CipherView;
|
cipher: CipherView;
|
||||||
folders: FolderView[];
|
folders: FolderView[];
|
||||||
collections: CollectionView[] = [];
|
collections: CollectionView[] = [];
|
||||||
@ -61,9 +57,9 @@ export class AddEditComponent implements OnInit {
|
|||||||
deletePromise: Promise<any>;
|
deletePromise: Promise<any>;
|
||||||
restorePromise: Promise<any>;
|
restorePromise: Promise<any>;
|
||||||
checkPasswordPromise: Promise<number>;
|
checkPasswordPromise: Promise<number>;
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
showCardNumber: boolean = false;
|
showCardNumber = false;
|
||||||
showCardCode: boolean = false;
|
showCardCode = false;
|
||||||
cipherType = CipherType;
|
cipherType = CipherType;
|
||||||
typeOptions: any[];
|
typeOptions: any[];
|
||||||
cardBrandOptions: any[];
|
cardBrandOptions: any[];
|
||||||
@ -74,8 +70,8 @@ export class AddEditComponent implements OnInit {
|
|||||||
autofillOnPageLoadOptions: any[];
|
autofillOnPageLoadOptions: any[];
|
||||||
currentDate = new Date();
|
currentDate = new Date();
|
||||||
allowPersonal = true;
|
allowPersonal = true;
|
||||||
reprompt: boolean = false;
|
reprompt = false;
|
||||||
canUseReprompt: boolean = true;
|
canUseReprompt = true;
|
||||||
|
|
||||||
protected writeableCollections: CollectionView[];
|
protected writeableCollections: CollectionView[];
|
||||||
private previousCipherId: string;
|
private previousCipherId: string;
|
||||||
|
@ -7,10 +7,8 @@ import { I18nService } from "jslib-common/abstractions/i18n.service";
|
|||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { Cipher } from "jslib-common/models/domain/cipher";
|
import { Cipher } from "jslib-common/models/domain/cipher";
|
||||||
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
||||||
|
|
||||||
import { AttachmentView } from "jslib-common/models/view/attachmentView";
|
import { AttachmentView } from "jslib-common/models/view/attachmentView";
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ import { DomSanitizer } from "@angular/platform-browser";
|
|||||||
|
|
||||||
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -81,12 +80,10 @@ export class AvatarComponent implements OnChanges, OnInit {
|
|||||||
private stringToColor(str: string): string {
|
private stringToColor(str: string): string {
|
||||||
let hash = 0;
|
let hash = 0;
|
||||||
for (let i = 0; i < str.length; i++) {
|
for (let i = 0; i < str.length; i++) {
|
||||||
// tslint:disable-next-line
|
|
||||||
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
||||||
}
|
}
|
||||||
let color = "#";
|
let color = "#";
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
// tslint:disable-next-line
|
|
||||||
const value = (hash >> (i * 8)) & 0xff;
|
const value = (hash >> (i * 8)) & 0xff;
|
||||||
color += ("00" + value.toString(16)).substr(-2);
|
color += ("00" + value.toString(16)).substr(-2);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Component, Input, OnInit } from "@angular/core";
|
import { Component, Input, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
|
|
||||||
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -3,9 +3,7 @@ import { Directive, Input } from "@angular/core";
|
|||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { CaptchaIFrame } from "jslib-common/misc/captcha_iframe";
|
import { CaptchaIFrame } from "jslib-common/misc/captcha_iframe";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -7,13 +7,11 @@ import { PasswordGenerationService } from "jslib-common/abstractions/passwordGen
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { KdfType } from "jslib-common/enums/kdfType";
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { KdfType } from "jslib-common/enums/kdfType";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class ChangePasswordComponent implements OnInit {
|
export class ChangePasswordComponent implements OnInit {
|
||||||
masterPassword: string;
|
masterPassword: string;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
||||||
|
|
||||||
import { SearchService } from "jslib-common/abstractions/search.service";
|
import { SearchService } from "jslib-common/abstractions/search.service";
|
||||||
|
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
@ -12,12 +11,12 @@ export class CiphersComponent {
|
|||||||
@Output() onAddCipher = new EventEmitter();
|
@Output() onAddCipher = new EventEmitter();
|
||||||
@Output() onAddCipherOptions = new EventEmitter();
|
@Output() onAddCipherOptions = new EventEmitter();
|
||||||
|
|
||||||
loaded: boolean = false;
|
loaded = false;
|
||||||
ciphers: CipherView[] = [];
|
ciphers: CipherView[] = [];
|
||||||
searchText: string;
|
searchText: string;
|
||||||
searchPlaceholder: string = null;
|
searchPlaceholder: string = null;
|
||||||
filter: (cipher: CipherView) => boolean = null;
|
filter: (cipher: CipherView) => boolean = null;
|
||||||
deleted: boolean = false;
|
deleted = false;
|
||||||
|
|
||||||
protected searchPending = false;
|
protected searchPending = false;
|
||||||
|
|
||||||
@ -25,13 +24,13 @@ export class CiphersComponent {
|
|||||||
|
|
||||||
constructor(protected searchService: SearchService) {}
|
constructor(protected searchService: SearchService) {}
|
||||||
|
|
||||||
async load(filter: (cipher: CipherView) => boolean = null, deleted: boolean = false) {
|
async load(filter: (cipher: CipherView) => boolean = null, deleted = false) {
|
||||||
this.deleted = deleted || false;
|
this.deleted = deleted || false;
|
||||||
await this.applyFilter(filter);
|
await this.applyFilter(filter);
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async reload(filter: (cipher: CipherView) => boolean = null, deleted: boolean = false) {
|
async reload(filter: (cipher: CipherView) => boolean = null, deleted = false) {
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
this.ciphers = [];
|
this.ciphers = [];
|
||||||
await this.load(filter, deleted);
|
await this.load(filter, deleted);
|
||||||
|
@ -5,12 +5,10 @@ import { CollectionService } from "jslib-common/abstractions/collection.service"
|
|||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
import { Cipher } from "jslib-common/models/domain/cipher";
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
import { CollectionView } from "jslib-common/models/view/collectionView";
|
import { CollectionView } from "jslib-common/models/view/collectionView";
|
||||||
|
|
||||||
import { Cipher } from "jslib-common/models/domain/cipher";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class CollectionsComponent implements OnInit {
|
export class CollectionsComponent implements OnInit {
|
||||||
@Input() cipherId: string;
|
@Input() cipherId: string;
|
||||||
|
@ -9,7 +9,6 @@ import { LogService } from "jslib-common/abstractions/log.service";
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||||
|
|
||||||
import { EventType } from "jslib-common/enums/eventType";
|
import { EventType } from "jslib-common/enums/eventType";
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ export class ExportComponent implements OnInit {
|
|||||||
@Output() onSaved = new EventEmitter();
|
@Output() onSaved = new EventEmitter();
|
||||||
|
|
||||||
formPromise: Promise<string>;
|
formPromise: Promise<string>;
|
||||||
disabledByPolicy: boolean = false;
|
disabledByPolicy = false;
|
||||||
|
|
||||||
exportForm = this.formBuilder.group({
|
exportForm = this.formBuilder.group({
|
||||||
format: ["json"],
|
format: ["json"],
|
||||||
|
@ -4,7 +4,6 @@ import { FolderService } from "jslib-common/abstractions/folder.service";
|
|||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { FolderView } from "jslib-common/models/view/folderView";
|
import { FolderView } from "jslib-common/models/view/folderView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
@ -13,7 +12,7 @@ export class FolderAddEditComponent implements OnInit {
|
|||||||
@Output() onSavedFolder = new EventEmitter<FolderView>();
|
@Output() onSavedFolder = new EventEmitter<FolderView>();
|
||||||
@Output() onDeletedFolder = new EventEmitter<FolderView>();
|
@Output() onDeletedFolder = new EventEmitter<FolderView>();
|
||||||
|
|
||||||
editMode: boolean = false;
|
editMode = false;
|
||||||
folder: FolderView = new FolderView();
|
folder: FolderView = new FolderView();
|
||||||
title: string;
|
title: string;
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
import { Directive, EventEmitter, Input, Output } from "@angular/core";
|
||||||
|
|
||||||
import { CipherType } from "jslib-common/enums/cipherType";
|
|
||||||
|
|
||||||
import { CollectionView } from "jslib-common/models/view/collectionView";
|
|
||||||
import { FolderView } from "jslib-common/models/view/folderView";
|
|
||||||
|
|
||||||
import { TreeNode } from "jslib-common/models/domain/treeNode";
|
|
||||||
|
|
||||||
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
||||||
import { FolderService } from "jslib-common/abstractions/folder.service";
|
import { FolderService } from "jslib-common/abstractions/folder.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { CipherType } from "jslib-common/enums/cipherType";
|
||||||
|
import { TreeNode } from "jslib-common/models/domain/treeNode";
|
||||||
|
import { CollectionView } from "jslib-common/models/view/collectionView";
|
||||||
|
import { FolderView } from "jslib-common/models/view/folderView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class GroupingsComponent {
|
export class GroupingsComponent {
|
||||||
@ -31,13 +28,13 @@ export class GroupingsComponent {
|
|||||||
nestedFolders: TreeNode<FolderView>[];
|
nestedFolders: TreeNode<FolderView>[];
|
||||||
collections: CollectionView[];
|
collections: CollectionView[];
|
||||||
nestedCollections: TreeNode<CollectionView>[];
|
nestedCollections: TreeNode<CollectionView>[];
|
||||||
loaded: boolean = false;
|
loaded = false;
|
||||||
cipherType = CipherType;
|
cipherType = CipherType;
|
||||||
selectedAll: boolean = false;
|
selectedAll = false;
|
||||||
selectedFavorites: boolean = false;
|
selectedFavorites = false;
|
||||||
selectedTrash: boolean = false;
|
selectedTrash = false;
|
||||||
selectedType: CipherType = null;
|
selectedType: CipherType = null;
|
||||||
selectedFolder: boolean = false;
|
selectedFolder = false;
|
||||||
selectedFolderId: string = null;
|
selectedFolderId: string = null;
|
||||||
selectedCollectionId: string = null;
|
selectedCollectionId: string = null;
|
||||||
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
|
|
||||||
import { PasswordHintRequest } from "jslib-common/models/request/passwordHintRequest";
|
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
import { PasswordHintRequest } from "jslib-common/models/request/passwordHintRequest";
|
||||||
|
|
||||||
export class HintComponent {
|
export class HintComponent {
|
||||||
email: string = "";
|
email = "";
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
protected successRoute = "login";
|
protected successRoute = "login";
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
import { Component, Input, OnChanges } from "@angular/core";
|
import { Component, Input, OnChanges } from "@angular/core";
|
||||||
|
|
||||||
import { CipherType } from "jslib-common/enums/cipherType";
|
|
||||||
|
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
|
||||||
|
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { CipherType } from "jslib-common/enums/cipherType";
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a mapping from supported card brands to
|
* Provides a mapping from supported card brands to
|
||||||
|
@ -12,32 +12,28 @@ import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
|
import { VaultTimeoutService } from "jslib-common/abstractions/vaultTimeout.service";
|
||||||
|
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
|
||||||
|
|
||||||
import { SecretVerificationRequest } from "jslib-common/models/request/secretVerificationRequest";
|
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
|
||||||
|
|
||||||
import { HashPurpose } from "jslib-common/enums/hashPurpose";
|
import { HashPurpose } from "jslib-common/enums/hashPurpose";
|
||||||
import { KeySuffixOptions } from "jslib-common/enums/keySuffixOptions";
|
import { KeySuffixOptions } from "jslib-common/enums/keySuffixOptions";
|
||||||
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
|
import { SecretVerificationRequest } from "jslib-common/models/request/secretVerificationRequest";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class LockComponent implements OnInit {
|
export class LockComponent implements OnInit {
|
||||||
masterPassword: string = "";
|
masterPassword = "";
|
||||||
pin: string = "";
|
pin = "";
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
email: string;
|
email: string;
|
||||||
pinLock: boolean = false;
|
pinLock = false;
|
||||||
webVaultHostname: string = "";
|
webVaultHostname = "";
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
supportsBiometric: boolean;
|
supportsBiometric: boolean;
|
||||||
biometricLock: boolean;
|
biometricLock: boolean;
|
||||||
biometricText: string;
|
biometricText: string;
|
||||||
hideInput: boolean;
|
hideInput: boolean;
|
||||||
|
|
||||||
protected successRoute: string = "vault";
|
protected successRoute = "vault";
|
||||||
protected onSuccessfulSubmit: () => Promise<void>;
|
protected onSuccessfulSubmit: () => Promise<void>;
|
||||||
|
|
||||||
private invalidPinAttempts = 0;
|
private invalidPinAttempts = 0;
|
||||||
@ -61,7 +57,7 @@ export class LockComponent implements OnInit {
|
|||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
// Load the first and observe updates
|
// Load the first and observe updates
|
||||||
await this.load();
|
await this.load();
|
||||||
this.stateService.activeAccount.subscribe(async (_userId) => {
|
this.stateService.activeAccount.subscribe(async () => {
|
||||||
await this.load();
|
await this.load();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
import { Directive, Input, NgZone, OnInit } from "@angular/core";
|
import { Directive, Input, NgZone, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
|
|
||||||
import { take } from "rxjs/operators";
|
import { take } from "rxjs/operators";
|
||||||
|
|
||||||
import { AuthResult } from "jslib-common/models/domain/authResult";
|
|
||||||
import { PasswordLogInCredentials } from "jslib-common/models/domain/logInCredentials";
|
|
||||||
|
|
||||||
import { AuthService } from "jslib-common/abstractions/auth.service";
|
import { AuthService } from "jslib-common/abstractions/auth.service";
|
||||||
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
@ -15,18 +10,19 @@ import { LogService } from "jslib-common/abstractions/log.service";
|
|||||||
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
import { AuthResult } from "jslib-common/models/domain/authResult";
|
||||||
|
import { PasswordLogInCredentials } from "jslib-common/models/domain/logInCredentials";
|
||||||
|
|
||||||
import { CaptchaProtectedComponent } from "./captchaProtected.component";
|
import { CaptchaProtectedComponent } from "./captchaProtected.component";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class LoginComponent extends CaptchaProtectedComponent implements OnInit {
|
export class LoginComponent extends CaptchaProtectedComponent implements OnInit {
|
||||||
@Input() email: string = "";
|
@Input() email = "";
|
||||||
@Input() rememberEmail = true;
|
@Input() rememberEmail = true;
|
||||||
|
|
||||||
masterPassword: string = "";
|
masterPassword = "";
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
formPromise: Promise<AuthResult>;
|
formPromise: Promise<AuthResult>;
|
||||||
onSuccessfulLogin: () => Promise<any>;
|
onSuccessfulLogin: () => Promise<any>;
|
||||||
onSuccessfulLoginNavigate: () => Promise<any>;
|
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||||
@ -36,7 +32,7 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
|
|||||||
protected twoFactorRoute = "2fa";
|
protected twoFactorRoute = "2fa";
|
||||||
protected successRoute = "vault";
|
protected successRoute = "vault";
|
||||||
protected forcePasswordResetRoute = "update-temp-password";
|
protected forcePasswordResetRoute = "update-temp-password";
|
||||||
protected alwaysRememberEmail: boolean = false;
|
protected alwaysRememberEmail = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from "@angular/cdk/a11y";
|
||||||
import {
|
import {
|
||||||
AfterViewInit,
|
AfterViewInit,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
@ -10,8 +11,6 @@ import {
|
|||||||
ViewContainerRef,
|
ViewContainerRef,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
|
|
||||||
import { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from "@angular/cdk/a11y";
|
|
||||||
|
|
||||||
import { ModalService } from "../../services/modal.service";
|
import { ModalService } from "../../services/modal.service";
|
||||||
|
|
||||||
import { ModalRef } from "./modal.ref";
|
import { ModalRef } from "./modal.ref";
|
||||||
|
@ -3,7 +3,6 @@ import { Directive, OnInit } from "@angular/core";
|
|||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { GeneratedPasswordHistory } from "jslib-common/models/domain/generatedPasswordHistory";
|
import { GeneratedPasswordHistory } from "jslib-common/models/domain/generatedPasswordHistory";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -3,17 +3,16 @@ import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
|||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { PasswordGeneratorPolicyOptions } from "jslib-common/models/domain/passwordGeneratorPolicyOptions";
|
import { PasswordGeneratorPolicyOptions } from "jslib-common/models/domain/passwordGeneratorPolicyOptions";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class PasswordGeneratorComponent implements OnInit {
|
export class PasswordGeneratorComponent implements OnInit {
|
||||||
@Input() showSelect: boolean = false;
|
@Input() showSelect = false;
|
||||||
@Output() onSelected = new EventEmitter<string>();
|
@Output() onSelected = new EventEmitter<string>();
|
||||||
|
|
||||||
passTypeOptions: any[];
|
passTypeOptions: any[];
|
||||||
options: any = {};
|
options: any = {};
|
||||||
password: string = "-";
|
password = "-";
|
||||||
showOptions = false;
|
showOptions = false;
|
||||||
avoidAmbiguous = false;
|
avoidAmbiguous = false;
|
||||||
enforcedPolicyOptions: PasswordGeneratorPolicyOptions;
|
enforcedPolicyOptions: PasswordGeneratorPolicyOptions;
|
||||||
@ -50,7 +49,7 @@ export class PasswordGeneratorComponent implements OnInit {
|
|||||||
this.password = await this.passwordGenerationService.generatePassword(this.options);
|
this.password = await this.passwordGenerationService.generatePassword(this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveOptions(regenerate: boolean = true) {
|
async saveOptions(regenerate = true) {
|
||||||
this.normalizeOptions();
|
this.normalizeOptions();
|
||||||
await this.passwordGenerationService.saveOptions(this.options);
|
await this.passwordGenerationService.saveOptions(this.options);
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ import { Directive, OnInit } from "@angular/core";
|
|||||||
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { PasswordHistoryView } from "jslib-common/models/view/passwordHistoryView";
|
import { PasswordHistoryView } from "jslib-common/models/view/passwordHistoryView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -3,6 +3,7 @@ import { Directive } from "@angular/core";
|
|||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { ModalRef } from "./modal/modal.ref";
|
import { ModalRef } from "./modal/modal.ref";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -8,8 +8,8 @@ import { StateService } from "jslib-common/abstractions/state.service";
|
|||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class PremiumComponent implements OnInit {
|
export class PremiumComponent implements OnInit {
|
||||||
isPremium: boolean = false;
|
isPremium = false;
|
||||||
price: number = 10;
|
price = 10;
|
||||||
refreshPromise: Promise<any>;
|
refreshPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import { Directive, OnInit } from "@angular/core";
|
import { Directive, OnInit } from "@angular/core";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
|
|
||||||
import { KeysRequest } from "jslib-common/models/request/keysRequest";
|
|
||||||
import { ReferenceEventRequest } from "jslib-common/models/request/referenceEventRequest";
|
|
||||||
import { RegisterRequest } from "jslib-common/models/request/registerRequest";
|
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { AuthService } from "jslib-common/abstractions/auth.service";
|
import { AuthService } from "jslib-common/abstractions/auth.service";
|
||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||||
@ -14,24 +10,26 @@ import { LogService } from "jslib-common/abstractions/log.service";
|
|||||||
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { KdfType } from "jslib-common/enums/kdfType";
|
import { KdfType } from "jslib-common/enums/kdfType";
|
||||||
|
import { KeysRequest } from "jslib-common/models/request/keysRequest";
|
||||||
|
import { ReferenceEventRequest } from "jslib-common/models/request/referenceEventRequest";
|
||||||
|
import { RegisterRequest } from "jslib-common/models/request/registerRequest";
|
||||||
|
|
||||||
import { CaptchaProtectedComponent } from "./captchaProtected.component";
|
import { CaptchaProtectedComponent } from "./captchaProtected.component";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class RegisterComponent extends CaptchaProtectedComponent implements OnInit {
|
export class RegisterComponent extends CaptchaProtectedComponent implements OnInit {
|
||||||
name: string = "";
|
name = "";
|
||||||
email: string = "";
|
email = "";
|
||||||
masterPassword: string = "";
|
masterPassword = "";
|
||||||
confirmMasterPassword: string = "";
|
confirmMasterPassword = "";
|
||||||
hint: string = "";
|
hint = "";
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
masterPasswordScore: number;
|
masterPasswordScore: number;
|
||||||
referenceData: ReferenceEventRequest;
|
referenceData: ReferenceEventRequest;
|
||||||
showTerms = true;
|
showTerms = true;
|
||||||
acceptPolicies: boolean = false;
|
acceptPolicies = false;
|
||||||
|
|
||||||
protected successRoute = "login";
|
protected successRoute = "login";
|
||||||
private masterPasswordStrengthTimeout: any;
|
private masterPasswordStrengthTimeout: any;
|
||||||
|
@ -7,16 +7,15 @@ import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.serv
|
|||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||||
|
|
||||||
import { Organization } from "jslib-common/models/domain/organization";
|
import { Organization } from "jslib-common/models/domain/organization";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class RemovePasswordComponent implements OnInit {
|
export class RemovePasswordComponent implements OnInit {
|
||||||
actionPromise: Promise<any>;
|
actionPromise: Promise<any>;
|
||||||
continuing: boolean = false;
|
continuing = false;
|
||||||
leaving: boolean = false;
|
leaving = false;
|
||||||
|
|
||||||
loading: boolean = true;
|
loading = true;
|
||||||
organization: Organization;
|
organization: Organization;
|
||||||
email: string;
|
email: string;
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import { DatePipe } from "@angular/common";
|
import { DatePipe } from "@angular/common";
|
||||||
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
||||||
|
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
|
||||||
import { SendType } from "jslib-common/enums/sendType";
|
|
||||||
|
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
@ -12,14 +9,14 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { SendService } from "jslib-common/abstractions/send.service";
|
import { SendService } from "jslib-common/abstractions/send.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
|
import { SendType } from "jslib-common/enums/sendType";
|
||||||
|
import { EncArrayBuffer } from "jslib-common/models/domain/encArrayBuffer";
|
||||||
|
import { Send } from "jslib-common/models/domain/send";
|
||||||
import { SendFileView } from "jslib-common/models/view/sendFileView";
|
import { SendFileView } from "jslib-common/models/view/sendFileView";
|
||||||
import { SendTextView } from "jslib-common/models/view/sendTextView";
|
import { SendTextView } from "jslib-common/models/view/sendTextView";
|
||||||
import { SendView } from "jslib-common/models/view/sendView";
|
import { SendView } from "jslib-common/models/view/sendView";
|
||||||
|
|
||||||
import { EncArrayBuffer } from "jslib-common/models/domain/encArrayBuffer";
|
|
||||||
import { Send } from "jslib-common/models/domain/send";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class AddEditComponent implements OnInit {
|
export class AddEditComponent implements OnInit {
|
||||||
@Input() sendId: string;
|
@Input() sendId: string;
|
||||||
|
@ -133,7 +133,7 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
default:
|
default:
|
||||||
return this.defaultDeletionDateTime.value;
|
return this.defaultDeletionDateTime.value;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const miliseconds = now.setTime(
|
const miliseconds = now.setTime(
|
||||||
now.getTime() + (this.selectedDeletionDatePreset.value as number) * 60 * 60 * 1000
|
now.getTime() + (this.selectedDeletionDatePreset.value as number) * 60 * 60 * 1000
|
||||||
@ -141,6 +141,7 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
return new Date(miliseconds).toString();
|
return new Date(miliseconds).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get formattedExpirationDate(): string {
|
get formattedExpirationDate(): string {
|
||||||
switch (this.selectedExpirationDatePreset.value as DatePreset) {
|
switch (this.selectedExpirationDatePreset.value as DatePreset) {
|
||||||
@ -163,7 +164,7 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
return this.defaultExpirationDateTime.value;
|
return this.defaultExpirationDateTime.value;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const miliseconds = now.setTime(
|
const miliseconds = now.setTime(
|
||||||
now.getTime() + (this.selectedExpirationDatePreset.value as number) * 60 * 60 * 1000
|
now.getTime() + (this.selectedExpirationDatePreset.value as number) * 60 * 60 * 1000
|
||||||
@ -171,6 +172,7 @@ export class EffluxDatesComponent implements OnInit {
|
|||||||
return new Date(miliseconds).toString();
|
return new Date(miliseconds).toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
get safariDeletionTimePresetOptions() {
|
get safariDeletionTimePresetOptions() {
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
import { Directive, NgZone, OnInit } from "@angular/core";
|
import { Directive, NgZone, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
|
||||||
import { SendType } from "jslib-common/enums/sendType";
|
|
||||||
|
|
||||||
import { SendView } from "jslib-common/models/view/sendView";
|
|
||||||
|
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
@ -12,6 +7,9 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { SearchService } from "jslib-common/abstractions/search.service";
|
import { SearchService } from "jslib-common/abstractions/search.service";
|
||||||
import { SendService } from "jslib-common/abstractions/send.service";
|
import { SendService } from "jslib-common/abstractions/send.service";
|
||||||
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
|
import { SendType } from "jslib-common/enums/sendType";
|
||||||
|
import { SendView } from "jslib-common/models/view/sendView";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class SendComponent implements OnInit {
|
export class SendComponent implements OnInit {
|
||||||
@ -20,7 +18,7 @@ export class SendComponent implements OnInit {
|
|||||||
loaded = false;
|
loaded = false;
|
||||||
loading = true;
|
loading = true;
|
||||||
refreshing = false;
|
refreshing = false;
|
||||||
expired: boolean = false;
|
expired = false;
|
||||||
type: SendType = null;
|
type: SendType = null;
|
||||||
sends: SendView[] = [];
|
sends: SendView[] = [];
|
||||||
filteredSends: SendView[] = [];
|
filteredSends: SendView[] = [];
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Directive } from "@angular/core";
|
import { Directive } from "@angular/core";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
|
|
||||||
import { first } from "rxjs/operators";
|
import { first } from "rxjs/operators";
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
@ -12,26 +11,22 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||||
|
import { HashPurpose } from "jslib-common/enums/hashPurpose";
|
||||||
|
import { KdfType } from "jslib-common/enums/kdfType";
|
||||||
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { KeysRequest } from "jslib-common/models/request/keysRequest";
|
import { KeysRequest } from "jslib-common/models/request/keysRequest";
|
||||||
import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest";
|
import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest";
|
||||||
import { SetPasswordRequest } from "jslib-common/models/request/setPasswordRequest";
|
import { SetPasswordRequest } from "jslib-common/models/request/setPasswordRequest";
|
||||||
|
|
||||||
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
||||||
|
|
||||||
import { HashPurpose } from "jslib-common/enums/hashPurpose";
|
|
||||||
import { KdfType } from "jslib-common/enums/kdfType";
|
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class SetPasswordComponent extends BaseChangePasswordComponent {
|
export class SetPasswordComponent extends BaseChangePasswordComponent {
|
||||||
syncLoading: boolean = true;
|
syncLoading = true;
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
hint: string = "";
|
hint = "";
|
||||||
identifier: string = null;
|
identifier: string = null;
|
||||||
orgId: string;
|
orgId: string;
|
||||||
resetPasswordAutoEnroll = false;
|
resetPasswordAutoEnroll = false;
|
||||||
|
@ -3,7 +3,6 @@ import { Directive, OnInit } from "@angular/core";
|
|||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||||
import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.service";
|
import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
import { ModalRef } from "./modal/modal.ref";
|
import { ModalRef } from "./modal/modal.ref";
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
|
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
|
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
import { Policy } from "jslib-common/models/domain/policy";
|
import { Policy } from "jslib-common/models/domain/policy";
|
||||||
|
|
||||||
@ -120,11 +119,13 @@ export class VaultTimeoutInputComponent implements ControlValueAccessor, Validat
|
|||||||
this.onChange = onChange;
|
this.onChange = onChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line
|
registerOnTouched(onTouched: any): void {
|
||||||
registerOnTouched(onTouched: any): void {}
|
// Empty
|
||||||
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line
|
setDisabledState?(isDisabled: boolean): void {
|
||||||
setDisabledState?(isDisabled: boolean): void {}
|
// Empty
|
||||||
|
}
|
||||||
|
|
||||||
validate(control: AbstractControl): ValidationErrors {
|
validate(control: AbstractControl): ValidationErrors {
|
||||||
if (this.vaultTimeoutPolicy && this.vaultTimeoutPolicy?.data?.minutes < control.value) {
|
if (this.vaultTimeoutPolicy && this.vaultTimeoutPolicy?.data?.minutes < control.value) {
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
||||||
|
|
||||||
import { OrganizationUserStatusType } from "jslib-common/enums/organizationUserStatusType";
|
|
||||||
|
|
||||||
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
import { CipherService } from "jslib-common/abstractions/cipher.service";
|
||||||
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
import { CollectionService } from "jslib-common/abstractions/collection.service";
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { OrganizationService } from "jslib-common/abstractions/organization.service";
|
import { OrganizationService } from "jslib-common/abstractions/organization.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
import { OrganizationUserStatusType } from "jslib-common/enums/organizationUserStatusType";
|
||||||
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
import { Organization } from "jslib-common/models/domain/organization";
|
import { Organization } from "jslib-common/models/domain/organization";
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
import { CollectionView } from "jslib-common/models/view/collectionView";
|
import { CollectionView } from "jslib-common/models/view/collectionView";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class ShareComponent implements OnInit {
|
export class ShareComponent implements OnInit {
|
||||||
@Input() cipherId: string;
|
@Input() cipherId: string;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Directive } from "@angular/core";
|
import { Directive } from "@angular/core";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
|
|
||||||
import { first } from "rxjs/operators";
|
import { first } from "rxjs/operators";
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
@ -12,9 +11,7 @@ import { LogService } from "jslib-common/abstractions/log.service";
|
|||||||
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
import { AuthResult } from "jslib-common/models/domain/authResult";
|
import { AuthResult } from "jslib-common/models/domain/authResult";
|
||||||
import { SsoLogInCredentials } from "jslib-common/models/domain/logInCredentials";
|
import { SsoLogInCredentials } from "jslib-common/models/domain/logInCredentials";
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
import { Directive, EventEmitter, OnInit, Output } from "@angular/core";
|
import { Directive, EventEmitter, OnInit, Output } from "@angular/core";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
|
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
|
||||||
|
|
||||||
import { AuthService } from "jslib-common/abstractions/auth.service";
|
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
||||||
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class TwoFactorOptionsComponent implements OnInit {
|
export class TwoFactorOptionsComponent implements OnInit {
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
import { Directive, OnDestroy, OnInit } from "@angular/core";
|
import { Directive, OnDestroy, OnInit } from "@angular/core";
|
||||||
|
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
|
import * as DuoWebSDK from "duo_web_sdk";
|
||||||
import { first } from "rxjs/operators";
|
import { first } from "rxjs/operators";
|
||||||
|
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
|
||||||
|
|
||||||
import { TwoFactorEmailRequest } from "jslib-common/models/request/twoFactorEmailRequest";
|
|
||||||
|
|
||||||
import { AuthResult } from "jslib-common/models/domain/authResult";
|
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { AuthService } from "jslib-common/abstractions/auth.service";
|
import { AuthService } from "jslib-common/abstractions/auth.service";
|
||||||
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
||||||
@ -17,25 +10,25 @@ import { I18nService } from "jslib-common/abstractions/i18n.service";
|
|||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
|
|
||||||
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
|
||||||
|
|
||||||
import * as DuoWebSDK from "duo_web_sdk";
|
|
||||||
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
import { TwoFactorService } from "jslib-common/abstractions/twoFactor.service";
|
||||||
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
import { WebAuthnIFrame } from "jslib-common/misc/webauthn_iframe";
|
import { WebAuthnIFrame } from "jslib-common/misc/webauthn_iframe";
|
||||||
|
import { AuthResult } from "jslib-common/models/domain/authResult";
|
||||||
|
import { TwoFactorEmailRequest } from "jslib-common/models/request/twoFactorEmailRequest";
|
||||||
|
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class TwoFactorComponent implements OnInit, OnDestroy {
|
export class TwoFactorComponent implements OnInit, OnDestroy {
|
||||||
token: string = "";
|
token = "";
|
||||||
remember: boolean = false;
|
remember = false;
|
||||||
webAuthnReady: boolean = false;
|
webAuthnReady = false;
|
||||||
webAuthnNewTab: boolean = false;
|
webAuthnNewTab = false;
|
||||||
providers = TwoFactorProviders;
|
providers = TwoFactorProviders;
|
||||||
providerType = TwoFactorProviderType;
|
providerType = TwoFactorProviderType;
|
||||||
selectedProviderType: TwoFactorProviderType = TwoFactorProviderType.Authenticator;
|
selectedProviderType: TwoFactorProviderType = TwoFactorProviderType.Authenticator;
|
||||||
webAuthnSupported: boolean = false;
|
webAuthnSupported = false;
|
||||||
webAuthn: WebAuthnIFrame = null;
|
webAuthn: WebAuthnIFrame = null;
|
||||||
title: string = "";
|
title = "";
|
||||||
twoFactorEmail: string = null;
|
twoFactorEmail: string = null;
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
emailPromise: Promise<any>;
|
emailPromise: Promise<any>;
|
||||||
|
@ -11,24 +11,21 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||||
|
import { VerificationType } from "jslib-common/enums/verificationType";
|
||||||
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
|
||||||
|
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
||||||
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
import { PasswordRequest } from "jslib-common/models/request/passwordRequest";
|
import { PasswordRequest } from "jslib-common/models/request/passwordRequest";
|
||||||
|
|
||||||
import { VerificationType } from "jslib-common/enums/verificationType";
|
|
||||||
import { Verification } from "jslib-common/types/verification";
|
import { Verification } from "jslib-common/types/verification";
|
||||||
|
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class UpdatePasswordComponent extends BaseChangePasswordComponent {
|
export class UpdatePasswordComponent extends BaseChangePasswordComponent {
|
||||||
hint: string;
|
hint: string;
|
||||||
key: string;
|
key: string;
|
||||||
enforcedPolicyOptions: MasterPasswordPolicyOptions;
|
enforcedPolicyOptions: MasterPasswordPolicyOptions;
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
currentMasterPassword: string;
|
currentMasterPassword: string;
|
||||||
|
|
||||||
onSuccessfulChangePassword: () => Promise<any>;
|
onSuccessfulChangePassword: () => Promise<any>;
|
||||||
|
@ -10,21 +10,19 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { SyncService } from "jslib-common/abstractions/sync.service";
|
import { SyncService } from "jslib-common/abstractions/sync.service";
|
||||||
|
|
||||||
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
|
||||||
|
|
||||||
import { EncString } from "jslib-common/models/domain/encString";
|
import { EncString } from "jslib-common/models/domain/encString";
|
||||||
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
import { MasterPasswordPolicyOptions } from "jslib-common/models/domain/masterPasswordPolicyOptions";
|
||||||
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "jslib-common/models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { UpdateTempPasswordRequest } from "jslib-common/models/request/updateTempPasswordRequest";
|
import { UpdateTempPasswordRequest } from "jslib-common/models/request/updateTempPasswordRequest";
|
||||||
|
|
||||||
|
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
export class UpdateTempPasswordComponent extends BaseChangePasswordComponent {
|
export class UpdateTempPasswordComponent extends BaseChangePasswordComponent {
|
||||||
hint: string;
|
hint: string;
|
||||||
key: string;
|
key: string;
|
||||||
enforcedPolicyOptions: MasterPasswordPolicyOptions;
|
enforcedPolicyOptions: MasterPasswordPolicyOptions;
|
||||||
showPassword: boolean = false;
|
showPassword = false;
|
||||||
|
|
||||||
onSuccessfulChangePassword: () => Promise<any>;
|
onSuccessfulChangePassword: () => Promise<any>;
|
||||||
|
|
||||||
|
@ -4,9 +4,7 @@ import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from "@angular/f
|
|||||||
|
|
||||||
import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.service";
|
import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.service";
|
||||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||||
|
|
||||||
import { VerificationType } from "jslib-common/enums/verificationType";
|
import { VerificationType } from "jslib-common/enums/verificationType";
|
||||||
|
|
||||||
import { Verification } from "jslib-common/types/verification";
|
import { Verification } from "jslib-common/types/verification";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -26,9 +24,9 @@ import { Verification } from "jslib-common/types/verification";
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class VerifyMasterPasswordComponent implements ControlValueAccessor, OnInit {
|
export class VerifyMasterPasswordComponent implements ControlValueAccessor, OnInit {
|
||||||
usesKeyConnector: boolean = false;
|
usesKeyConnector = false;
|
||||||
disableRequestOTP: boolean = false;
|
disableRequestOTP = false;
|
||||||
sentCode: boolean = false;
|
sentCode = false;
|
||||||
|
|
||||||
secret = new FormControl("");
|
secret = new FormControl("");
|
||||||
|
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { Directive, Input } from "@angular/core";
|
import { Directive, Input } from "@angular/core";
|
||||||
|
|
||||||
|
import { EventService } from "jslib-common/abstractions/event.service";
|
||||||
import { EventType } from "jslib-common/enums/eventType";
|
import { EventType } from "jslib-common/enums/eventType";
|
||||||
import { FieldType } from "jslib-common/enums/fieldType";
|
import { FieldType } from "jslib-common/enums/fieldType";
|
||||||
|
|
||||||
import { EventService } from "jslib-common/abstractions/event.service";
|
|
||||||
|
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
import { FieldView } from "jslib-common/models/view/fieldView";
|
import { FieldView } from "jslib-common/models/view/fieldView";
|
||||||
|
|
||||||
|
@ -9,11 +9,6 @@ import {
|
|||||||
Output,
|
Output,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
|
|
||||||
import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType";
|
|
||||||
import { CipherType } from "jslib-common/enums/cipherType";
|
|
||||||
import { EventType } from "jslib-common/enums/eventType";
|
|
||||||
import { FieldType } from "jslib-common/enums/fieldType";
|
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
import { AuditService } from "jslib-common/abstractions/audit.service";
|
import { AuditService } from "jslib-common/abstractions/audit.service";
|
||||||
import { BroadcasterService } from "jslib-common/abstractions/broadcaster.service";
|
import { BroadcasterService } from "jslib-common/abstractions/broadcaster.service";
|
||||||
@ -27,9 +22,11 @@ import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.se
|
|||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { TokenService } from "jslib-common/abstractions/token.service";
|
import { TokenService } from "jslib-common/abstractions/token.service";
|
||||||
import { TotpService } from "jslib-common/abstractions/totp.service";
|
import { TotpService } from "jslib-common/abstractions/totp.service";
|
||||||
|
import { CipherRepromptType } from "jslib-common/enums/cipherRepromptType";
|
||||||
|
import { CipherType } from "jslib-common/enums/cipherType";
|
||||||
|
import { EventType } from "jslib-common/enums/eventType";
|
||||||
|
import { FieldType } from "jslib-common/enums/fieldType";
|
||||||
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
||||||
|
|
||||||
import { AttachmentView } from "jslib-common/models/view/attachmentView";
|
import { AttachmentView } from "jslib-common/models/view/attachmentView";
|
||||||
import { CipherView } from "jslib-common/models/view/cipherView";
|
import { CipherView } from "jslib-common/models/view/cipherView";
|
||||||
import { LoginUriView } from "jslib-common/models/view/loginUriView";
|
import { LoginUriView } from "jslib-common/models/view/loginUriView";
|
||||||
@ -60,7 +57,7 @@ export class ViewComponent implements OnDestroy, OnInit {
|
|||||||
|
|
||||||
private totpInterval: any;
|
private totpInterval: any;
|
||||||
private previousCipherId: string;
|
private previousCipherId: string;
|
||||||
private passwordReprompted: boolean = false;
|
private passwordReprompted = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected cipherService: CipherService,
|
protected cipherService: CipherService,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Directive, ElementRef, Input, OnChanges } from "@angular/core";
|
import { Directive, ElementRef, Input, OnChanges } from "@angular/core";
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
|
||||||
|
|
||||||
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
||||||
|
|
||||||
import { ValidationService } from "../services/validation.service";
|
import { ValidationService } from "../services/validation.service";
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Directive, ElementRef, Input, NgZone } from "@angular/core";
|
import { Directive, ElementRef, Input, NgZone } from "@angular/core";
|
||||||
|
|
||||||
import { take } from "rxjs/operators";
|
import { take } from "rxjs/operators";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
@ -7,7 +7,7 @@ export class BoxRowDirective implements OnInit {
|
|||||||
el: HTMLElement = null;
|
el: HTMLElement = null;
|
||||||
formEls: Element[];
|
formEls: Element[];
|
||||||
|
|
||||||
constructor(private elRef: ElementRef) {
|
constructor(elRef: ElementRef) {
|
||||||
this.el = elRef.nativeElement;
|
this.el = elRef.nativeElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ export class BoxRowDirective implements OnInit {
|
|||||||
this.formEls.forEach((formEl) => {
|
this.formEls.forEach((formEl) => {
|
||||||
formEl.addEventListener(
|
formEl.addEventListener(
|
||||||
"focus",
|
"focus",
|
||||||
(event: Event) => {
|
() => {
|
||||||
this.el.classList.add("active");
|
this.el.classList.add("active");
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
@ -26,7 +26,7 @@ export class BoxRowDirective implements OnInit {
|
|||||||
|
|
||||||
formEl.addEventListener(
|
formEl.addEventListener(
|
||||||
"blur",
|
"blur",
|
||||||
(event: Event) => {
|
() => {
|
||||||
this.el.classList.remove("active");
|
this.el.classList.remove("active");
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Directive, ElementRef, forwardRef, HostListener, Input, Renderer2 } from "@angular/core";
|
import { Directive, ElementRef, forwardRef, HostListener, Input, Renderer2 } from "@angular/core";
|
||||||
import { ControlValueAccessor, NgControl, NG_VALUE_ACCESSOR } from "@angular/forms";
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
|
||||||
|
|
||||||
// ref: https://juristr.com/blog/2018/02/ng-true-value-directive/
|
// ref: https://juristr.com/blog/2018/02/ng-true-value-directive/
|
||||||
@Directive({
|
@Directive({
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { Pipe, PipeTransform } from "@angular/core";
|
import { Pipe, PipeTransform } from "@angular/core";
|
||||||
|
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
import { Utils } from "jslib-common/misc/utils";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6,7 +6,7 @@ import { CipherView } from "jslib-common/models/view/cipherView";
|
|||||||
name: "searchCiphers",
|
name: "searchCiphers",
|
||||||
})
|
})
|
||||||
export class SearchCiphersPipe implements PipeTransform {
|
export class SearchCiphersPipe implements PipeTransform {
|
||||||
transform(ciphers: CipherView[], searchText: string, deleted: boolean = false): CipherView[] {
|
transform(ciphers: CipherView[], searchText: string, deleted = false): CipherView[] {
|
||||||
if (ciphers == null || ciphers.length === 0) {
|
if (ciphers == null || ciphers.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,5 @@
|
|||||||
import { Injector, LOCALE_ID, NgModule } from "@angular/core";
|
import { Injector, LOCALE_ID, NgModule } from "@angular/core";
|
||||||
|
|
||||||
import { ApiService } from "jslib-common/services/api.service";
|
|
||||||
import { AppIdService } from "jslib-common/services/appId.service";
|
|
||||||
import { AuditService } from "jslib-common/services/audit.service";
|
|
||||||
import { AuthService } from "jslib-common/services/auth.service";
|
|
||||||
import { CipherService } from "jslib-common/services/cipher.service";
|
|
||||||
import { CollectionService } from "jslib-common/services/collection.service";
|
|
||||||
import { ConsoleLogService } from "jslib-common/services/consoleLog.service";
|
|
||||||
import { CryptoService } from "jslib-common/services/crypto.service";
|
|
||||||
import { EnvironmentService } from "jslib-common/services/environment.service";
|
|
||||||
import { EventService } from "jslib-common/services/event.service";
|
|
||||||
import { ExportService } from "jslib-common/services/export.service";
|
|
||||||
import { FileUploadService } from "jslib-common/services/fileUpload.service";
|
|
||||||
import { FolderService } from "jslib-common/services/folder.service";
|
|
||||||
import { KeyConnectorService } from "jslib-common/services/keyConnector.service";
|
|
||||||
import { NotificationsService } from "jslib-common/services/notifications.service";
|
|
||||||
import { OrganizationService } from "jslib-common/services/organization.service";
|
|
||||||
import { PasswordGenerationService } from "jslib-common/services/passwordGeneration.service";
|
|
||||||
import { PolicyService } from "jslib-common/services/policy.service";
|
|
||||||
import { ProviderService } from "jslib-common/services/provider.service";
|
|
||||||
import { SearchService } from "jslib-common/services/search.service";
|
|
||||||
import { SendService } from "jslib-common/services/send.service";
|
|
||||||
import { SettingsService } from "jslib-common/services/settings.service";
|
|
||||||
import { StateService } from "jslib-common/services/state.service";
|
|
||||||
import { StateMigrationService } from "jslib-common/services/stateMigration.service";
|
|
||||||
import { SyncService } from "jslib-common/services/sync.service";
|
|
||||||
import { TokenService } from "jslib-common/services/token.service";
|
|
||||||
import { TotpService } from "jslib-common/services/totp.service";
|
|
||||||
import { TwoFactorService } from "jslib-common/services/twoFactor.service";
|
|
||||||
import { UserVerificationService } from "jslib-common/services/userVerification.service";
|
|
||||||
import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service";
|
|
||||||
import { WebCryptoFunctionService } from "jslib-common/services/webCryptoFunction.service";
|
|
||||||
|
|
||||||
import { ApiService as ApiServiceAbstraction } from "jslib-common/abstractions/api.service";
|
import { ApiService as ApiServiceAbstraction } from "jslib-common/abstractions/api.service";
|
||||||
import { AppIdService as AppIdServiceAbstraction } from "jslib-common/abstractions/appId.service";
|
import { AppIdService as AppIdServiceAbstraction } from "jslib-common/abstractions/appId.service";
|
||||||
import { AuditService as AuditServiceAbstraction } from "jslib-common/abstractions/audit.service";
|
import { AuditService as AuditServiceAbstraction } from "jslib-common/abstractions/audit.service";
|
||||||
@ -69,6 +37,40 @@ import { TotpService as TotpServiceAbstraction } from "jslib-common/abstractions
|
|||||||
import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service";
|
import { TwoFactorService as TwoFactorServiceAbstraction } from "jslib-common/abstractions/twoFactor.service";
|
||||||
import { UserVerificationService as UserVerificationServiceAbstraction } from "jslib-common/abstractions/userVerification.service";
|
import { UserVerificationService as UserVerificationServiceAbstraction } from "jslib-common/abstractions/userVerification.service";
|
||||||
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service";
|
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "jslib-common/abstractions/vaultTimeout.service";
|
||||||
|
import { StateFactory } from "jslib-common/factories/stateFactory";
|
||||||
|
import { Account } from "jslib-common/models/domain/account";
|
||||||
|
import { GlobalState } from "jslib-common/models/domain/globalState";
|
||||||
|
import { ApiService } from "jslib-common/services/api.service";
|
||||||
|
import { AppIdService } from "jslib-common/services/appId.service";
|
||||||
|
import { AuditService } from "jslib-common/services/audit.service";
|
||||||
|
import { AuthService } from "jslib-common/services/auth.service";
|
||||||
|
import { CipherService } from "jslib-common/services/cipher.service";
|
||||||
|
import { CollectionService } from "jslib-common/services/collection.service";
|
||||||
|
import { ConsoleLogService } from "jslib-common/services/consoleLog.service";
|
||||||
|
import { CryptoService } from "jslib-common/services/crypto.service";
|
||||||
|
import { EnvironmentService } from "jslib-common/services/environment.service";
|
||||||
|
import { EventService } from "jslib-common/services/event.service";
|
||||||
|
import { ExportService } from "jslib-common/services/export.service";
|
||||||
|
import { FileUploadService } from "jslib-common/services/fileUpload.service";
|
||||||
|
import { FolderService } from "jslib-common/services/folder.service";
|
||||||
|
import { KeyConnectorService } from "jslib-common/services/keyConnector.service";
|
||||||
|
import { NotificationsService } from "jslib-common/services/notifications.service";
|
||||||
|
import { OrganizationService } from "jslib-common/services/organization.service";
|
||||||
|
import { PasswordGenerationService } from "jslib-common/services/passwordGeneration.service";
|
||||||
|
import { PolicyService } from "jslib-common/services/policy.service";
|
||||||
|
import { ProviderService } from "jslib-common/services/provider.service";
|
||||||
|
import { SearchService } from "jslib-common/services/search.service";
|
||||||
|
import { SendService } from "jslib-common/services/send.service";
|
||||||
|
import { SettingsService } from "jslib-common/services/settings.service";
|
||||||
|
import { StateService } from "jslib-common/services/state.service";
|
||||||
|
import { StateMigrationService } from "jslib-common/services/stateMigration.service";
|
||||||
|
import { SyncService } from "jslib-common/services/sync.service";
|
||||||
|
import { TokenService } from "jslib-common/services/token.service";
|
||||||
|
import { TotpService } from "jslib-common/services/totp.service";
|
||||||
|
import { TwoFactorService } from "jslib-common/services/twoFactor.service";
|
||||||
|
import { UserVerificationService } from "jslib-common/services/userVerification.service";
|
||||||
|
import { VaultTimeoutService } from "jslib-common/services/vaultTimeout.service";
|
||||||
|
import { WebCryptoFunctionService } from "jslib-common/services/webCryptoFunction.service";
|
||||||
|
|
||||||
import { AuthGuardService } from "./auth-guard.service";
|
import { AuthGuardService } from "./auth-guard.service";
|
||||||
import { BroadcasterService } from "./broadcaster.service";
|
import { BroadcasterService } from "./broadcaster.service";
|
||||||
@ -78,12 +80,6 @@ import { PasswordRepromptService } from "./passwordReprompt.service";
|
|||||||
import { UnauthGuardService } from "./unauth-guard.service";
|
import { UnauthGuardService } from "./unauth-guard.service";
|
||||||
import { ValidationService } from "./validation.service";
|
import { ValidationService } from "./validation.service";
|
||||||
|
|
||||||
import { Account } from "jslib-common/models/domain/account";
|
|
||||||
import { GlobalState } from "jslib-common/models/domain/globalState";
|
|
||||||
|
|
||||||
import { GlobalStateFactory } from "jslib-common/factories/globalStateFactory";
|
|
||||||
import { StateFactory } from "jslib-common/factories/stateFactory";
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [],
|
declarations: [],
|
||||||
providers: [
|
providers: [
|
||||||
|
@ -17,7 +17,7 @@ import { ModalRef } from "../components/modal/modal.ref";
|
|||||||
|
|
||||||
export class ModalConfig<D = any> {
|
export class ModalConfig<D = any> {
|
||||||
data?: D;
|
data?: D;
|
||||||
allowMultipleModals: boolean = false;
|
allowMultipleModals = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -68,6 +68,7 @@ export class ModalService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
const [modalRef, _] = this.openInternal(componentType, config, true);
|
const [modalRef, _] = this.openInternal(componentType, config, true);
|
||||||
|
|
||||||
return modalRef;
|
return modalRef;
|
||||||
@ -145,7 +146,7 @@ export class ModalService {
|
|||||||
el.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]')
|
el.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]')
|
||||||
);
|
);
|
||||||
for (const closeElement of modals) {
|
for (const closeElement of modals) {
|
||||||
closeElement.addEventListener("click", (event) => {
|
closeElement.addEventListener("click", () => {
|
||||||
modalRef.close();
|
modalRef.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import { KeyConnectorService } from "jslib-common/abstractions/keyConnector.serv
|
|||||||
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "jslib-common/abstractions/passwordReprompt.service";
|
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "jslib-common/abstractions/passwordReprompt.service";
|
||||||
|
|
||||||
import { PasswordRepromptComponent } from "../components/password-reprompt.component";
|
import { PasswordRepromptComponent } from "../components/password-reprompt.component";
|
||||||
|
|
||||||
import { ModalService } from "./modal.service";
|
import { ModalService } from "./modal.service";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -2,7 +2,6 @@ import { Injectable } from "@angular/core";
|
|||||||
|
|
||||||
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
|
|
||||||
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
import { ErrorResponse } from "jslib-common/models/response/errorResponse";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf dist/**/*",
|
"clean": "rimraf dist/**/*",
|
||||||
"build": "npm run clean && tsc",
|
"build": "npm run clean && tsc",
|
||||||
"build:watch": "npm run clean && tsc -watch",
|
"build:watch": "npm run clean && tsc -watch"
|
||||||
"lint": "tslint 'src/**/*.ts' 'spec/**/*.ts'",
|
|
||||||
"lint:fix": "tslint 'src/**/*.ts' 'spec/**/*.ts' --fix"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/lunr": "^2.3.3",
|
"@types/lunr": "^2.3.3",
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { PolicyType } from "../enums/policyType";
|
import { PolicyType } from "../enums/policyType";
|
||||||
import { SetKeyConnectorKeyRequest } from "../models/request/account/setKeyConnectorKeyRequest";
|
import { SetKeyConnectorKeyRequest } from "../models/request/account/setKeyConnectorKeyRequest";
|
||||||
import { VerifyOTPRequest } from "../models/request/account/verifyOTPRequest";
|
import { VerifyOTPRequest } from "../models/request/account/verifyOTPRequest";
|
||||||
|
|
||||||
import { AttachmentRequest } from "../models/request/attachmentRequest";
|
import { AttachmentRequest } from "../models/request/attachmentRequest";
|
||||||
|
|
||||||
import { BitPayInvoiceRequest } from "../models/request/bitPayInvoiceRequest";
|
import { BitPayInvoiceRequest } from "../models/request/bitPayInvoiceRequest";
|
||||||
import { CipherBulkDeleteRequest } from "../models/request/cipherBulkDeleteRequest";
|
import { CipherBulkDeleteRequest } from "../models/request/cipherBulkDeleteRequest";
|
||||||
import { CipherBulkMoveRequest } from "../models/request/cipherBulkMoveRequest";
|
import { CipherBulkMoveRequest } from "../models/request/cipherBulkMoveRequest";
|
||||||
@ -26,6 +24,9 @@ import { EventRequest } from "../models/request/eventRequest";
|
|||||||
import { FolderRequest } from "../models/request/folderRequest";
|
import { FolderRequest } from "../models/request/folderRequest";
|
||||||
import { GroupRequest } from "../models/request/groupRequest";
|
import { GroupRequest } from "../models/request/groupRequest";
|
||||||
import { IapCheckRequest } from "../models/request/iapCheckRequest";
|
import { IapCheckRequest } from "../models/request/iapCheckRequest";
|
||||||
|
import { ApiTokenRequest } from "../models/request/identityToken/apiTokenRequest";
|
||||||
|
import { PasswordTokenRequest } from "../models/request/identityToken/passwordTokenRequest";
|
||||||
|
import { SsoTokenRequest } from "../models/request/identityToken/ssoTokenRequest";
|
||||||
import { ImportCiphersRequest } from "../models/request/importCiphersRequest";
|
import { ImportCiphersRequest } from "../models/request/importCiphersRequest";
|
||||||
import { ImportDirectoryRequest } from "../models/request/importDirectoryRequest";
|
import { ImportDirectoryRequest } from "../models/request/importDirectoryRequest";
|
||||||
import { ImportOrganizationCiphersRequest } from "../models/request/importOrganizationCiphersRequest";
|
import { ImportOrganizationCiphersRequest } from "../models/request/importOrganizationCiphersRequest";
|
||||||
@ -91,11 +92,6 @@ import { UpdateTwoFactorYubioOtpRequest } from "../models/request/updateTwoFacto
|
|||||||
import { VerifyBankRequest } from "../models/request/verifyBankRequest";
|
import { VerifyBankRequest } from "../models/request/verifyBankRequest";
|
||||||
import { VerifyDeleteRecoverRequest } from "../models/request/verifyDeleteRecoverRequest";
|
import { VerifyDeleteRecoverRequest } from "../models/request/verifyDeleteRecoverRequest";
|
||||||
import { VerifyEmailRequest } from "../models/request/verifyEmailRequest";
|
import { VerifyEmailRequest } from "../models/request/verifyEmailRequest";
|
||||||
|
|
||||||
import { ApiTokenRequest } from "../models/request/identityToken/apiTokenRequest";
|
|
||||||
import { PasswordTokenRequest } from "../models/request/identityToken/passwordTokenRequest";
|
|
||||||
import { SsoTokenRequest } from "../models/request/identityToken/ssoTokenRequest";
|
|
||||||
|
|
||||||
import { ApiKeyResponse } from "../models/response/apiKeyResponse";
|
import { ApiKeyResponse } from "../models/response/apiKeyResponse";
|
||||||
import { AttachmentResponse } from "../models/response/attachmentResponse";
|
import { AttachmentResponse } from "../models/response/attachmentResponse";
|
||||||
import { AttachmentUploadDataResponse } from "../models/response/attachmentUploadDataResponse";
|
import { AttachmentUploadDataResponse } from "../models/response/attachmentUploadDataResponse";
|
||||||
@ -169,7 +165,6 @@ import {
|
|||||||
} from "../models/response/twoFactorWebAuthnResponse";
|
} from "../models/response/twoFactorWebAuthnResponse";
|
||||||
import { TwoFactorYubiKeyResponse } from "../models/response/twoFactorYubiKeyResponse";
|
import { TwoFactorYubiKeyResponse } from "../models/response/twoFactorYubiKeyResponse";
|
||||||
import { UserKeyResponse } from "../models/response/userKeyResponse";
|
import { UserKeyResponse } from "../models/response/userKeyResponse";
|
||||||
|
|
||||||
import { SendAccessView } from "../models/view/sendAccessView";
|
import { SendAccessView } from "../models/view/sendAccessView";
|
||||||
|
|
||||||
export abstract class ApiService {
|
export abstract class ApiService {
|
||||||
|
@ -5,7 +5,6 @@ import {
|
|||||||
SsoLogInCredentials,
|
SsoLogInCredentials,
|
||||||
} from "../models/domain/logInCredentials";
|
} from "../models/domain/logInCredentials";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { TokenRequestTwoFactor } from "../models/request/identityToken/tokenRequest";
|
import { TokenRequestTwoFactor } from "../models/request/identityToken/tokenRequest";
|
||||||
|
|
||||||
export abstract class AuthService {
|
export abstract class AuthService {
|
||||||
@ -15,7 +14,7 @@ export abstract class AuthService {
|
|||||||
credentials: ApiLogInCredentials | PasswordLogInCredentials | SsoLogInCredentials
|
credentials: ApiLogInCredentials | PasswordLogInCredentials | SsoLogInCredentials
|
||||||
) => Promise<AuthResult>;
|
) => Promise<AuthResult>;
|
||||||
logInTwoFactor: (twoFactor: TokenRequestTwoFactor) => Promise<AuthResult>;
|
logInTwoFactor: (twoFactor: TokenRequestTwoFactor) => Promise<AuthResult>;
|
||||||
logOut: (callback: Function) => void;
|
logOut: (callback: () => void) => void;
|
||||||
makePreloginKey: (masterPassword: string, email: string) => Promise<SymmetricCryptoKey>;
|
makePreloginKey: (masterPassword: string, email: string) => Promise<SymmetricCryptoKey>;
|
||||||
authingWithApiKey: () => boolean;
|
authingWithApiKey: () => boolean;
|
||||||
authingWithSso: () => boolean;
|
authingWithSso: () => boolean;
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { UriMatchType } from "../enums/uriMatchType";
|
import { UriMatchType } from "../enums/uriMatchType";
|
||||||
|
|
||||||
import { CipherData } from "../models/data/cipherData";
|
import { CipherData } from "../models/data/cipherData";
|
||||||
|
|
||||||
import { Cipher } from "../models/domain/cipher";
|
import { Cipher } from "../models/domain/cipher";
|
||||||
import { Field } from "../models/domain/field";
|
import { Field } from "../models/domain/field";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { FieldView } from "../models/view/fieldView";
|
import { FieldView } from "../models/view/fieldView";
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { CollectionData } from "../models/data/collectionData";
|
import { CollectionData } from "../models/data/collectionData";
|
||||||
|
|
||||||
import { Collection } from "../models/domain/collection";
|
import { Collection } from "../models/domain/collection";
|
||||||
import { TreeNode } from "../models/domain/treeNode";
|
import { TreeNode } from "../models/domain/treeNode";
|
||||||
|
|
||||||
import { CollectionView } from "../models/view/collectionView";
|
import { CollectionView } from "../models/view/collectionView";
|
||||||
|
|
||||||
export abstract class CollectionService {
|
export abstract class CollectionService {
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import { EncArrayBuffer } from "../models/domain/encArrayBuffer";
|
|
||||||
import { EncString } from "../models/domain/encString";
|
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
|
||||||
|
|
||||||
import { ProfileOrganizationResponse } from "../models/response/profileOrganizationResponse";
|
|
||||||
import { ProfileProviderOrganizationResponse } from "../models/response/profileProviderOrganizationResponse";
|
|
||||||
import { ProfileProviderResponse } from "../models/response/profileProviderResponse";
|
|
||||||
|
|
||||||
import { HashPurpose } from "../enums/hashPurpose";
|
import { HashPurpose } from "../enums/hashPurpose";
|
||||||
import { KdfType } from "../enums/kdfType";
|
import { KdfType } from "../enums/kdfType";
|
||||||
import { KeySuffixOptions } from "../enums/keySuffixOptions";
|
import { KeySuffixOptions } from "../enums/keySuffixOptions";
|
||||||
|
import { EncArrayBuffer } from "../models/domain/encArrayBuffer";
|
||||||
|
import { EncString } from "../models/domain/encString";
|
||||||
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
|
import { ProfileOrganizationResponse } from "../models/response/profileOrganizationResponse";
|
||||||
|
import { ProfileProviderOrganizationResponse } from "../models/response/profileProviderOrganizationResponse";
|
||||||
|
import { ProfileProviderResponse } from "../models/response/profileProviderResponse";
|
||||||
|
|
||||||
export abstract class CryptoService {
|
export abstract class CryptoService {
|
||||||
setKey: (key: SymmetricCryptoKey) => Promise<any>;
|
setKey: (key: SymmetricCryptoKey) => Promise<any>;
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { FolderData } from "../models/data/folderData";
|
import { FolderData } from "../models/data/folderData";
|
||||||
|
|
||||||
import { Folder } from "../models/domain/folder";
|
import { Folder } from "../models/domain/folder";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
import { TreeNode } from "../models/domain/treeNode";
|
import { TreeNode } from "../models/domain/treeNode";
|
||||||
|
|
||||||
import { FolderView } from "../models/view/folderView";
|
import { FolderView } from "../models/view/folderView";
|
||||||
|
|
||||||
export abstract class FolderService {
|
export abstract class FolderService {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Organization } from "../models/domain/organization";
|
import { Organization } from "../models/domain/organization";
|
||||||
|
|
||||||
import { IdentityTokenResponse } from "../models/response/identityTokenResponse";
|
import { IdentityTokenResponse } from "../models/response/identityTokenResponse";
|
||||||
|
|
||||||
export abstract class KeyConnectorService {
|
export abstract class KeyConnectorService {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { OrganizationData } from "../models/data/organizationData";
|
import { OrganizationData } from "../models/data/organizationData";
|
||||||
|
|
||||||
import { Organization } from "../models/domain/organization";
|
import { Organization } from "../models/domain/organization";
|
||||||
|
|
||||||
export abstract class OrganizationService {
|
export abstract class OrganizationService {
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
|
import { PolicyType } from "../enums/policyType";
|
||||||
import { PolicyData } from "../models/data/policyData";
|
import { PolicyData } from "../models/data/policyData";
|
||||||
|
|
||||||
import { MasterPasswordPolicyOptions } from "../models/domain/masterPasswordPolicyOptions";
|
import { MasterPasswordPolicyOptions } from "../models/domain/masterPasswordPolicyOptions";
|
||||||
import { Policy } from "../models/domain/policy";
|
import { Policy } from "../models/domain/policy";
|
||||||
import { ResetPasswordPolicyOptions } from "../models/domain/resetPasswordPolicyOptions";
|
import { ResetPasswordPolicyOptions } from "../models/domain/resetPasswordPolicyOptions";
|
||||||
|
|
||||||
import { ListResponse } from "../models/response/listResponse";
|
import { ListResponse } from "../models/response/listResponse";
|
||||||
import { PolicyResponse } from "../models/response/policyResponse";
|
import { PolicyResponse } from "../models/response/policyResponse";
|
||||||
|
|
||||||
import { PolicyType } from "../enums/policyType";
|
|
||||||
|
|
||||||
export abstract class PolicyService {
|
export abstract class PolicyService {
|
||||||
clearCache: () => void;
|
clearCache: () => void;
|
||||||
getAll: (type?: PolicyType, userId?: string) => Promise<Policy[]>;
|
getAll: (type?: PolicyType, userId?: string) => Promise<Policy[]>;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { ProviderData } from "../models/data/providerData";
|
import { ProviderData } from "../models/data/providerData";
|
||||||
|
|
||||||
import { Provider } from "../models/domain/provider";
|
import { Provider } from "../models/domain/provider";
|
||||||
|
|
||||||
export abstract class ProviderService {
|
export abstract class ProviderService {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import { SendData } from "../models/data/sendData";
|
import { SendData } from "../models/data/sendData";
|
||||||
|
|
||||||
import { EncArrayBuffer } from "../models/domain/encArrayBuffer";
|
import { EncArrayBuffer } from "../models/domain/encArrayBuffer";
|
||||||
import { Send } from "../models/domain/send";
|
import { Send } from "../models/domain/send";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
import { SendView } from "../models/view/sendView";
|
import { SendView } from "../models/view/sendView";
|
||||||
|
|
||||||
export abstract class SendService {
|
export abstract class SendService {
|
||||||
|
@ -3,7 +3,6 @@ import { BehaviorSubject } from "rxjs";
|
|||||||
import { KdfType } from "../enums/kdfType";
|
import { KdfType } from "../enums/kdfType";
|
||||||
import { ThemeType } from "../enums/themeType";
|
import { ThemeType } from "../enums/themeType";
|
||||||
import { UriMatchType } from "../enums/uriMatchType";
|
import { UriMatchType } from "../enums/uriMatchType";
|
||||||
|
|
||||||
import { CipherData } from "../models/data/cipherData";
|
import { CipherData } from "../models/data/cipherData";
|
||||||
import { CollectionData } from "../models/data/collectionData";
|
import { CollectionData } from "../models/data/collectionData";
|
||||||
import { EventData } from "../models/data/eventData";
|
import { EventData } from "../models/data/eventData";
|
||||||
@ -12,7 +11,6 @@ import { OrganizationData } from "../models/data/organizationData";
|
|||||||
import { PolicyData } from "../models/data/policyData";
|
import { PolicyData } from "../models/data/policyData";
|
||||||
import { ProviderData } from "../models/data/providerData";
|
import { ProviderData } from "../models/data/providerData";
|
||||||
import { SendData } from "../models/data/sendData";
|
import { SendData } from "../models/data/sendData";
|
||||||
|
|
||||||
import { Account } from "../models/domain/account";
|
import { Account } from "../models/domain/account";
|
||||||
import { EncString } from "../models/domain/encString";
|
import { EncString } from "../models/domain/encString";
|
||||||
import { EnvironmentUrls } from "../models/domain/environmentUrls";
|
import { EnvironmentUrls } from "../models/domain/environmentUrls";
|
||||||
@ -21,7 +19,6 @@ import { Policy } from "../models/domain/policy";
|
|||||||
import { StorageOptions } from "../models/domain/storageOptions";
|
import { StorageOptions } from "../models/domain/storageOptions";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
import { WindowState } from "../models/domain/windowState";
|
import { WindowState } from "../models/domain/windowState";
|
||||||
|
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { CollectionView } from "../models/view/collectionView";
|
import { CollectionView } from "../models/view/collectionView";
|
||||||
import { FolderView } from "../models/view/folderView";
|
import { FolderView } from "../models/view/folderView";
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { TwoFactorProviderType } from "../enums/twoFactorProviderType";
|
import { TwoFactorProviderType } from "../enums/twoFactorProviderType";
|
||||||
|
|
||||||
import { IdentityTwoFactorResponse } from "../models/response/identityTwoFactorResponse";
|
import { IdentityTwoFactorResponse } from "../models/response/identityTwoFactorResponse";
|
||||||
|
|
||||||
export interface TwoFactorProviderDetails {
|
export interface TwoFactorProviderDetails {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { SecretVerificationRequest } from "../models/request/secretVerificationRequest";
|
import { SecretVerificationRequest } from "../models/request/secretVerificationRequest";
|
||||||
|
|
||||||
import { Verification } from "../types/verification";
|
import { Verification } from "../types/verification";
|
||||||
|
|
||||||
export abstract class UserVerificationService {
|
export abstract class UserVerificationService {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Account } from "../models/domain/account";
|
import { Account } from "../models/domain/account";
|
||||||
import { GlobalState } from "../models/domain/globalState";
|
import { GlobalState } from "../models/domain/globalState";
|
||||||
|
|
||||||
import { AccountFactory } from "./accountFactory";
|
import { AccountFactory } from "./accountFactory";
|
||||||
import { GlobalStateFactory } from "./globalStateFactory";
|
import { GlobalStateFactory } from "./globalStateFactory";
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class AscendoCsvImporter extends BaseImporter implements Importer {
|
export class AscendoCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class AvastCsvImporter extends BaseImporter implements Importer {
|
export class AvastCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class AvastJsonImporter extends BaseImporter implements Importer {
|
export class AvastJsonImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class AviraCsvImporter extends BaseImporter implements Importer {
|
export class AviraCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
import * as papa from "papaparse";
|
import * as papa from "papaparse";
|
||||||
|
|
||||||
import { LogService } from "../abstractions/log.service";
|
import { LogService } from "../abstractions/log.service";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CipherView } from "../models/view/cipherView";
|
|
||||||
import { CollectionView } from "../models/view/collectionView";
|
|
||||||
import { LoginUriView } from "../models/view/loginUriView";
|
|
||||||
|
|
||||||
import { Utils } from "../misc/utils";
|
|
||||||
|
|
||||||
import { FieldView } from "../models/view/fieldView";
|
|
||||||
import { FolderView } from "../models/view/folderView";
|
|
||||||
import { LoginView } from "../models/view/loginView";
|
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
|
||||||
|
|
||||||
import { CipherRepromptType } from "../enums/cipherRepromptType";
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { FieldType } from "../enums/fieldType";
|
import { FieldType } from "../enums/fieldType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { Utils } from "../misc/utils";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
import { CipherView } from "../models/view/cipherView";
|
||||||
|
import { CollectionView } from "../models/view/collectionView";
|
||||||
|
import { FieldView } from "../models/view/fieldView";
|
||||||
|
import { FolderView } from "../models/view/folderView";
|
||||||
|
import { LoginUriView } from "../models/view/loginUriView";
|
||||||
|
import { LoginView } from "../models/view/loginView";
|
||||||
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
import { ConsoleLogService } from "../services/consoleLog.service";
|
import { ConsoleLogService } from "../services/consoleLog.service";
|
||||||
|
|
||||||
export abstract class BaseImporter {
|
export abstract class BaseImporter {
|
||||||
@ -161,7 +154,6 @@ export abstract class BaseImporter {
|
|||||||
if (result.errors != null && result.errors.length > 0) {
|
if (result.errors != null && result.errors.length > 0) {
|
||||||
result.errors.forEach((e) => {
|
result.errors.forEach((e) => {
|
||||||
if (e.row != null) {
|
if (e.row != null) {
|
||||||
// tslint:disable-next-line
|
|
||||||
this.logService.warning("Error parsing row " + e.row + ": " + e.message);
|
this.logService.warning("Error parsing row " + e.row + ": " + e.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CipherView } from "../models/view/cipherView";
|
|
||||||
import { CollectionView } from "../models/view/collectionView";
|
|
||||||
import { FieldView } from "../models/view/fieldView";
|
|
||||||
import { FolderView } from "../models/view/folderView";
|
|
||||||
import { LoginView } from "../models/view/loginView";
|
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
|
||||||
|
|
||||||
import { CipherRepromptType } from "../enums/cipherRepromptType";
|
import { CipherRepromptType } from "../enums/cipherRepromptType";
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { FieldType } from "../enums/fieldType";
|
import { FieldType } from "../enums/fieldType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
import { CipherView } from "../models/view/cipherView";
|
||||||
|
import { CollectionView } from "../models/view/collectionView";
|
||||||
|
import { FieldView } from "../models/view/fieldView";
|
||||||
|
import { LoginView } from "../models/view/loginView";
|
||||||
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class BitwardenCsvImporter extends BaseImporter implements Importer {
|
export class BitwardenCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
@ -63,7 +60,7 @@ export class BitwardenCsvImporter extends BaseImporter implements Importer {
|
|||||||
10
|
10
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// tslint:disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error("Unable to parse reprompt value", e);
|
console.error("Unable to parse reprompt value", e);
|
||||||
cipher.reprompt = CipherRepromptType.None;
|
cipher.reprompt = CipherRepromptType.None;
|
||||||
}
|
}
|
||||||
@ -102,7 +99,7 @@ export class BitwardenCsvImporter extends BaseImporter implements Importer {
|
|||||||
cipher.secureNote = new SecureNoteView();
|
cipher.secureNote = new SecureNoteView();
|
||||||
cipher.secureNote.type = SecureNoteType.Generic;
|
cipher.secureNote.type = SecureNoteType.Generic;
|
||||||
break;
|
break;
|
||||||
default:
|
default: {
|
||||||
cipher.type = CipherType.Login;
|
cipher.type = CipherType.Login;
|
||||||
cipher.login = new LoginView();
|
cipher.login = new LoginView();
|
||||||
cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp);
|
cipher.login.totp = this.getValueOrDefault(value.login_totp || value.totp);
|
||||||
@ -112,6 +109,7 @@ export class BitwardenCsvImporter extends BaseImporter implements Importer {
|
|||||||
cipher.login.uris = this.makeUriArray(uris);
|
cipher.login.uris = this.makeUriArray(uris);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
result.ciphers.push(cipher);
|
result.ciphers.push(cipher);
|
||||||
});
|
});
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CryptoService } from "../abstractions/crypto.service";
|
||||||
import { Importer } from "./importer";
|
import { I18nService } from "../abstractions/i18n.service";
|
||||||
|
|
||||||
import { EncString } from "../models/domain/encString";
|
import { EncString } from "../models/domain/encString";
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CipherWithIds } from "../models/export/cipherWithIds";
|
import { CipherWithIds } from "../models/export/cipherWithIds";
|
||||||
import { CollectionWithId } from "../models/export/collectionWithId";
|
import { CollectionWithId } from "../models/export/collectionWithId";
|
||||||
import { FolderWithId } from "../models/export/folderWithId";
|
import { FolderWithId } from "../models/export/folderWithId";
|
||||||
|
|
||||||
import { CryptoService } from "../abstractions/crypto.service";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { I18nService } from "../abstractions/i18n.service";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class BitwardenJsonImporter extends BaseImporter implements Importer {
|
export class BitwardenJsonImporter extends BaseImporter implements Importer {
|
||||||
private results: any;
|
private results: any;
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { EncString } from "../models/domain/encString";
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CryptoService } from "../abstractions/crypto.service";
|
import { CryptoService } from "../abstractions/crypto.service";
|
||||||
import { I18nService } from "../abstractions/i18n.service";
|
import { I18nService } from "../abstractions/i18n.service";
|
||||||
import { ImportService } from "../abstractions/import.service";
|
import { ImportService } from "../abstractions/import.service";
|
||||||
import { KdfType } from "../enums/kdfType";
|
import { KdfType } from "../enums/kdfType";
|
||||||
|
import { EncString } from "../models/domain/encString";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
import { SymmetricCryptoKey } from "../models/domain/symmetricCryptoKey";
|
||||||
|
|
||||||
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
class BitwardenPasswordProtectedFileFormat {
|
class BitwardenPasswordProtectedFileFormat {
|
||||||
encrypted: boolean;
|
encrypted: boolean;
|
||||||
passwordProtected: boolean;
|
passwordProtected: boolean;
|
||||||
@ -17,7 +16,6 @@ class BitwardenPasswordProtectedFileFormat {
|
|||||||
salt: string;
|
salt: string;
|
||||||
kdfIterations: number;
|
kdfIterations: number;
|
||||||
kdfType: number;
|
kdfType: number;
|
||||||
// tslint:disable-next-line
|
|
||||||
encKeyValidation_DO_NOT_EDIT: string;
|
encKeyValidation_DO_NOT_EDIT: string;
|
||||||
data: string;
|
data: string;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class BlackBerryCsvImporter extends BaseImporter implements Importer {
|
export class BlackBerryCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class BlurCsvImporter extends BaseImporter implements Importer {
|
export class BlurCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
const OfficialProps = ["!group_id", "!group_name", "title", "username", "password", "URL", "id"];
|
const OfficialProps = ["!group_id", "!group_name", "title", "username", "password", "URL", "id"];
|
||||||
|
|
||||||
export class ButtercupCsvImporter extends BaseImporter implements Importer {
|
export class ButtercupCsvImporter extends BaseImporter implements Importer {
|
||||||
@ -25,6 +25,7 @@ export class ButtercupCsvImporter extends BaseImporter implements Importer {
|
|||||||
|
|
||||||
let processingCustomFields = false;
|
let processingCustomFields = false;
|
||||||
for (const prop in value) {
|
for (const prop in value) {
|
||||||
|
// eslint-disable-next-line
|
||||||
if (value.hasOwnProperty(prop)) {
|
if (value.hasOwnProperty(prop)) {
|
||||||
if (!processingCustomFields && OfficialProps.indexOf(prop) === -1) {
|
if (!processingCustomFields && OfficialProps.indexOf(prop) === -1) {
|
||||||
processingCustomFields = true;
|
processingCustomFields = true;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class ChromeCsvImporter extends BaseImporter implements Importer {
|
export class ChromeCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class ClipperzHtmlImporter extends BaseImporter implements Importer {
|
export class ClipperzHtmlImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
@ -31,6 +31,7 @@ export class ClipperzHtmlImporter extends BaseImporter implements Importer {
|
|||||||
|
|
||||||
if (entry.currentVersion != null && entry.currentVersion.fields != null) {
|
if (entry.currentVersion != null && entry.currentVersion.fields != null) {
|
||||||
for (const property in entry.currentVersion.fields) {
|
for (const property in entry.currentVersion.fields) {
|
||||||
|
// eslint-disable-next-line
|
||||||
if (!entry.currentVersion.fields.hasOwnProperty(property)) {
|
if (!entry.currentVersion.fields.hasOwnProperty(property)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -50,7 +51,7 @@ export class ClipperzHtmlImporter extends BaseImporter implements Importer {
|
|||||||
case "url":
|
case "url":
|
||||||
cipher.login.uris = this.makeUriArray(field.value);
|
cipher.login.uris = this.makeUriArray(field.value);
|
||||||
break;
|
break;
|
||||||
default:
|
default: {
|
||||||
const labelLower = field.label != null ? field.label.toLowerCase() : null;
|
const labelLower = field.label != null ? field.label.toLowerCase() : null;
|
||||||
if (
|
if (
|
||||||
cipher.login.password == null &&
|
cipher.login.password == null &&
|
||||||
@ -74,6 +75,7 @@ export class ClipperzHtmlImporter extends BaseImporter implements Importer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.convertToNoteIfNeeded(cipher);
|
this.convertToNoteIfNeeded(cipher);
|
||||||
this.cleanupCipher(cipher);
|
this.cleanupCipher(cipher);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class CodebookCsvImporter extends BaseImporter implements Importer {
|
export class CodebookCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { IdentityView } from "../models/view/identityView";
|
import { IdentityView } from "../models/view/identityView";
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
const HandledResults = new Set([
|
const HandledResults = new Set([
|
||||||
"ADDRESS",
|
"ADDRESS",
|
||||||
@ -53,6 +51,7 @@ export class DashlaneJsonImporter extends BaseImporter implements Importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const key in results) {
|
for (const key in results) {
|
||||||
|
// eslint-disable-next-line
|
||||||
if (results.hasOwnProperty(key) && !HandledResults.has(key)) {
|
if (results.hasOwnProperty(key) && !HandledResults.has(key)) {
|
||||||
this.processNote(results[key], null, "Generic Note");
|
this.processNote(results[key], null, "Generic Note");
|
||||||
}
|
}
|
||||||
@ -161,6 +160,7 @@ export class DashlaneJsonImporter extends BaseImporter implements Importer {
|
|||||||
cipher.name = this.getValueOrDefault(obj[nameProperty]);
|
cipher.name = this.getValueOrDefault(obj[nameProperty]);
|
||||||
}
|
}
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
|
// eslint-disable-next-line
|
||||||
if (obj.hasOwnProperty(key) && key !== nameProperty) {
|
if (obj.hasOwnProperty(key) && key !== nameProperty) {
|
||||||
this.processKvp(cipher, key, obj[key].toString());
|
this.processKvp(cipher, key, obj[key].toString());
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class EncryptrCsvImporter extends BaseImporter implements Importer {
|
export class EncryptrCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class EnpassCsvImporter extends BaseImporter implements Importer {
|
export class EnpassCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
import { FieldType } from "../enums/fieldType";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { FolderView } from "../models/view/folderView";
|
import { FolderView } from "../models/view/folderView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { FieldType } from "../enums/fieldType";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class EnpassJsonImporter extends BaseImporter implements Importer {
|
export class EnpassJsonImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class FirefoxCsvImporter extends BaseImporter implements Importer {
|
export class FirefoxCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class FSecureFskImporter extends BaseImporter implements Importer {
|
export class FSecureFskImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
@ -17,6 +15,7 @@ export class FSecureFskImporter extends BaseImporter implements Importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const key in results.data) {
|
for (const key in results.data) {
|
||||||
|
// eslint-disable-next-line
|
||||||
if (!results.data.hasOwnProperty(key)) {
|
if (!results.data.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class GnomeJsonImporter extends BaseImporter implements Importer {
|
export class GnomeJsonImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
@ -14,7 +14,7 @@ export class GnomeJsonImporter extends BaseImporter implements Importer {
|
|||||||
|
|
||||||
for (const keyRing in results) {
|
for (const keyRing in results) {
|
||||||
if (
|
if (
|
||||||
!results.hasOwnProperty(keyRing) ||
|
!results.hasOwnProperty(keyRing) || // eslint-disable-line
|
||||||
this.isNullOrWhitespace(keyRing) ||
|
this.isNullOrWhitespace(keyRing) ||
|
||||||
results[keyRing].length === 0
|
results[keyRing].length === 0
|
||||||
) {
|
) {
|
||||||
@ -45,7 +45,7 @@ export class GnomeJsonImporter extends BaseImporter implements Importer {
|
|||||||
: null;
|
: null;
|
||||||
for (const attr in value.attributes) {
|
for (const attr in value.attributes) {
|
||||||
if (
|
if (
|
||||||
!value.attributes.hasOwnProperty(attr) ||
|
!value.attributes.hasOwnProperty(attr) || // eslint-disable-line
|
||||||
attr === "username_value" ||
|
attr === "username_value" ||
|
||||||
attr === "xdg:schema"
|
attr === "xdg:schema"
|
||||||
) {
|
) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
const NotesHeader = "Notes\n\n";
|
const NotesHeader = "Notes\n\n";
|
||||||
const ApplicationsHeader = "Applications\n\n";
|
const ApplicationsHeader = "Applications\n\n";
|
||||||
const WebsitesHeader = "Websites\n\n";
|
const WebsitesHeader = "Websites\n\n";
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
|
import { FieldType } from "../enums/fieldType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
import { FolderView } from "../models/view/folderView";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { FieldType } from "../enums/fieldType";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { FolderView } from "../models/view/folderView";
|
|
||||||
|
|
||||||
export class KeePass2XmlImporter extends BaseImporter implements Importer {
|
export class KeePass2XmlImporter extends BaseImporter implements Importer {
|
||||||
result = new ImportResult();
|
result = new ImportResult();
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class KeePassXCsvImporter extends BaseImporter implements Importer {
|
export class KeePassXCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
|
import { ImportResult } from "../../models/domain/importResult";
|
||||||
import { BaseImporter } from "../baseImporter";
|
import { BaseImporter } from "../baseImporter";
|
||||||
import { Importer } from "../importer";
|
import { Importer } from "../importer";
|
||||||
|
|
||||||
import { ImportResult } from "../../models/domain/importResult";
|
|
||||||
|
|
||||||
import { FolderView } from "../../models/view/folderView";
|
|
||||||
|
|
||||||
export class KeeperCsvImporter extends BaseImporter implements Importer {
|
export class KeeperCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
|
import { ImportResult } from "../../models/domain/importResult";
|
||||||
import { BaseImporter } from "../baseImporter";
|
import { BaseImporter } from "../baseImporter";
|
||||||
import { Importer } from "../importer";
|
import { Importer } from "../importer";
|
||||||
|
|
||||||
import { ImportResult } from "../../models/domain/importResult";
|
|
||||||
|
|
||||||
import { KeeperJsonExport, RecordsEntity } from "./types/keeperJsonTypes";
|
import { KeeperJsonExport, RecordsEntity } from "./types/keeperJsonTypes";
|
||||||
|
|
||||||
export class KeeperJsonImporter extends BaseImporter implements Importer {
|
export class KeeperJsonImporter extends BaseImporter implements Importer {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { FolderView } from "../models/view/folderView";
|
import { FolderView } from "../models/view/folderView";
|
||||||
@ -10,8 +8,8 @@ import { IdentityView } from "../models/view/identityView";
|
|||||||
import { LoginView } from "../models/view/loginView";
|
import { LoginView } from "../models/view/loginView";
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class LastPassCsvImporter extends BaseImporter implements Importer {
|
export class LastPassCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
@ -22,11 +20,12 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
|||||||
return Promise.resolve(result);
|
return Promise.resolve(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
results.forEach((value, index) => {
|
results.forEach((value) => {
|
||||||
const cipherIndex = result.ciphers.length;
|
const cipherIndex = result.ciphers.length;
|
||||||
let folderIndex = result.folders.length;
|
let folderIndex = result.folders.length;
|
||||||
let grouping = value.grouping;
|
let grouping = value.grouping;
|
||||||
if (grouping != null) {
|
if (grouping != null) {
|
||||||
|
// eslint-disable-next-line
|
||||||
grouping = grouping.replace(/\\/g, "/").replace(/[\x00-\x1F\x7F-\x9F]/g, "");
|
grouping = grouping.replace(/\\/g, "/").replace(/[\x00-\x1F\x7F-\x9F]/g, "");
|
||||||
}
|
}
|
||||||
const hasFolder = this.getValueOrDefault(grouping, "(none)") !== "(none)";
|
const hasFolder = this.getValueOrDefault(grouping, "(none)") !== "(none)";
|
||||||
@ -90,6 +89,7 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
|||||||
|
|
||||||
private buildBaseCipher(value: any) {
|
private buildBaseCipher(value: any) {
|
||||||
const cipher = new CipherView();
|
const cipher = new CipherView();
|
||||||
|
// eslint-disable-next-line
|
||||||
if (value.hasOwnProperty("profilename") && value.hasOwnProperty("profilelanguage")) {
|
if (value.hasOwnProperty("profilename") && value.hasOwnProperty("profilelanguage")) {
|
||||||
// form fill
|
// form fill
|
||||||
cipher.favorite = false;
|
cipher.favorite = false;
|
||||||
@ -272,6 +272,7 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
|||||||
cipher.notes = val;
|
cipher.notes = val;
|
||||||
}
|
}
|
||||||
processingNotes = true;
|
processingNotes = true;
|
||||||
|
// eslint-disable-next-line
|
||||||
} else if (map.hasOwnProperty(key)) {
|
} else if (map.hasOwnProperty(key)) {
|
||||||
dataObj[map[key]] = val;
|
dataObj[map[key]] = val;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class LogMeOnceCsvImporter extends BaseImporter implements Importer {
|
export class LogMeOnceCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { BaseImporter } from "./baseImporter";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { Importer } from "./importer";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
export class MeldiumCsvImporter extends BaseImporter implements Importer {
|
export class MeldiumCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class MSecureCsvImporter extends BaseImporter implements Importer {
|
export class MSecureCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
const result = new ImportResult();
|
const result = new ImportResult();
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
|
||||||
import { Importer } from "./importer";
|
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
import { CardView } from "../models/view/cardView";
|
import { CardView } from "../models/view/cardView";
|
||||||
import { IdentityView } from "../models/view/identityView";
|
import { IdentityView } from "../models/view/identityView";
|
||||||
import { SecureNoteView } from "../models/view/secureNoteView";
|
import { SecureNoteView } from "../models/view/secureNoteView";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { BaseImporter } from "./baseImporter";
|
||||||
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
export class MykiCsvImporter extends BaseImporter implements Importer {
|
export class MykiCsvImporter extends BaseImporter implements Importer {
|
||||||
parse(data: string): Promise<ImportResult> {
|
parse(data: string): Promise<ImportResult> {
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import { BaseImporter } from "./baseImporter";
|
import { CipherType } from "../enums/cipherType";
|
||||||
import { Importer } from "./importer";
|
import { SecureNoteType } from "../enums/secureNoteType";
|
||||||
|
|
||||||
import { ImportResult } from "../models/domain/importResult";
|
import { ImportResult } from "../models/domain/importResult";
|
||||||
|
|
||||||
import { CipherView } from "../models/view/cipherView";
|
import { CipherView } from "../models/view/cipherView";
|
||||||
import { LoginView } from "../models/view/loginView";
|
import { LoginView } from "../models/view/loginView";
|
||||||
|
|
||||||
import { CipherType } from "../enums/cipherType";
|
import { BaseImporter } from "./baseImporter";
|
||||||
import { SecureNoteType } from "../enums/secureNoteType";
|
import { Importer } from "./importer";
|
||||||
|
|
||||||
type nodePassCsvParsed = {
|
type nodePassCsvParsed = {
|
||||||
name: string;
|
name: string;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user