Skip to content

Commit 093e5fb

Browse files
Update core to version 3260001c
1 parent f712a05 commit 093e5fb

File tree

8 files changed

+526
-34
lines changed

8 files changed

+526
-34
lines changed

client/src/client.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ import { InnerClient } from "./core.js";
44
import { SecretsApi, Secrets } from "./secrets.js";
55
import { ItemsApi, Items } from "./items.js";
66
import { VaultsApi, Vaults } from "./vaults.js";
7+
import { GroupsApi, Groups } from "./groups.js";
78

89
export class Client {
910
public secrets: SecretsApi;
1011
public items: ItemsApi;
1112
public vaults: VaultsApi;
13+
public groups: GroupsApi;
1214

1315
public constructor(innerClient: InnerClient) {
1416
this.secrets = new Secrets(innerClient);
1517
this.items = new Items(innerClient);
1618
this.vaults = new Vaults(innerClient);
19+
this.groups = new Groups(innerClient);
1720
}
1821
}

client/src/groups.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Code generated by op-codegen - DO NOT EDIT MANUALLY
2+
3+
import { InvokeConfig, InnerClient, SharedCore } from "./core.js";
4+
import { Group, GroupGetParams, ReviverFunc } from "./types.js";
5+
6+
/**
7+
* The Groups API holds all the operations the SDK client can perform on 1Password groups.
8+
*/
9+
export interface GroupsApi {
10+
get(groupId: string, groupParams: GroupGetParams): Promise<Group>;
11+
}
12+
13+
export class Groups implements GroupsApi {
14+
#inner: InnerClient;
15+
16+
public constructor(inner: InnerClient) {
17+
this.#inner = inner;
18+
}
19+
20+
public async get(
21+
groupId: string,
22+
groupParams: GroupGetParams,
23+
): Promise<Group> {
24+
const invocationConfig: InvokeConfig = {
25+
invocation: {
26+
clientId: this.#inner.id,
27+
parameters: {
28+
name: "GroupsGet",
29+
parameters: {
30+
group_id: groupId,
31+
group_params: groupParams,
32+
},
33+
},
34+
},
35+
};
36+
return JSON.parse(
37+
await this.#inner.core.invoke(invocationConfig),
38+
ReviverFunc,
39+
) as Group;
40+
}
41+
}

client/src/items.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {
66
ItemCreateParams,
77
ItemListFilter,
88
ItemOverview,
9+
ItemsDeleteAllResponse,
10+
ItemsGetAllResponse,
11+
ItemsUpdateAllResponse,
912
ReviverFunc,
1013
} from "./types.js";
1114
import { 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

Comments
 (0)