66 ItemCreateParams ,
77 ItemListFilter ,
88 ItemOverview ,
9+ ItemsDeleteAllResponse ,
10+ ItemsGetAllResponse ,
11+ ItemsUpdateAllResponse ,
912 ReviverFunc ,
1013} from "./types.js" ;
1114import { ItemsSharesApi , ItemsShares } from "./items_shares.js" ;
@@ -22,11 +25,24 @@ export interface ItemsApi {
2225 */
2326 create ( params : ItemCreateParams ) : Promise < Item > ;
2427
28+ /**
29+ * Create items in batch, within a single vault.
30+ */
31+ createAll (
32+ vaultId : string ,
33+ params : ItemCreateParams [ ] ,
34+ ) : Promise < ItemsUpdateAllResponse > ;
35+
2536 /**
2637 * Get an item by vault and item ID
2738 */
2839 get ( vaultId : string , itemId : string ) : Promise < Item > ;
2940
41+ /**
42+ * Get items by vault and their item IDs.
43+ */
44+ getAll ( vaultId : string , itemIds : string [ ] ) : Promise < ItemsGetAllResponse > ;
45+
3046 /**
3147 * Update an existing item.
3248 */
@@ -37,6 +53,14 @@ export interface ItemsApi {
3753 */
3854 delete ( vaultId : string , itemId : string ) ;
3955
56+ /**
57+ * Create items in batch, within a single vault.
58+ */
59+ deleteAll (
60+ vaultId : string ,
61+ itemIds : string [ ] ,
62+ ) : Promise < ItemsDeleteAllResponse > ;
63+
4064 /**
4165 * Archive an item.
4266 */
@@ -80,6 +104,31 @@ export class Items implements ItemsApi {
80104 ) as Item ;
81105 }
82106
107+ /**
108+ * Create items in batch, within a single vault.
109+ */
110+ public async createAll (
111+ vaultId : string ,
112+ params : ItemCreateParams [ ] ,
113+ ) : Promise < ItemsUpdateAllResponse > {
114+ const invocationConfig : InvokeConfig = {
115+ invocation : {
116+ clientId : this . #inner. id ,
117+ parameters : {
118+ name : "ItemsCreateAll" ,
119+ parameters : {
120+ vault_id : vaultId ,
121+ params,
122+ } ,
123+ } ,
124+ } ,
125+ } ;
126+ return JSON . parse (
127+ await this . #inner. core . invoke ( invocationConfig ) ,
128+ ReviverFunc ,
129+ ) as ItemsUpdateAllResponse ;
130+ }
131+
83132 /**
84133 * Get an item by vault and item ID
85134 */
@@ -102,6 +151,31 @@ export class Items implements ItemsApi {
102151 ) as Item ;
103152 }
104153
154+ /**
155+ * Get items by vault and their item IDs.
156+ */
157+ public async getAll (
158+ vaultId : string ,
159+ itemIds : string [ ] ,
160+ ) : Promise < ItemsGetAllResponse > {
161+ const invocationConfig : InvokeConfig = {
162+ invocation : {
163+ clientId : this . #inner. id ,
164+ parameters : {
165+ name : "ItemsGetAll" ,
166+ parameters : {
167+ vault_id : vaultId ,
168+ item_ids : itemIds ,
169+ } ,
170+ } ,
171+ } ,
172+ } ;
173+ return JSON . parse (
174+ await this . #inner. core . invoke ( invocationConfig ) ,
175+ ReviverFunc ,
176+ ) as ItemsGetAllResponse ;
177+ }
178+
105179 /**
106180 * Update an existing item.
107181 */
@@ -142,6 +216,31 @@ export class Items implements ItemsApi {
142216 await this . #inner. core . invoke ( invocationConfig ) ;
143217 }
144218
219+ /**
220+ * Create items in batch, within a single vault.
221+ */
222+ public async deleteAll (
223+ vaultId : string ,
224+ itemIds : string [ ] ,
225+ ) : Promise < ItemsDeleteAllResponse > {
226+ const invocationConfig : InvokeConfig = {
227+ invocation : {
228+ clientId : this . #inner. id ,
229+ parameters : {
230+ name : "ItemsDeleteAll" ,
231+ parameters : {
232+ vault_id : vaultId ,
233+ item_ids : itemIds ,
234+ } ,
235+ } ,
236+ } ,
237+ } ;
238+ return JSON . parse (
239+ await this . #inner. core . invoke ( invocationConfig ) ,
240+ ReviverFunc ,
241+ ) as ItemsDeleteAllResponse ;
242+ }
243+
145244 /**
146245 * Archive an item.
147246 */
0 commit comments