mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[PM-24042] Migrate AC owned abstract services to strict TS (#15733)
* Migrate remaining AC owned abstract services to strict TS * Remove now unused service
This commit is contained in:
@@ -4,20 +4,20 @@ import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { CollectionAccessSelectionView, CollectionAdminView } from "../models";
|
||||
|
||||
export abstract class CollectionAdminService {
|
||||
abstract getAll: (organizationId: string) => Promise<CollectionAdminView[]>;
|
||||
abstract get: (
|
||||
abstract getAll(organizationId: string): Promise<CollectionAdminView[]>;
|
||||
abstract get(
|
||||
organizationId: string,
|
||||
collectionId: string,
|
||||
) => Promise<CollectionAdminView | undefined>;
|
||||
abstract save: (
|
||||
): Promise<CollectionAdminView | undefined>;
|
||||
abstract save(
|
||||
collection: CollectionAdminView,
|
||||
userId: UserId,
|
||||
) => Promise<CollectionDetailsResponse>;
|
||||
abstract delete: (organizationId: string, collectionId: string) => Promise<void>;
|
||||
abstract bulkAssignAccess: (
|
||||
): Promise<CollectionDetailsResponse>;
|
||||
abstract delete(organizationId: string, collectionId: string): Promise<void>;
|
||||
abstract bulkAssignAccess(
|
||||
organizationId: string,
|
||||
collectionIds: string[],
|
||||
users: CollectionAccessSelectionView[],
|
||||
groups: CollectionAccessSelectionView[],
|
||||
) => Promise<void>;
|
||||
): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -7,25 +7,25 @@ import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node";
|
||||
import { CollectionData, Collection, CollectionView } from "../models";
|
||||
|
||||
export abstract class CollectionService {
|
||||
abstract encryptedCollections$: (userId: UserId) => Observable<Collection[] | null>;
|
||||
abstract decryptedCollections$: (userId: UserId) => Observable<CollectionView[]>;
|
||||
abstract upsert: (collection: CollectionData, userId: UserId) => Promise<any>;
|
||||
abstract replace: (collections: { [id: string]: CollectionData }, userId: UserId) => Promise<any>;
|
||||
abstract encryptedCollections$(userId: UserId): Observable<Collection[] | null>;
|
||||
abstract decryptedCollections$(userId: UserId): Observable<CollectionView[]>;
|
||||
abstract upsert(collection: CollectionData, userId: UserId): Promise<any>;
|
||||
abstract replace(collections: { [id: string]: CollectionData }, userId: UserId): Promise<any>;
|
||||
/**
|
||||
* @deprecated This method will soon be made private, use `decryptedCollections$` instead.
|
||||
*/
|
||||
abstract decryptMany$: (
|
||||
abstract decryptMany$(
|
||||
collections: Collection[],
|
||||
orgKeys: Record<OrganizationId, OrgKey>,
|
||||
) => Observable<CollectionView[]>;
|
||||
abstract delete: (ids: CollectionId[], userId: UserId) => Promise<any>;
|
||||
abstract encrypt: (model: CollectionView, userId: UserId) => Promise<Collection>;
|
||||
): Observable<CollectionView[]>;
|
||||
abstract delete(ids: CollectionId[], userId: UserId): Promise<any>;
|
||||
abstract encrypt(model: CollectionView, userId: UserId): Promise<Collection>;
|
||||
/**
|
||||
* Transforms the input CollectionViews into TreeNodes
|
||||
*/
|
||||
abstract getAllNested: (collections: CollectionView[]) => TreeNode<CollectionView>[];
|
||||
abstract getAllNested(collections: CollectionView[]): TreeNode<CollectionView>[];
|
||||
/*
|
||||
* Transforms the input CollectionViews into TreeNodes and then returns the Treenode with the specified id
|
||||
*/
|
||||
abstract getNested: (collections: CollectionView[], id: string) => TreeNode<CollectionView>;
|
||||
abstract getNested(collections: CollectionView[], id: string): TreeNode<CollectionView>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user