mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 03:03:43 +00:00
api support for sharing
This commit is contained in:
7
src/models/request/cipherBulkDeleteRequest.ts
Normal file
7
src/models/request/cipherBulkDeleteRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class CipherBulkDeleteRequest {
|
||||
ids: string[];
|
||||
|
||||
constructor(ids: string[]) {
|
||||
this.ids = ids;
|
||||
}
|
||||
}
|
||||
9
src/models/request/cipherBulkMoveRequest.ts
Normal file
9
src/models/request/cipherBulkMoveRequest.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export class CipherBulkMoveRequest {
|
||||
ids: string[];
|
||||
folderId: string;
|
||||
|
||||
constructor(ids: string[], folderId: string) {
|
||||
this.ids = ids;
|
||||
this.folderId = folderId;
|
||||
}
|
||||
}
|
||||
7
src/models/request/cipherCollectionsRequest.ts
Normal file
7
src/models/request/cipherCollectionsRequest.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export class CipherCollectionsRequest {
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(collectionIds: string[]) {
|
||||
this.collectionIds = collectionIds;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ export class CipherRequest {
|
||||
card: CardApi;
|
||||
identity: IdentityApi;
|
||||
fields: FieldApi[];
|
||||
attachments: { [id: string]: string; };
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
this.type = cipher.type;
|
||||
@@ -101,5 +102,12 @@ export class CipherRequest {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (cipher.attachments) {
|
||||
this.attachments = {};
|
||||
cipher.attachments.forEach((attachment) => {
|
||||
this.attachments[attachment.id] = attachment.fileName ? attachment.fileName.encryptedString : null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
src/models/request/cipherShareRequest.ts
Normal file
13
src/models/request/cipherShareRequest.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CipherRequest } from './cipherRequest';
|
||||
|
||||
import { Cipher } from '../domain/cipher';
|
||||
|
||||
export class CipherShareRequest {
|
||||
cipher: CipherRequest;
|
||||
collectionIds: string[];
|
||||
|
||||
constructor(cipher: Cipher) {
|
||||
this.cipher = new CipherRequest(cipher);
|
||||
this.collectionIds = cipher.collectionIds;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user