mirror of
https://github.com/bitwarden/browser
synced 2025-12-30 15:13:32 +00:00
org vault listing from apis
This commit is contained in:
@@ -40,6 +40,7 @@ import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFacto
|
||||
|
||||
import { BillingResponse } from '../models/response/billingResponse';
|
||||
import { CipherResponse } from '../models/response/cipherResponse';
|
||||
import { CollectionResponse } from '../models/response/collectionResponse';
|
||||
import { DomainsResponse } from '../models/response/domainsResponse';
|
||||
import { ErrorResponse } from '../models/response/errorResponse';
|
||||
import { FolderResponse } from '../models/response/folderResponse';
|
||||
@@ -241,6 +242,12 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
|
||||
// Cipher APIs
|
||||
|
||||
async getCiphersOrganization(organizationId: string): Promise<ListResponse<CipherResponse>> {
|
||||
const r = await this.send('GET', '/ciphers/organization-details?organizationId=' + organizationId,
|
||||
null, true, true);
|
||||
return new ListResponse(r, CipherResponse);
|
||||
}
|
||||
|
||||
async postCipher(request: CipherRequest): Promise<CipherResponse> {
|
||||
const r = await this.send('POST', '/ciphers', request, true, true);
|
||||
return new CipherResponse(r);
|
||||
@@ -304,6 +311,13 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
attachmentId + '/share?organizationId=' + organizationId, data, true, false);
|
||||
}
|
||||
|
||||
// Collections APIs
|
||||
|
||||
async getCollections(organizationId: string): Promise<ListResponse<CollectionResponse>> {
|
||||
const r = await this.send('GET', '/organizations/' + organizationId + '/collections', null, true, true);
|
||||
return new ListResponse(r, CollectionResponse);
|
||||
}
|
||||
|
||||
// Sync APIs
|
||||
|
||||
async getSync(): Promise<SyncResponse> {
|
||||
|
||||
@@ -619,9 +619,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
return this.getLocaleSortingFunction()(a, b);
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
private getLocaleSortingFunction(): (a: CipherView, b: CipherView) => number {
|
||||
getLocaleSortingFunction(): (a: CipherView, b: CipherView) => number {
|
||||
return (a, b) => {
|
||||
let aName = a.name;
|
||||
let bName = b.name;
|
||||
@@ -656,6 +654,8 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
};
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
private async encryptObjProperty<V extends View, D extends Domain>(model: V, obj: D,
|
||||
map: any, key: SymmetricCryptoKey): Promise<void> {
|
||||
const promises = [];
|
||||
|
||||
@@ -125,7 +125,7 @@ export class CollectionService implements CollectionServiceAbstraction {
|
||||
this.decryptedCollectionCache = null;
|
||||
}
|
||||
|
||||
private getLocaleSortingFunction(): (a: CollectionView, b: CollectionView) => number {
|
||||
getLocaleSortingFunction(): (a: CollectionView, b: CollectionView) => number {
|
||||
return (a, b) => {
|
||||
if (a.name == null && b.name != null) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user