@1password/sdk 0.3.1 → 0.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -107,8 +107,9 @@ Field types:
107
107
  - [x] Address
108
108
  - [x] Date
109
109
  - [x] MM/YY
110
- - [x] Files attachments and Document items
110
+ - [x] File attachments and Document items
111
111
  - [x] Menu
112
+ - [ ] Passkeys
112
113
 
113
114
  ### Vault management
114
115
  - [ ] Retrieve vaults
package/dist/client.d.ts CHANGED
@@ -2,9 +2,11 @@ import { InnerClient } from "./core.js";
2
2
  import { SecretsApi } from "./secrets.js";
3
3
  import { ItemsApi } from "./items.js";
4
4
  import { VaultsApi } from "./vaults.js";
5
+ import { GroupsApi } from "./groups.js";
5
6
  export declare class Client {
6
7
  secrets: SecretsApi;
7
8
  items: ItemsApi;
8
9
  vaults: VaultsApi;
10
+ groups: GroupsApi;
9
11
  constructor(innerClient: InnerClient);
10
12
  }
package/dist/client.js CHANGED
@@ -5,11 +5,13 @@ exports.Client = void 0;
5
5
  const secrets_js_1 = require("./secrets.js");
6
6
  const items_js_1 = require("./items.js");
7
7
  const vaults_js_1 = require("./vaults.js");
8
+ const groups_js_1 = require("./groups.js");
8
9
  class Client {
9
10
  constructor(innerClient) {
10
11
  this.secrets = new secrets_js_1.Secrets(innerClient);
11
12
  this.items = new items_js_1.Items(innerClient);
12
13
  this.vaults = new vaults_js_1.Vaults(innerClient);
14
+ this.groups = new groups_js_1.Groups(innerClient);
13
15
  }
14
16
  }
15
17
  exports.Client = Client;
@@ -1,8 +1,8 @@
1
- import { Core } from "./core.js";
1
+ import { SharedCore } from "./core.js";
2
2
  import { ClientConfiguration } from "./configuration.js";
3
3
  import { Client } from "./client.js";
4
4
  /**
5
5
  * Creates a 1Password SDK client with a given core implementation.
6
6
  * @returns The authenticated 1Password SDK client.
7
7
  */
8
- export declare const createClientWithCore: (config: ClientConfiguration, core: Core) => Promise<Client>;
8
+ export declare const createClientWithCore: (config: ClientConfiguration, core: SharedCore) => Promise<Client>;
@@ -10,8 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.createClientWithCore = void 0;
13
+ const core_js_1 = require("./core.js");
13
14
  const configuration_js_1 = require("./configuration.js");
14
15
  const client_js_1 = require("./client.js");
16
+ const shared_lib_core_js_1 = require("./shared_lib_core.js");
15
17
  const finalizationRegistry = new FinalizationRegistry((heldClient) => {
16
18
  heldClient.core.releaseClient(heldClient.id);
17
19
  });
