mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
* [EC-16] Cleanup RxJS linting problems * [EC-16] Update Group tab to use table component and show collections. * [EC-16] Extract interface from GroupResponse and use it in the view * [EC-16] Remove heading underline * [EC-16] Cleanup i18n * [EC-16] More i18n cleanup * [EC-16] Fix bulk group request type name * [EC-16] Rename group details type * [EC-86] Clear collectionMap before populating it with new collections * [EC-86] Update initialization/loading logic to make better use of the Observable pattern * [EC-86] Make table cells use a pointer cursor * [EC-86] Use bitIconButton for row menu triggers * [EC-86] Refactor GroupDetailsRow interface to wrap GroupDetailsResponse. Remove response model interfaces. Cleanup GroupsComponent. * [EC-86] Add bit-badge-list component and tweak BadgeModule to support both the component and directive. Update mockI18nService to support templated strings. * [EC-86] Cleanup badge color and bitIconButton classes * [EC-86] Cleanup more styles * [EC-86] Add GroupApiService Add a new GroupApiService to replace Group Api calls in the ApiService. * [EC-86] Revisions for badge-list implementation. - Remove `| null` for maxItems according to ADR-0014 - Remove custom setter for items - Use ngOnChanges to update filteredItems - Fix sr-only tailwind class and show screen reader comma after last item if truncated. * [EC-86] Refactor badge-list module/component - Move the badge list component to its own module. - Extract badge list stories from badge stories. - Cleanup bade stories and module after refactor. * [EC-86] Refactor/rename GroupApiService - Re-name GroupApiService to GroupService as there is no need for a separate Api service (no sync or local data for admin services) - Add GroupView for use in the GroupService instead of raw API models - Update views to use GroupView instead of raw GroupResponse models * [EC-86] Refactor group API request models - Move organizationGroupBulkRequest to group requests folder - Fix relative imports in GroupService * [EC-86] Fix linting errors * Fix tab item text color Tab item text color broke after a merge from master and needs a fix to account for bootstrap styles in Web. * [EC-86] Rename new files using kebab-case * [EC-86] Fix group view file name * [EC-86] Fix group request/response file names * [EC-86] Cleanup badge stories per review suggestions * [EC-86] Use inline-flex for badge list container * [EC-86] Move GroupService and Views to Web org module - Move GroupService and GroupServiceAbstraction to Organization Module - Add GroupService provider to Organization Module - Move collection-add-edit.component, user-groups.component, group-add-edit.component, and groups.component into Organization Module as they now depend on GroupService - Remove moved components from Loose Component module * [EC-86] Fix Group table search Adds the id and name properties to GroupDetailsRow to support using the searchPipe (which cannot access nested values such as details.name for filtering). * [EC-86] Fix badge story controls * [EC-87] Edit Group Dialog (#3651) * [EC-87] Update the edit dialog to use content tabs * [EC-87] WIP FormListSelection abstract controller * [EC-87] WIP FormListSelection for members and collections * [EC-87] More WIP on FormListSelection * [EC-87] WIP Working FormSelectionList with initial value support * [EC-87] WIP SelectionList without FormControls and with i18n support for sorting * [EC-87] Final sorted SelectionList with FormArray support * [EC-87] Extract and document FormSelectionList * [EC-87] Functional edit group modal * [EC-87] Remove button icon padding for bitButton directives * [EC-87] Use new disablePadding attribute for Dialog component * [EC-87] Some more cleanup and finetuning * [EC-87] Move enum declaration to top * [EC-87] Remove inline style from access selector * [EC-87] Move Group components into Organization Module * [EC-87] Add MultiSelectModule to Shared Web module * [EC-87] Integrate AccessSelector component in GroupAddEdit modal - Remove duplicate permission / selection readonly helpers from GroupAddEdit component - Use access item views/values for collection and member lists - Replace access selector HTMl with the AccessSelector component * [EC-87] Update Group collections column to open Collection tab * [EC-87] Remove old FormSelectionList file * [EC-87] Fix missed file import changes after merge * [EC-87] Remove GroupAddEditComponent modal service registration Groups component is now using the DialogService which does not require explicit registration for lazy loaded components. * [EC-87] Use injected DIALOG_DATA for GroupAddEdit component - Add types for the GroupAddEdit dialog params, result, and tab indices - Add strongly typed helper method to open GroupAddEdit dialogs - Remove @Input()/@Output() properties. Replaced with the injected DIALOG_DATA params instead - Use dialogRef.close() and result type instead of event emitters * [EC-87] Rename collection tab type to collections * [EC-87] Refactor postGroup() and putGroup() from ApiService - Move postGroup() and putGroup() methods to GroupService - Remove postGroup() and putGroup() from ApiService - Move GroupResponse and GroupRequest into Web (from lib/common) * [EC-87] Remove required attribute * [EC-87] Use PascalCase for template Enums * [EC-87] Use group modal tab enum in template * [EC-87] Convert dialog result to promise * [EC-87] Refactor dialog positionStrategy - Add .top() to position strategy to allow clicking the backdrop to close the dialog - Move the positionStrategy option into the openGroupAddEditDialog helper * [EC-87] Remove [preserveContent] from tab group * [EC-87] Use new CL async actions - Update handlers to be arrow-functions - Remove old form and delete promises - Use [bitSubmit] directive on form - Use bitFormButton directive and [bitAction] for submit and delete buttons - Remove delete/spinner bwi icons as they are handled by the new async directives * [EC-87] Introduce CollectionAccessSelectionView Use a new view to replace the SelectionReadonlyResponse/Request classes. * [EC-87] Use new access selection view in GroupView - Change the collections type - Add members list to make the view more complete - Update the static fromResponse helper to properly map the GroupDetailsResponse to the new access selection view - Update access selector helpers to use new access selection view instead of response/request models * [EC-87] Update GroupService to have a single save() method that accepts a GroupView - Add save() method that checks for existing group id to determine which API method to use - Make post/put group methods private * [EC-87] Utilize the new save() method in the group modal * [EC-87] Use observables for fetching data - Introduce 3 observables for collections, members, and group details - Combine and subscribe to those observables in ngOnInit - Add destroy$ subject - Inject changeDetectorRef to handle quirk of patching the AccessSelector value before available items are set
600 lines
24 KiB
TypeScript
600 lines
24 KiB
TypeScript
import { Injector, LOCALE_ID, NgModule } from "@angular/core";
|
|
|
|
import { AccountApiService as AccountApiServiceAbstraction } from "@bitwarden/common/abstractions/account/account-api.service";
|
|
import {
|
|
AccountService as AccountServiceAbstraction,
|
|
InternalAccountService,
|
|
} from "@bitwarden/common/abstractions/account/account.service";
|
|
import { AnonymousHubService as AnonymousHubServiceAbstraction } from "@bitwarden/common/abstractions/anonymousHub.service";
|
|
import { ApiService as ApiServiceAbstraction } from "@bitwarden/common/abstractions/api.service";
|
|
import { AppIdService as AppIdServiceAbstraction } from "@bitwarden/common/abstractions/appId.service";
|
|
import { AuditService as AuditServiceAbstraction } from "@bitwarden/common/abstractions/audit.service";
|
|
import { AuthService as AuthServiceAbstraction } from "@bitwarden/common/abstractions/auth.service";
|
|
import { BroadcasterService as BroadcasterServiceAbstraction } from "@bitwarden/common/abstractions/broadcaster.service";
|
|
import { CipherService as CipherServiceAbstraction } from "@bitwarden/common/abstractions/cipher.service";
|
|
import { CollectionService as CollectionServiceAbstraction } from "@bitwarden/common/abstractions/collection.service";
|
|
import { ConfigApiServiceAbstraction } from "@bitwarden/common/abstractions/config/config-api.service.abstraction";
|
|
import { ConfigServiceAbstraction } from "@bitwarden/common/abstractions/config/config.service.abstraction";
|
|
import { CryptoService as CryptoServiceAbstraction } from "@bitwarden/common/abstractions/crypto.service";
|
|
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from "@bitwarden/common/abstractions/cryptoFunction.service";
|
|
import { EncryptService } from "@bitwarden/common/abstractions/encrypt.service";
|
|
import { EnvironmentService as EnvironmentServiceAbstraction } from "@bitwarden/common/abstractions/environment.service";
|
|
import { EventService as EventServiceAbstraction } from "@bitwarden/common/abstractions/event.service";
|
|
import { ExportService as ExportServiceAbstraction } from "@bitwarden/common/abstractions/export.service";
|
|
import { FileUploadService as FileUploadServiceAbstraction } from "@bitwarden/common/abstractions/fileUpload.service";
|
|
import { FolderApiServiceAbstraction } from "@bitwarden/common/abstractions/folder/folder-api.service.abstraction";
|
|
import {
|
|
FolderService as FolderServiceAbstraction,
|
|
InternalFolderService,
|
|
} from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
|
|
import { FormValidationErrorsService as FormValidationErrorsServiceAbstraction } from "@bitwarden/common/abstractions/formValidationErrors.service";
|
|
import { I18nService as I18nServiceAbstraction } from "@bitwarden/common/abstractions/i18n.service";
|
|
import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarden/common/abstractions/keyConnector.service";
|
|
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|
import { LoginService as LoginServiceAbstraction } from "@bitwarden/common/abstractions/login.service";
|
|
import { MessagingService as MessagingServiceAbstraction } from "@bitwarden/common/abstractions/messaging.service";
|
|
import { NotificationsService as NotificationsServiceAbstraction } from "@bitwarden/common/abstractions/notifications.service";
|
|
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/abstractions/organization/organization-api.service.abstraction";
|
|
import { OrganizationService as OrganizationServiceAbstraction } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
|
|
import { PasswordGenerationService as PasswordGenerationServiceAbstraction } from "@bitwarden/common/abstractions/passwordGeneration.service";
|
|
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "@bitwarden/common/abstractions/passwordReprompt.service";
|
|
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/abstractions/platformUtils.service";
|
|
import { PolicyApiServiceAbstraction } from "@bitwarden/common/abstractions/policy/policy-api.service.abstraction";
|
|
import {
|
|
InternalPolicyService,
|
|
PolicyService as PolicyServiceAbstraction,
|
|
} from "@bitwarden/common/abstractions/policy/policy.service.abstraction";
|
|
import { ProviderService as ProviderServiceAbstraction } from "@bitwarden/common/abstractions/provider.service";
|
|
import { SearchService as SearchServiceAbstraction } from "@bitwarden/common/abstractions/search.service";
|
|
import { SendService as SendServiceAbstraction } from "@bitwarden/common/abstractions/send.service";
|
|
import { SettingsService as SettingsServiceAbstraction } from "@bitwarden/common/abstractions/settings.service";
|
|
import { StateService as StateServiceAbstraction } from "@bitwarden/common/abstractions/state.service";
|
|
import { StateMigrationService as StateMigrationServiceAbstraction } from "@bitwarden/common/abstractions/stateMigration.service";
|
|
import { AbstractStorageService } from "@bitwarden/common/abstractions/storage.service";
|
|
import { SyncService as SyncServiceAbstraction } from "@bitwarden/common/abstractions/sync/sync.service.abstraction";
|
|
import { SyncNotifierService as SyncNotifierServiceAbstraction } from "@bitwarden/common/abstractions/sync/syncNotifier.service.abstraction";
|
|
import { TokenService as TokenServiceAbstraction } from "@bitwarden/common/abstractions/token.service";
|
|
import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/abstractions/totp.service";
|
|
import { TwoFactorService as TwoFactorServiceAbstraction } from "@bitwarden/common/abstractions/twoFactor.service";
|
|
import { UserVerificationApiServiceAbstraction } from "@bitwarden/common/abstractions/userVerification/userVerification-api.service.abstraction";
|
|
import { UserVerificationService as UserVerificationServiceAbstraction } from "@bitwarden/common/abstractions/userVerification/userVerification.service.abstraction";
|
|
import { UsernameGenerationService as UsernameGenerationServiceAbstraction } from "@bitwarden/common/abstractions/usernameGeneration.service";
|
|
import { ValidationService as ValidationServiceAbstraction } from "@bitwarden/common/abstractions/validation.service";
|
|
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "@bitwarden/common/abstractions/vaultTimeout/vaultTimeout.service";
|
|
import { VaultTimeoutSettingsService as VaultTimeoutSettingsServiceAbstraction } from "@bitwarden/common/abstractions/vaultTimeout/vaultTimeoutSettings.service";
|
|
import { StateFactory } from "@bitwarden/common/factories/stateFactory";
|
|
import { flagEnabled } from "@bitwarden/common/misc/flags";
|
|
import { Account } from "@bitwarden/common/models/domain/account";
|
|
import { GlobalState } from "@bitwarden/common/models/domain/global-state";
|
|
import { AccountApiServiceImplementation } from "@bitwarden/common/services/account/account-api.service";
|
|
import { AccountServiceImplementation } from "@bitwarden/common/services/account/account.service";
|
|
import { AnonymousHubService } from "@bitwarden/common/services/anonymousHub.service";
|
|
import { ApiService } from "@bitwarden/common/services/api.service";
|
|
import { AppIdService } from "@bitwarden/common/services/appId.service";
|
|
import { AuditService } from "@bitwarden/common/services/audit.service";
|
|
import { AuthService } from "@bitwarden/common/services/auth.service";
|
|
import { CipherService } from "@bitwarden/common/services/cipher.service";
|
|
import { CollectionService } from "@bitwarden/common/services/collection.service";
|
|
import { ConfigApiService } from "@bitwarden/common/services/config/config-api.service";
|
|
import { ConfigService } from "@bitwarden/common/services/config/config.service";
|
|
import { ConsoleLogService } from "@bitwarden/common/services/consoleLog.service";
|
|
import { CryptoService } from "@bitwarden/common/services/crypto.service";
|
|
import { EncryptServiceImplementation } from "@bitwarden/common/services/cryptography/encrypt.service.implementation";
|
|
import { MultithreadEncryptServiceImplementation } from "@bitwarden/common/services/cryptography/multithread-encrypt.service.implementation";
|
|
import { EnvironmentService } from "@bitwarden/common/services/environment.service";
|
|
import { EventService } from "@bitwarden/common/services/event.service";
|
|
import { ExportService } from "@bitwarden/common/services/export.service";
|
|
import { FileUploadService } from "@bitwarden/common/services/fileUpload.service";
|
|
import { FolderApiService } from "@bitwarden/common/services/folder/folder-api.service";
|
|
import { FolderService } from "@bitwarden/common/services/folder/folder.service";
|
|
import { FormValidationErrorsService } from "@bitwarden/common/services/formValidationErrors.service";
|
|
import { KeyConnectorService } from "@bitwarden/common/services/keyConnector.service";
|
|
import { LoginService } from "@bitwarden/common/services/login.service";
|
|
import { NotificationsService } from "@bitwarden/common/services/notifications.service";
|
|
import { OrganizationApiService } from "@bitwarden/common/services/organization/organization-api.service";
|
|
import { OrganizationService } from "@bitwarden/common/services/organization/organization.service";
|
|
import { PasswordGenerationService } from "@bitwarden/common/services/passwordGeneration.service";
|
|
import { PolicyApiService } from "@bitwarden/common/services/policy/policy-api.service";
|
|
import { PolicyService } from "@bitwarden/common/services/policy/policy.service";
|
|
import { ProviderService } from "@bitwarden/common/services/provider.service";
|
|
import { SearchService } from "@bitwarden/common/services/search.service";
|
|
import { SendService } from "@bitwarden/common/services/send.service";
|
|
import { SettingsService } from "@bitwarden/common/services/settings.service";
|
|
import { StateService } from "@bitwarden/common/services/state.service";
|
|
import { StateMigrationService } from "@bitwarden/common/services/stateMigration.service";
|
|
import { SyncService } from "@bitwarden/common/services/sync/sync.service";
|
|
import { SyncNotifierService } from "@bitwarden/common/services/sync/syncNotifier.service";
|
|
import { TokenService } from "@bitwarden/common/services/token.service";
|
|
import { TotpService } from "@bitwarden/common/services/totp.service";
|
|
import { TwoFactorService } from "@bitwarden/common/services/twoFactor.service";
|
|
import { UserVerificationApiService } from "@bitwarden/common/services/userVerification/userVerification-api.service";
|
|
import { UserVerificationService } from "@bitwarden/common/services/userVerification/userVerification.service";
|
|
import { UsernameGenerationService } from "@bitwarden/common/services/usernameGeneration.service";
|
|
import { ValidationService } from "@bitwarden/common/services/validation.service";
|
|
import { VaultTimeoutService } from "@bitwarden/common/services/vaultTimeout/vaultTimeout.service";
|
|
import { VaultTimeoutSettingsService } from "@bitwarden/common/services/vaultTimeout/vaultTimeoutSettings.service";
|
|
import { WebCryptoFunctionService } from "@bitwarden/common/services/webCryptoFunction.service";
|
|
|
|
import { AuthGuard } from "../guards/auth.guard";
|
|
import { LockGuard } from "../guards/lock.guard";
|
|
import { UnauthGuard } from "../guards/unauth.guard";
|
|
|
|
import { BroadcasterService } from "./broadcaster.service";
|
|
import {
|
|
LOCALES_DIRECTORY,
|
|
LOCKED_CALLBACK,
|
|
LOG_MAC_FAILURES,
|
|
LOGOUT_CALLBACK,
|
|
MEMORY_STORAGE,
|
|
SECURE_STORAGE,
|
|
STATE_FACTORY,
|
|
STATE_SERVICE_USE_CACHE,
|
|
SYSTEM_LANGUAGE,
|
|
WINDOW,
|
|
} from "./injection-tokens";
|
|
import { ModalService } from "./modal.service";
|
|
import { PasswordRepromptService } from "./passwordReprompt.service";
|
|
import { ThemingService } from "./theming/theming.service";
|
|
import { AbstractThemingService } from "./theming/theming.service.abstraction";
|
|
|
|
@NgModule({
|
|
declarations: [],
|
|
providers: [
|
|
AuthGuard,
|
|
UnauthGuard,
|
|
LockGuard,
|
|
ModalService,
|
|
{ provide: WINDOW, useValue: window },
|
|
{
|
|
provide: LOCALE_ID,
|
|
useFactory: (i18nService: I18nServiceAbstraction) => i18nService.translationLocale,
|
|
deps: [I18nServiceAbstraction],
|
|
},
|
|
{
|
|
provide: LOCALES_DIRECTORY,
|
|
useValue: "./locales",
|
|
},
|
|
{
|
|
provide: SYSTEM_LANGUAGE,
|
|
useFactory: (window: Window) => window.navigator.language,
|
|
deps: [WINDOW],
|
|
},
|
|
{
|
|
provide: STATE_FACTORY,
|
|
useValue: new StateFactory(GlobalState, Account),
|
|
},
|
|
{
|
|
provide: STATE_SERVICE_USE_CACHE,
|
|
useValue: true,
|
|
},
|
|
{
|
|
provide: LOGOUT_CALLBACK,
|
|
useFactory:
|
|
(messagingService: MessagingServiceAbstraction) => (expired: boolean, userId?: string) =>
|
|
messagingService.send("logout", { expired: expired, userId: userId }),
|
|
deps: [MessagingServiceAbstraction],
|
|
},
|
|
{
|
|
provide: LOCKED_CALLBACK,
|
|
useValue: null,
|
|
},
|
|
{
|
|
provide: LOG_MAC_FAILURES,
|
|
useValue: true,
|
|
},
|
|
{
|
|
provide: AppIdServiceAbstraction,
|
|
useClass: AppIdService,
|
|
deps: [AbstractStorageService],
|
|
},
|
|
{
|
|
provide: AuditServiceAbstraction,
|
|
useClass: AuditService,
|
|
deps: [CryptoFunctionServiceAbstraction, ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: AuthServiceAbstraction,
|
|
useClass: AuthService,
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
TokenServiceAbstraction,
|
|
AppIdServiceAbstraction,
|
|
PlatformUtilsServiceAbstraction,
|
|
MessagingServiceAbstraction,
|
|
LogService,
|
|
KeyConnectorServiceAbstraction,
|
|
EnvironmentServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
TwoFactorServiceAbstraction,
|
|
I18nServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: CipherServiceAbstraction,
|
|
useFactory: (
|
|
cryptoService: CryptoServiceAbstraction,
|
|
settingsService: SettingsServiceAbstraction,
|
|
apiService: ApiServiceAbstraction,
|
|
fileUploadService: FileUploadServiceAbstraction,
|
|
i18nService: I18nServiceAbstraction,
|
|
injector: Injector,
|
|
logService: LogService,
|
|
stateService: StateServiceAbstraction,
|
|
encryptService: EncryptService
|
|
) =>
|
|
new CipherService(
|
|
cryptoService,
|
|
settingsService,
|
|
apiService,
|
|
fileUploadService,
|
|
i18nService,
|
|
() => injector.get(SearchServiceAbstraction),
|
|
logService,
|
|
stateService,
|
|
encryptService
|
|
),
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
SettingsServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
FileUploadServiceAbstraction,
|
|
I18nServiceAbstraction,
|
|
Injector, // TODO: Get rid of this circular dependency!
|
|
LogService,
|
|
StateServiceAbstraction,
|
|
EncryptService,
|
|
],
|
|
},
|
|
{
|
|
provide: FolderServiceAbstraction,
|
|
useClass: FolderService,
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
I18nServiceAbstraction,
|
|
CipherServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: InternalFolderService,
|
|
useExisting: FolderServiceAbstraction,
|
|
},
|
|
{
|
|
provide: FolderApiServiceAbstraction,
|
|
useClass: FolderApiService,
|
|
deps: [FolderServiceAbstraction, ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: AccountApiServiceAbstraction,
|
|
useClass: AccountApiServiceImplementation,
|
|
deps: [
|
|
ApiServiceAbstraction,
|
|
UserVerificationServiceAbstraction,
|
|
LogService,
|
|
InternalAccountService,
|
|
],
|
|
},
|
|
{
|
|
provide: AccountServiceAbstraction,
|
|
useClass: AccountServiceImplementation,
|
|
deps: [MessagingServiceAbstraction, LogService],
|
|
},
|
|
{
|
|
provide: InternalAccountService,
|
|
useExisting: AccountServiceAbstraction,
|
|
},
|
|
{ provide: LogService, useFactory: () => new ConsoleLogService(false) },
|
|
{
|
|
provide: CollectionServiceAbstraction,
|
|
useClass: CollectionService,
|
|
deps: [CryptoServiceAbstraction, I18nServiceAbstraction, StateServiceAbstraction],
|
|
},
|
|
{
|
|
provide: EnvironmentServiceAbstraction,
|
|
useClass: EnvironmentService,
|
|
deps: [StateServiceAbstraction],
|
|
},
|
|
{
|
|
provide: TotpServiceAbstraction,
|
|
useClass: TotpService,
|
|
deps: [CryptoFunctionServiceAbstraction, LogService, StateServiceAbstraction],
|
|
},
|
|
{ provide: TokenServiceAbstraction, useClass: TokenService, deps: [StateServiceAbstraction] },
|
|
{
|
|
provide: CryptoServiceAbstraction,
|
|
useClass: CryptoService,
|
|
deps: [
|
|
CryptoFunctionServiceAbstraction,
|
|
EncryptService,
|
|
PlatformUtilsServiceAbstraction,
|
|
LogService,
|
|
StateServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: PasswordGenerationServiceAbstraction,
|
|
useClass: PasswordGenerationService,
|
|
deps: [CryptoServiceAbstraction, PolicyServiceAbstraction, StateServiceAbstraction],
|
|
},
|
|
{
|
|
provide: UsernameGenerationServiceAbstraction,
|
|
useClass: UsernameGenerationService,
|
|
deps: [CryptoServiceAbstraction, StateServiceAbstraction, ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: ApiServiceAbstraction,
|
|
useClass: ApiService,
|
|
deps: [
|
|
TokenServiceAbstraction,
|
|
PlatformUtilsServiceAbstraction,
|
|
EnvironmentServiceAbstraction,
|
|
AppIdServiceAbstraction,
|
|
LOGOUT_CALLBACK,
|
|
],
|
|
},
|
|
{
|
|
provide: FileUploadServiceAbstraction,
|
|
useClass: FileUploadService,
|
|
deps: [LogService, ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: SyncServiceAbstraction,
|
|
useClass: SyncService,
|
|
deps: [
|
|
ApiServiceAbstraction,
|
|
SettingsServiceAbstraction,
|
|
FolderServiceAbstraction,
|
|
CipherServiceAbstraction,
|
|
CryptoServiceAbstraction,
|
|
CollectionServiceAbstraction,
|
|
MessagingServiceAbstraction,
|
|
PolicyServiceAbstraction,
|
|
SendServiceAbstraction,
|
|
LogService,
|
|
KeyConnectorServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
ProviderServiceAbstraction,
|
|
FolderApiServiceAbstraction,
|
|
SyncNotifierServiceAbstraction,
|
|
LOGOUT_CALLBACK,
|
|
],
|
|
},
|
|
{ provide: BroadcasterServiceAbstraction, useClass: BroadcasterService },
|
|
{
|
|
provide: SettingsServiceAbstraction,
|
|
useClass: SettingsService,
|
|
deps: [StateServiceAbstraction],
|
|
},
|
|
{
|
|
provide: VaultTimeoutSettingsServiceAbstraction,
|
|
useClass: VaultTimeoutSettingsService,
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
TokenServiceAbstraction,
|
|
PolicyServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: VaultTimeoutServiceAbstraction,
|
|
useClass: VaultTimeoutService,
|
|
deps: [
|
|
CipherServiceAbstraction,
|
|
FolderServiceAbstraction,
|
|
CollectionServiceAbstraction,
|
|
CryptoServiceAbstraction,
|
|
PlatformUtilsServiceAbstraction,
|
|
MessagingServiceAbstraction,
|
|
SearchServiceAbstraction,
|
|
KeyConnectorServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
AuthServiceAbstraction,
|
|
VaultTimeoutSettingsServiceAbstraction,
|
|
LOCKED_CALLBACK,
|
|
LOGOUT_CALLBACK,
|
|
],
|
|
},
|
|
{
|
|
provide: StateServiceAbstraction,
|
|
useClass: StateService,
|
|
deps: [
|
|
AbstractStorageService,
|
|
SECURE_STORAGE,
|
|
MEMORY_STORAGE,
|
|
LogService,
|
|
StateMigrationServiceAbstraction,
|
|
STATE_FACTORY,
|
|
STATE_SERVICE_USE_CACHE,
|
|
],
|
|
},
|
|
{
|
|
provide: StateMigrationServiceAbstraction,
|
|
useClass: StateMigrationService,
|
|
deps: [AbstractStorageService, SECURE_STORAGE, STATE_FACTORY],
|
|
},
|
|
{
|
|
provide: ExportServiceAbstraction,
|
|
useClass: ExportService,
|
|
deps: [
|
|
FolderServiceAbstraction,
|
|
CipherServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
CryptoServiceAbstraction,
|
|
CryptoFunctionServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: SearchServiceAbstraction,
|
|
useClass: SearchService,
|
|
deps: [CipherServiceAbstraction, LogService, I18nServiceAbstraction],
|
|
},
|
|
{
|
|
provide: NotificationsServiceAbstraction,
|
|
useClass: NotificationsService,
|
|
deps: [
|
|
SyncServiceAbstraction,
|
|
AppIdServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
EnvironmentServiceAbstraction,
|
|
LOGOUT_CALLBACK,
|
|
LogService,
|
|
StateServiceAbstraction,
|
|
AuthServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: CryptoFunctionServiceAbstraction,
|
|
useClass: WebCryptoFunctionService,
|
|
deps: [WINDOW],
|
|
},
|
|
{
|
|
provide: EncryptService,
|
|
useFactory: encryptServiceFactory,
|
|
deps: [CryptoFunctionServiceAbstraction, LogService, LOG_MAC_FAILURES],
|
|
},
|
|
{
|
|
provide: EventServiceAbstraction,
|
|
useClass: EventService,
|
|
deps: [
|
|
ApiServiceAbstraction,
|
|
CipherServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
LogService,
|
|
OrganizationServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: PolicyServiceAbstraction,
|
|
useClass: PolicyService,
|
|
deps: [StateServiceAbstraction, OrganizationServiceAbstraction],
|
|
},
|
|
{
|
|
provide: InternalPolicyService,
|
|
useExisting: PolicyServiceAbstraction,
|
|
},
|
|
{
|
|
provide: PolicyApiServiceAbstraction,
|
|
useClass: PolicyApiService,
|
|
deps: [
|
|
PolicyServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
OrganizationServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: SendServiceAbstraction,
|
|
useClass: SendService,
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
FileUploadServiceAbstraction,
|
|
I18nServiceAbstraction,
|
|
CryptoFunctionServiceAbstraction,
|
|
StateServiceAbstraction,
|
|
],
|
|
},
|
|
{
|
|
provide: KeyConnectorServiceAbstraction,
|
|
useClass: KeyConnectorService,
|
|
deps: [
|
|
StateServiceAbstraction,
|
|
CryptoServiceAbstraction,
|
|
ApiServiceAbstraction,
|
|
TokenServiceAbstraction,
|
|
LogService,
|
|
OrganizationServiceAbstraction,
|
|
CryptoFunctionServiceAbstraction,
|
|
LOGOUT_CALLBACK,
|
|
],
|
|
},
|
|
{
|
|
provide: UserVerificationServiceAbstraction,
|
|
useClass: UserVerificationService,
|
|
deps: [
|
|
CryptoServiceAbstraction,
|
|
I18nServiceAbstraction,
|
|
UserVerificationApiServiceAbstraction,
|
|
],
|
|
},
|
|
{ provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService },
|
|
{
|
|
provide: OrganizationServiceAbstraction,
|
|
useClass: OrganizationService,
|
|
deps: [StateServiceAbstraction, SyncNotifierServiceAbstraction],
|
|
},
|
|
{
|
|
provide: ProviderServiceAbstraction,
|
|
useClass: ProviderService,
|
|
deps: [StateServiceAbstraction],
|
|
},
|
|
{
|
|
provide: TwoFactorServiceAbstraction,
|
|
useClass: TwoFactorService,
|
|
deps: [I18nServiceAbstraction, PlatformUtilsServiceAbstraction],
|
|
},
|
|
{
|
|
provide: AbstractThemingService,
|
|
useClass: ThemingService,
|
|
},
|
|
{
|
|
provide: FormValidationErrorsServiceAbstraction,
|
|
useClass: FormValidationErrorsService,
|
|
},
|
|
{
|
|
provide: UserVerificationApiServiceAbstraction,
|
|
useClass: UserVerificationApiService,
|
|
deps: [ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: OrganizationApiServiceAbstraction,
|
|
useClass: OrganizationApiService,
|
|
// This is a slightly odd dependency tree for a specialized api service
|
|
// it depends on SyncService so that new data can be retrieved through the sync
|
|
// rather than updating the OrganizationService directly. Instead OrganizationService
|
|
// subscribes to sync notifications and will update itself based on that.
|
|
deps: [ApiServiceAbstraction, SyncServiceAbstraction],
|
|
},
|
|
{
|
|
provide: SyncNotifierServiceAbstraction,
|
|
useClass: SyncNotifierService,
|
|
},
|
|
{
|
|
provide: ConfigServiceAbstraction,
|
|
useClass: ConfigService,
|
|
deps: [StateServiceAbstraction, ConfigApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: ConfigApiServiceAbstraction,
|
|
useClass: ConfigApiService,
|
|
deps: [ApiServiceAbstraction],
|
|
},
|
|
{
|
|
provide: AnonymousHubServiceAbstraction,
|
|
useClass: AnonymousHubService,
|
|
deps: [EnvironmentServiceAbstraction, AuthServiceAbstraction, LogService],
|
|
},
|
|
{
|
|
provide: ValidationServiceAbstraction,
|
|
useClass: ValidationService,
|
|
deps: [I18nServiceAbstraction, PlatformUtilsServiceAbstraction],
|
|
},
|
|
{
|
|
provide: LoginServiceAbstraction,
|
|
useClass: LoginService,
|
|
},
|
|
],
|
|
})
|
|
export class JslibServicesModule {}
|
|
|
|
function encryptServiceFactory(
|
|
cryptoFunctionservice: CryptoFunctionServiceAbstraction,
|
|
logService: LogService,
|
|
logMacFailures: boolean
|
|
): EncryptService {
|
|
return flagEnabled("multithreadDecryption")
|
|
? new MultithreadEncryptServiceImplementation(cryptoFunctionservice, logService, logMacFailures)
|
|
: new EncryptServiceImplementation(cryptoFunctionservice, logService, logMacFailures);
|
|
}
|