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";
|
import { CollectionAccessSelectionView, CollectionAdminView } from "../models";
|
||||||
|
|
||||||
export abstract class CollectionAdminService {
|
export abstract class CollectionAdminService {
|
||||||
abstract getAll: (organizationId: string) => Promise<CollectionAdminView[]>;
|
abstract getAll(organizationId: string): Promise<CollectionAdminView[]>;
|
||||||
abstract get: (
|
abstract get(
|
||||||
organizationId: string,
|
organizationId: string,
|
||||||
collectionId: string,
|
collectionId: string,
|
||||||
) => Promise<CollectionAdminView | undefined>;
|
): Promise<CollectionAdminView | undefined>;
|
||||||
abstract save: (
|
abstract save(
|
||||||
collection: CollectionAdminView,
|
collection: CollectionAdminView,
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
) => Promise<CollectionDetailsResponse>;
|
): Promise<CollectionDetailsResponse>;
|
||||||
abstract delete: (organizationId: string, collectionId: string) => Promise<void>;
|
abstract delete(organizationId: string, collectionId: string): Promise<void>;
|
||||||
abstract bulkAssignAccess: (
|
abstract bulkAssignAccess(
|
||||||
organizationId: string,
|
organizationId: string,
|
||||||
collectionIds: string[],
|
collectionIds: string[],
|
||||||
users: CollectionAccessSelectionView[],
|
users: CollectionAccessSelectionView[],
|
||||||
groups: 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";
|
import { CollectionData, Collection, CollectionView } from "../models";
|
||||||
|
|
||||||
export abstract class CollectionService {
|
export abstract class CollectionService {
|
||||||
abstract encryptedCollections$: (userId: UserId) => Observable<Collection[] | null>;
|
abstract encryptedCollections$(userId: UserId): Observable<Collection[] | null>;
|
||||||
abstract decryptedCollections$: (userId: UserId) => Observable<CollectionView[]>;
|
abstract decryptedCollections$(userId: UserId): Observable<CollectionView[]>;
|
||||||
abstract upsert: (collection: CollectionData, userId: UserId) => Promise<any>;
|
abstract upsert(collection: CollectionData, userId: UserId): Promise<any>;
|
||||||
abstract replace: (collections: { [id: string]: 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.
|
* @deprecated This method will soon be made private, use `decryptedCollections$` instead.
|
||||||
*/
|
*/
|
||||||
abstract decryptMany$: (
|
abstract decryptMany$(
|
||||||
collections: Collection[],
|
collections: Collection[],
|
||||||
orgKeys: Record<OrganizationId, OrgKey>,
|
orgKeys: Record<OrganizationId, OrgKey>,
|
||||||
) => Observable<CollectionView[]>;
|
): Observable<CollectionView[]>;
|
||||||
abstract delete: (ids: CollectionId[], userId: UserId) => Promise<any>;
|
abstract delete(ids: CollectionId[], userId: UserId): Promise<any>;
|
||||||
abstract encrypt: (model: CollectionView, userId: UserId) => Promise<Collection>;
|
abstract encrypt(model: CollectionView, userId: UserId): Promise<Collection>;
|
||||||
/**
|
/**
|
||||||
* Transforms the input CollectionViews into TreeNodes
|
* 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
|
* 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