@@ -21,11 +23,11 @@ const finalizationRegistry = new FinalizationRegistry((heldClient) => {
21
23
  */
22
24
  const createClientWithCore = (config, core) => __awaiter(void 0, void 0, void 0, function* () {
23
25
  const authConfig = (0, configuration_js_1.clientAuthConfig)(config);
26
+ if (authConfig.accountName) {
27
+ core.setInner(new shared_lib_core_js_1.SharedLibCore(authConfig.accountName));
28
+ }
24
29
  const clientId = yield core.initClient(authConfig);
25
- const inner = {
26
- id: parseInt(clientId, 10),
27
- core,
28
- };
30
+ const inner = new core_js_1.InnerClient(parseInt(clientId, 10), core, authConfig);
29
31
  const client = new client_js_1.Client(inner);
30
32
  // Cleans up associated memory from core when client instance goes out of scope.
31
33
  finalizationRegistry.register(client, inner);
@@ -1,12 +1,19 @@
1
1
  import { ClientAuthConfig } from "./core.js";
2
2
  export declare const LANGUAGE = "JS";
3
- export declare const VERSION = "0030101";
3
+ export declare const VERSION = "0040002";
4
4
  export interface ClientConfiguration {
5
5
  auth: Auth;
6
6
  integrationName: string;
7
7
  integrationVersion: string;
8
8
  }
9
- type Auth = string;
9
+ type Auth = string | DesktopAuth;
10
+ /**
11
+ * Setting that specifies that a client should use the desktop app to authenticate.
12
+ */
13
+ export declare class DesktopAuth {
14
+ accountName: string;
15
+ constructor(accountName: string);
16
+ }
10
17
  /**
11
18
  * Creates a default client configuration.
12
19
  * @returns The client configuration to instantiate the client with.
@@ -3,21 +3,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getOsName = exports.clientAuthConfig = exports.VERSION = exports.LANGUAGE = void 0;
6
+ exports.getOsName = exports.clientAuthConfig = exports.DesktopAuth = exports.VERSION = exports.LANGUAGE = void 0;
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const version_js_1 = require("./version.js");
9
9
  exports.LANGUAGE = "JS";
10
10
  exports.VERSION = version_js_1.SDK_BUILD_NUMBER;
11
+ /**
12
+ * Setting that specifies that a client should use the desktop app to authenticate.
13
+ */
14
+ class DesktopAuth {
15
+ constructor(accountName) {
16
+ this.accountName = accountName;
17
+ }
18
+ }
19
+ exports.DesktopAuth = DesktopAuth;
11
20
  /**
12
21
  * Creates a default client configuration.
13
22
  * @returns The client configuration to instantiate the client with.
14
23
  */
15
24
  const clientAuthConfig = (userConfig) => {
16
- var _a;
17
25
  // TODO: Add logic for computing the correct sanitized version value for each platform
18
26
  const defaultOsVersion = "0.0.0";
27
+ let serviceAccountToken;
28
+ let accountName;
29
+ if (typeof userConfig.auth === "string") {
30
+ serviceAccountToken = userConfig.auth;
31
+ }
32
+ else if (userConfig.auth instanceof DesktopAuth) {
33
+ accountName = userConfig.auth.accountName;
34
+ }
19
35
  return {
20
- serviceAccountToken: (_a = userConfig.auth) !== null && _a !== void 0 ? _a : "",
36
+ serviceAccountToken: serviceAccountToken !== null && serviceAccountToken !== void 0 ? serviceAccountToken : "",
37
+ accountName,
21
38
  programmingLanguage: exports.LANGUAGE,
22
39
  sdkVersion: exports.VERSION,
23
40
  integrationName: userConfig.integrationName,
package/dist/core.d.ts CHANGED
@@ -5,25 +5,20 @@ export interface Core {
5
5
  /**
6
6
  * Allocates a new authenticated client and returns its id.
7
7
  */
8
- initClient(config: ClientAuthConfig): Promise<string>;
8
+ initClient(config: string): Promise<string>;
9
9
  /**
10
10
  * Calls async business logic from a given client and returns the result.
11
11
  */
12
- invoke(config: InvokeConfig): Promise<string>;
13
- /**
14
- * Calls sync business logic from a given client and returns the result.
15
- */
16
- invoke_sync(config: InvokeConfig): string;
12
+ invoke(config: string): Promise<string>;
17
13
  /**
18
14
  * Deallocates memory held by the given client in the SDK core when it goes out of scope.
19
15
  */
20
- releaseClient(clientId: number): void;
16
+ releaseClient(clientId: string): void;
21
17
  }
22
18
  /**
23
19
  * Wraps configuration information needed to allocate and authenticate a client instance and sends it to the SDK core.
24
20
  */
25
21
  export interface ClientAuthConfig {
26
- serviceAccountToken: string;
27
22
  programmingLanguage: string;
28
23
  sdkVersion: string;
29
24
  integrationName: string;
@@ -33,6 +28,8 @@ export interface ClientAuthConfig {
33
28
  os: string;
34
29
  osVersion: string;
35
30
  architecture: string;
31
+ serviceAccountToken?: string;
32
+ accountName?: string;
36
33
  }
37
34
  /**
38
35
  * Contains the information sent to the SDK core when you call (invoke) a function.
@@ -65,10 +62,18 @@ export interface Parameters {
65
62
  [key: string]: unknown;
66
63
  };
67
64
  }
65
+ export declare class WasmCore implements Core {
66
+ initClient(config: string): Promise<string>;
67
+ invoke(config: string): Promise<string>;
68
+ releaseClient(clientId: string): void;
69
+ }
68
70
  /**
69
71
  * An implementation of the `Core` interface that shares resources across all clients.
70
72
  */
71
- export declare class SharedCore implements Core {
73
+ export declare class SharedCore {
74
+ private inner;
75
+ constructor();
76
+ setInner(core: Core): void;
72
77
  initClient(config: ClientAuthConfig): Promise<string>;
73
78
  invoke(config: InvokeConfig): Promise<string>;
74
79
  invoke_sync(config: InvokeConfig): string;
@@ -77,8 +82,11 @@ export declare class SharedCore implements Core {
77
82
  /**
78
83
  * Represents the client instance on which a call is made.
79
84
  */
80
- export interface InnerClient {
85
+ export declare class InnerClient {
81
86
  id: number;
82
- core: Core;
87
+ readonly core: SharedCore;
88
+ config: ClientAuthConfig;
89
+ constructor(id: number, core: SharedCore, config: ClientAuthConfig);
90
+ invoke(config: InvokeConfig): Promise<string>;
83
91
  }
84
92
  export {};
package/dist/core.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SharedCore = void 0;
12
+ exports.InnerClient = exports.SharedCore = exports.WasmCore = void 0;
13
13
  const sdk_core_1 = require("@1password/sdk-core");
14
14
  const types_1 = require("./types");
15
15
  const errors_1 = require("./errors");
@@ -17,21 +17,53 @@ const errors_1 = require("./errors");
17
17
  // is ~64MB. Past this limit, the wasm-bingen FFI will throw an error and the program will crash.
18
18
  // We set the limit to 50MB to be safe, to be reconsidered upon further testing.
19
19
  const messageLimit = 50 * 1024 * 1024;
20
- /**
21
- * An implementation of the `Core` interface that shares resources across all clients.
22
- */
23
- class SharedCore {
20
+ class WasmCore {
24
21
  initClient(config) {
25
22
  return __awaiter(this, void 0, void 0, function* () {
26
- const serializedConfig = JSON.stringify(config);
27
23
  try {
28
- return yield (0, sdk_core_1.init_client)(serializedConfig);
24
+ return yield (0, sdk_core_1.init_client)(config);
25
+ }
26
+ catch (e) {
27
+ (0, errors_1.throwError)(e);
28
+ }
29
+ });
30
+ }
31
+ invoke(config) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ try {
34
+ return yield (0, sdk_core_1.invoke)(config);
29
35
  }
30
36
  catch (e) {
31
37
  (0, errors_1.throwError)(e);
32
38
  }
33
39
  });
34
40
  }
41
+ releaseClient(clientId) {
42
+ try {
43
+ (0, sdk_core_1.release_client)(clientId);
44
+ }
45
+ catch (e) {
46
+ console.warn("failed to release client:", e);
47
+ }
48
+ }
49
+ }
50
+ exports.WasmCore = WasmCore;
51
+ /**
52
+ * An implementation of the `Core` interface that shares resources across all clients.
53
+ */
54
+ class SharedCore {
55
+ constructor() {
56
+ this.inner = new WasmCore();
57
+ }
58
+ setInner(core) {
59
+ this.inner = core;
60
+ }
61
+ initClient(config) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const serializedConfig = JSON.stringify(config);
64
+ return this.inner.initClient(serializedConfig);
65
+ });
66
+ }
35
67
  invoke(config) {
36
68
  return __awaiter(this, void 0, void 0, function* () {
37
69
  const serializedConfig = JSON.stringify(config, types_1.ReplacerFunc);
@@ -40,12 +72,7 @@ class SharedCore {
40
72
  if (new TextEncoder().encode(serializedConfig).length > messageLimit) {
41
73
  (0, errors_1.throwError)(`message size exceeds the limit of ${messageLimit} bytes, please contact 1Password at support@1password.com or https://developer.1password.com/joinslack if you need help."`);
42
74
  }
43
- try {
44
- return yield (0, sdk_core_1.invoke)(serializedConfig);
45
- }
46
- catch (e) {
47
- (0, errors_1.throwError)(e);
48
- }
75
+ return this.inner.invoke(serializedConfig);
49
76
  });
50
77
  }
51
78
  invoke_sync(config) {
@@ -55,16 +82,38 @@ class SharedCore {
55
82
  if (new TextEncoder().encode(serializedConfig).length > messageLimit) {
56
83
  (0, errors_1.throwError)(`message size exceeds the limit of ${messageLimit} bytes, please contact 1Password at support@1password.com or https://developer.1password.com/joinslack if you need help.`);
57
84
  }
58
- try {
59
- return (0, sdk_core_1.invoke_sync)(serializedConfig);
60
- }
61
- catch (e) {
62
- (0, errors_1.throwError)(e);
63
- }
85
+ return (0, sdk_core_1.invoke_sync)(serializedConfig);
64
86
  }
65
87
  releaseClient(clientId) {
66
88
  const serializedId = JSON.stringify(clientId);
67
- (0, sdk_core_1.release_client)(serializedId);
89
+ this.inner.releaseClient(serializedId);
68
90
  }
69
91
  }
70
92
  exports.SharedCore = SharedCore;
93
+ /**
94
+ * Represents the client instance on which a call is made.
95
+ */
96
+ class InnerClient {
97
+ constructor(id, core, config) {
98
+ this.id = id;
99
+ this.core = core;
100
+ this.config = config;
101
+ }
102
+ invoke(config) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ try {
105
+ return yield this.core.invoke(config);
106
+ }
107
+ catch (err) {
108
+ if (err instanceof errors_1.DesktopSessionExpiredError) {
109
+ const newId = yield this.core.initClient(this.config);
110
+ this.id = parseInt(newId, 10);
111
+ config.invocation.clientId = this.id;
112
+ return yield this.core.invoke(config);
113
+ }
114
+ throw err;
115
+ }
116
+ });
117
+ }
118
+ }
119
+ exports.InnerClient = InnerClient;
package/dist/errors.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ export declare class DesktopSessionExpiredError extends Error {
2
+ message: string;
3
+ constructor(message: string);
4
+ }
1
5
  export declare class RateLimitExceededError extends Error {
2
6
  message: string;
3
7
  constructor(message: string);
package/dist/errors.js CHANGED
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by op-codegen - DO NOT EDIT MANUALLY
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.throwError = exports.RateLimitExceededError = void 0;
4
+ exports.throwError = exports.RateLimitExceededError = exports.DesktopSessionExpiredError = void 0;
5
+ class DesktopSessionExpiredError extends Error {
6
+ constructor(message) {
7
+ super();
8
+ this.message = message;
9
+ }
10
+ }
11
+ exports.DesktopSessionExpiredError = DesktopSessionExpiredError;
5
12
  class RateLimitExceededError extends Error {
6
13
  constructor(message) {
7
14
  super();
@@ -18,6 +25,8 @@ const throwError = (errString) => {
18
25
  throw new Error(errString);
19
26
  }
20
27
  switch (err.name) {
28
+ case "DesktopSessionExpired":
29
+ throw new DesktopSessionExpiredError(err.message);
21
30
  case "RateLimitExceeded":
22
31
  throw new RateLimitExceededError(err.message);
23
32
  default:
@@ -0,0 +1,13 @@
1
+ import { InnerClient } from "./core.js";
2
+ import { Group, GroupGetParams } from "./types.js";
3
+ /**
4
+ * The Groups API holds all the operations the SDK client can perform on 1Password groups.
5
+ */
6
+ export interface GroupsApi {
7
+ get(groupId: string, groupParams: GroupGetParams): Promise<Group>;
8
+ }
9
+ export declare class Groups implements GroupsApi {
10
+ #private;
11
+ constructor(inner: InnerClient);
12
+ get(groupId: string, groupParams: GroupGetParams): Promise<Group>;
13
+ }
package/dist/groups.js ADDED
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ // Code generated by op-codegen - DO NOT EDIT MANUALLY
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13
+ if (kind === "m") throw new TypeError("Private method is not writable");
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
+ };
18
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
19
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
20
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
21
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
22
+ };
23
+ var _Groups_inner;
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.Groups = void 0;
26
+ const types_js_1 = require("./types.js");
27
+ class Groups {
28
+ constructor(inner) {
29
+ _Groups_inner.set(this, void 0);
30
+ __classPrivateFieldSet(this, _Groups_inner, inner, "f");
31
+ }
32
+ get(groupId, groupParams) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const invocationConfig = {
35
+ invocation: {
36
+ clientId: __classPrivateFieldGet(this, _Groups_inner, "f").id,
37
+ parameters: {
38
+ name: "GroupsGet",
39
+ parameters: {
40
+ group_id: groupId,
41
+ group_params: groupParams,
42
+ },
43
+ },
44
+ },
45
+ };
46
+ return JSON.parse(yield __classPrivateFieldGet(this, _Groups_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
47
+ });
48
+ }
49
+ }
50
+ exports.Groups = Groups;
51
+ _Groups_inner = new WeakMap();
package/dist/items.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { InnerClient } from "./core.js";
2
- import { Item, ItemCreateParams, ItemListFilter, ItemOverview } from "./types.js";
2
+ import { Item, ItemCreateParams, ItemListFilter, ItemOverview, ItemsDeleteAllResponse, ItemsGetAllResponse, ItemsUpdateAllResponse } from "./types.js";
3
3
  import { ItemsSharesApi } from "./items_shares.js";
4
4
  import { ItemsFilesApi } from "./items_files.js";
5
5
  /**
@@ -12,10 +12,18 @@ export interface ItemsApi {
12
12
  * Create a new item.
13
13
  */
14
14
  create(params: ItemCreateParams): Promise<Item>;
15
+ /**
16
+ * Create items in batch, within a single vault.
17
+ */
18
+ createAll(vaultId: string, params: ItemCreateParams[]): Promise<ItemsUpdateAllResponse>;
15
19
  /**
16
20
  * Get an item by vault and item ID
17
21
  */
18
22
  get(vaultId: string, itemId: string): Promise<Item>;
23
+ /**
24
+ * Get items by vault and their item IDs.
25
+ */
26
+ getAll(vaultId: string, itemIds: string[]): Promise<ItemsGetAllResponse>;
19
27
  /**
20
28
  * Update an existing item.
21
29
  */
@@ -24,6 +32,10 @@ export interface ItemsApi {
24
32
  * Delete an item.
25
33
  */
26
34
  delete(vaultId: string, itemId: string): any;
35
+ /**
36
+ * Delete items in batch, within a single vault.
37
+ */
38
+ deleteAll(vaultId: string, itemIds: string[]): Promise<ItemsDeleteAllResponse>;
27
39
  /**
28
40
  * Archive an item.
29
41
  */
@@ -42,10 +54,18 @@ export declare class Items implements ItemsApi {
42
54
  * Create a new item.
43
55
  */
44
56
  create(params: ItemCreateParams): Promise<Item>;
57
+ /**
58
+ * Create items in batch, within a single vault.
59
+ */
60
+ createAll(vaultId: string, params: ItemCreateParams[]): Promise<ItemsUpdateAllResponse>;
45
61
  /**
46
62
  * Get an item by vault and item ID
47
63
  */
48
64
  get(vaultId: string, itemId: string): Promise<Item>;
65
+ /**
66
+ * Get items by vault and their item IDs.
67
+ */
68
+ getAll(vaultId: string, itemIds: string[]): Promise<ItemsGetAllResponse>;
49
69
  /**
50
70
  * Update an existing item.
51
71
  */
@@ -54,6 +74,10 @@ export declare class Items implements ItemsApi {
54
74
  * Delete an item.
55
75
  */
56
76
  delete(vaultId: string, itemId: string): Promise<void>;
77
+ /**
78
+ * Delete items in batch, within a single vault.
79
+ */
80
+ deleteAll(vaultId: string, itemIds: string[]): Promise<ItemsDeleteAllResponse>;
57
81
  /**
58
82
  * Archive an item.
59
83
  */
package/dist/items.js CHANGED
@@ -49,7 +49,27 @@ class Items {
49
49
  },
50
50
  },
51
51
  };
52
- return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
52
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
53
+ });
54
+ }
55
+ /**
56
+ * Create items in batch, within a single vault.
57
+ */
58
+ createAll(vaultId, params) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const invocationConfig = {
61
+ invocation: {
62
+ clientId: __classPrivateFieldGet(this, _Items_inner, "f").id,
63
+ parameters: {
64
+ name: "ItemsCreateAll",
65
+ parameters: {
66
+ vault_id: vaultId,
67
+ params,
68
+ },
69
+ },
70
+ },
71
+ };
72
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
53
73
  });
54
74
  }
55
75
  /**
@@ -69,7 +89,27 @@ class Items {
69
89
  },
70
90
  },
71
91
  };
72
- return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
92
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
93
+ });
94
+ }
95
+ /**
96
+ * Get items by vault and their item IDs.
97
+ */
98
+ getAll(vaultId, itemIds) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ const invocationConfig = {
101
+ invocation: {
102
+ clientId: __classPrivateFieldGet(this, _Items_inner, "f").id,
103
+ parameters: {
104
+ name: "ItemsGetAll",
105
+ parameters: {
106
+ vault_id: vaultId,
107
+ item_ids: itemIds,
108
+ },
109
+ },
110
+ },
111
+ };
112
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
73
113
  });
