1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +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:
Oscar Hinton
2025-07-25 12:21:15 +02:00
committed by GitHub
parent 4989f024bd
commit 1491445392
2 changed files with 18 additions and 18 deletions

View File

@@ -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>;
}

View File

@@ -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>;
}