* Add StateDefinition
Add a class for encapsulation information about state
this will often be for a domain but creations of this will
exist outside of a specific domain, hence just the name State.
* Add KeyDefinition
This adds a type that extends state definition into another sub-key
and forces creators to define the data that will be stored and how
to read the data that they expect to be stored.
* Add key-builders helper functions
Adds to function to help building keys for both keys scoped
to a specific user and for keys scoped to global storage.
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
* Add updates$ stream to existing storageServices
Original commit by Matt: 823d9546fe
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
* Add fromChromeEvent helper
Create a helper that creats an Observable from a chrome event
and removes the listener when the subscription is completed.
* Implement `updates$` property for chrome storage
Use fromChromeEvent to create an observable from chrome
event and map that into our expected shape.
* Add GlobalState Abstractions
* Add UserState Abstractions
* Add Default Implementations of User/Global state
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
* Add Barrel File for state
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
* Fix ChromeStorageServices
* Rework fromChromeEvent
Rework fromChromeEvent so we have to lie to TS less and
remove unneeded generics. I did this by caring less about
the function and more about the parameters only.
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
* Fix UserStateProvider Test
* Add Inner Mock & Assert Calls
* Update Tests to use new keys
Use different key format
* Prefer returns over mutations in update
* Update Tests
* Address PR Feedback
* Be stricter with userId parameter
* Add Better Way To Determine if it was a remove
* Fix Web & Browser Storage Services
* Fix Desktop & CLI Storage Services
* Fix Test Storage Service
* Use createKey Helper
* Prefer implement to extending
* Determine storage location in providers
* Export default providers publicly
* Fix user state tests
* Name tests
* Fix CLI
* Prefer Implement In Chrome Storage
* Remove Secure Storage Option
Also throw an exception for subscribes to the secure storage observable.
* Update apps/browser/src/platform/browser/from-chrome-event.ts
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Enforce state module barrel file
* Fix Linting Error
* Allow state module import from other modules
* Globally Unregister fromChromeEvent Listeners
Changed fromChromeEvent to add its listeners through the BrowserApi, so that
they will be unregistered when safari closes.
* Test default global state
* Use Proper Casing in Parameter
* Address Feedback
* Update libs/common/src/platform/state/key-definition.ts
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Add `buildCacheKey` Method
* Fix lint errors
* Add Comment
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Use Generic in callback parameter
* Refactor Out DerivedStateDefinition
* Persist Listener Return Type
* Add Ticket Link
---------
Co-authored-by: Matt Gibson <MGibson1@users.noreply.github.com>
Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Split up import/export into separate modules
* Fix routing and apply PR feedback
* Renamed OrganizationExport exports to OrganizationVaultExport
* Make import dialogs standalone and move them to libs/importer
* Make import.component re-usable
- Move functionality which was previously present on the org-import.component into import.component
- Move import.component into libs/importer
Make import.component standalone
Create import-web.component to represent Web UI
Fix module imports and routing
Remove unused org-import-files
* Renamed filenames according to export rename
* Make ImportWebComponent standalone, simplify routing
* Pass organizationId as Input to ImportComponent
* use formLoading and formDisabled outputs
* Emit an event when the import succeeds
Remove Angular router from base-component as other clients might not have routing (i.e. desktop)
Move logic that happened on web successful import into the import-web.component
* fix table themes on desktop & browser
* fix fileSelector button styles
* update selectors to use tools prefix; remove unused selectors
* Wall off UI components in libs/importer
Create barrel-file for libs/importer/components
Remove components and dialog exports from libs/importer/index.ts
Extend libs/shared/tsconfig.libs.json to include @bitwarden/importer/ui -> libs/importer/components
Extend apps/web/tsconfig.ts to include @bitwarden/importer/ui
Update all usages
* Rename @bitwarden/importer to @bitwarden/importer/core
Create more barrel files in libs/importer/*
Update imports within libs/importer
Extend tsconfig files
Update imports in web, desktop, browser and cli
* Lazy-load the ImportWebComponent via both routes
* Use SharedModule as import in import-web.component
* File selector should be displayed as secondary
* Use bitSubmit to override submit preventDefault (#6607)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
---------
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: William Martin <contact@willmartian.com>
* Create and register new libs/exporter
Create package.json
Create tsconfig
Create jest.config
Extend shared and root tsconfig and jest.configs
Register with eslint
* Migrate exportService to libs/exporter
Move exportService (abstraction and impl) into libs/exporter
Refactored exportService to be split into vault-export and event-export
Created barrel-files for both exports
Moved export.service.spec.ts into vault-export
Created an export-helper, which helps build the filename (extract method refactor from ExportService)
* Move components in libs/angular into tools-subfolder
Moved components
Updated imports in jslib-services.module and jslib.module
* Register libs/exporter with browser and fix imports
Move export.component into tools-subfolder
* Register libs/exporter with cli and fix imports
Move export.command into tools-subfolder
* Register libs/exporter with desktop and fix imports
Move export.component into tools-subfolder
* Move export models to libs/exporter
* Update web imports
* Update package-lock.json
* Move export models back as it would create circular dependency
Reponse models in common rely on export models which are in libs/exporter, which relies on common
* Fix up web for event-export
* Update CODEOWNERS
* Add export-models to team-tools-dev
* Simplify domain import
* Moving EventExport into web
* Create and register new libs/importer
Create package.json
Create tsconfig
Create jest.config
Extend shared and root tsconfig and jest.configs
Register with eslint
* Move importer-related files to libs/importer
* Move importer-spec-related files to libs/importer
Move import.service.spec
* Update package-lock.json
* Set CODEOWNERS for new libs/importer
* Register libs/importer with cli and fix imports
* Register libs/importer with web and fix imports
* Move importOption into models
Rename importOptions to import-options
* Fix linting issues after updating prettier
* Only expose necessary files from libs/importer
Fix tsconfig files
- Removes the trailing /index on imports in web/cli
As the spec-files no longer can access the internals via @bitwarden/importer they import by path (../src/importers)
* Add barrel files to vendors with more than one importer
* Add item decryption to encryptService
* Create multithreadEncryptService subclass to handle web workers
* Create encryption web worker
* Refactor cipherService to use new interface
* Update dependencies
* Create base jest.config file
* Fix various tests that were broken
* Add maxWorkers to jest config
* Undo change to testEnvironment
* Enable tsconfig.spec.json