74
114
  }
75
115
  /**
@@ -88,7 +128,7 @@ class Items {
88
128
  },
89
129
  },
90
130
  };
91
- return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
131
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
92
132
  });
93
133
  }
94
134
  /**
@@ -108,7 +148,27 @@ class Items {
108
148
  },
109
149
  },
110
150
  };
111
- yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig);
151
+ yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig);
152
+ });
153
+ }
154
+ /**
155
+ * Delete items in batch, within a single vault.
156
+ */
157
+ deleteAll(vaultId, itemIds) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ const invocationConfig = {
160
+ invocation: {
161
+ clientId: __classPrivateFieldGet(this, _Items_inner, "f").id,
162
+ parameters: {
163
+ name: "ItemsDeleteAll",
164
+ parameters: {
165
+ vault_id: vaultId,
166
+ item_ids: itemIds,
167
+ },
168
+ },
169
+ },
170
+ };
171
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
112
172
  });
113
173
  }
114
174
  /**
@@ -128,7 +188,7 @@ class Items {
128
188
  },
129
189
  },
130
190
  };
131
- yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig);
191
+ yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig);
132
192
  });
133
193
  }
134
194
  /**
@@ -148,7 +208,7 @@ class Items {
148
208
  },
149
209
  },
150
210
  };
151
- return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
211
+ return JSON.parse(yield __classPrivateFieldGet(this, _Items_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
152
212
  });
153
213
  }
154
214
  }
@@ -46,7 +46,7 @@ class ItemsFiles {
46
46
  },
47
47
  },
48
48
  };
49
- return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
49
+ return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
50
50
  });
51
51
  }
52
52
  /**
@@ -67,7 +67,7 @@ class ItemsFiles {
67
67
  },
68
68
  },
69
69
  };
70
- return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
70
+ return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
71
71
  });
72
72
  }
73
73
  /**
@@ -88,7 +88,7 @@ class ItemsFiles {
88
88
  },
89
89
  },
90
90
  };
91
- return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
91
+ return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
92
92
  });
93
93
  }
94
94
  /**
@@ -108,7 +108,7 @@ class ItemsFiles {
108
108
  },
109
109
  },
110
110
  };
111
- return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
111
+ return JSON.parse(yield __classPrivateFieldGet(this, _ItemsFiles_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
112
112
  });
113
113
  }
114
114
  }