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

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
@@ -18,7 +18,7 @@
18
18
 
19
19
  To use the 1Password JavaScript SDK in your project:
20
20
 
21
- 1. [Create a service account](https://my.1password.com/developer-tools/infrastructure-secrets/serviceaccount/) and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.
21
+ 1. [Create a service account](https://my.1password.com/developer-tools/infrastructure-secrets/serviceaccount/?source=github-sdk) and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.
22
22
  2. Provision your service account token. We recommend provisioning your token from the environment. For example, to export your token to the `OP_SERVICE_ACCOUNT_TOKEN` environment variable:
23
23
 
24
24
  **macOS or Linux**
package/dist/client.d.ts CHANGED
@@ -2,11 +2,13 @@ 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 { EnvironmentsApi } from "./environments.js";
5
6
  import { GroupsApi } from "./groups.js";
6
7
  export declare class Client {
7
8
  secrets: SecretsApi;
8
9
  items: ItemsApi;
9
10
  vaults: VaultsApi;
11
+ environments: EnvironmentsApi;
10
12
  groups: GroupsApi;
11
13
  constructor(innerClient: InnerClient);
12
14
  }
package/dist/client.js CHANGED
@@ -5,12 +5,14 @@ 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 environments_js_1 = require("./environments.js");
8
9
  const groups_js_1 = require("./groups.js");
9
10
  class Client {
10
11
  constructor(innerClient) {
11
12
  this.secrets = new secrets_js_1.Secrets(innerClient);
12
13
  this.items = new items_js_1.Items(innerClient);
13
14
  this.vaults = new vaults_js_1.Vaults(innerClient);
15
+ this.environments = new environments_js_1.Environments(innerClient);
14
16
  this.groups = new groups_js_1.Groups(innerClient);
15
17
  }
16
18
  }
@@ -1,6 +1,6 @@
1
1
  import { ClientAuthConfig } from "./core.js";
2
2
  export declare const LANGUAGE = "JS";
3
- export declare const VERSION = "0040002";
3
+ export declare const VERSION = "0040101";
4
4
  export interface ClientConfiguration {
5
5
  auth: Auth;
6
6
  integrationName: string;
@@ -8,7 +8,7 @@ export interface ClientConfiguration {
8
8
  }
9
9
  type Auth = string | DesktopAuth;
10
10
  /**
11
- * Setting that specifies that a client should use the desktop app to authenticate.
11
+ * Setting that specifies a client should use the desktop app to authenticate. Set accountName to your 1Password account name as shown at the top left sidebar of the app, or your account UUID.
12
12
  */
13
13
  export declare class DesktopAuth {
14
14
  accountName: string;
@@ -9,7 +9,7 @@ const version_js_1 = require("./version.js");
9
9
  exports.LANGUAGE = "JS";
10
10
  exports.VERSION = version_js_1.SDK_BUILD_NUMBER;
11
11
  /**
12
- * Setting that specifies that a client should use the desktop app to authenticate.
12
+ * Setting that specifies a client should use the desktop app to authenticate. Set accountName to your 1Password account name as shown at the top left sidebar of the app, or your account UUID.
13
13
  */
14
14
  class DesktopAuth {
15
15
  constructor(accountName) {
@@ -0,0 +1,19 @@
1
+ import { InnerClient } from "./core.js";
2
+ import { GetVariablesResponse } from "./types.js";
3
+ /**
4
+ * The Environments API holds all the operations the SDK client can perform on 1Password Environments.
5
+ */
6
+ export interface EnvironmentsApi {
7
+ /**
8
+ * Get environment variables belonging to an Environment.
9
+ */
10
+ getVariables(environmentId: string): Promise<GetVariablesResponse>;
11
+ }
12
+ export declare class Environments implements EnvironmentsApi {
13
+ #private;
14
+ constructor(inner: InnerClient);
15
+ /**
16
+ * Get environment variables belonging to an Environment.
17
+ */
18
+ getVariables(environmentId: string): Promise<GetVariablesResponse>;
19
+ }
@@ -0,0 +1,53 @@
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 _Environments_inner;
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.Environments = void 0;
26
+ const types_js_1 = require("./types.js");
27
+ class Environments {
28
+ constructor(inner) {
29
+ _Environments_inner.set(this, void 0);
30
+ __classPrivateFieldSet(this, _Environments_inner, inner, "f");
31
+ }
32
+ /**
33
+ * Get environment variables belonging to an Environment.
34
+ */
35
+ getVariables(environmentId) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const invocationConfig = {
38
+ invocation: {
39
+ clientId: __classPrivateFieldGet(this, _Environments_inner, "f").id,
40
+ parameters: {
41
+ name: "EnvironmentsGetVariables",
42
+ parameters: {
43
+ environment_id: environmentId,
44
+ },
45
+ },
46
+ },
47
+ };
48
+ return JSON.parse(yield __classPrivateFieldGet(this, _Environments_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
49
+ });
50
+ }
51
+ }
52
+ exports.Environments = Environments;
53
+ _Environments_inner = new WeakMap();
package/dist/groups.d.ts CHANGED
@@ -4,10 +4,16 @@ import { Group, GroupGetParams } from "./types.js";
4
4
  * The Groups API holds all the operations the SDK client can perform on 1Password groups.
5
5
  */
6
6
  export interface GroupsApi {
7
+ /**
8
+ * Get a group by its ID and parameters.
9
+ */
7
10
  get(groupId: string, groupParams: GroupGetParams): Promise<Group>;
8
11
  }
9
12
  export declare class Groups implements GroupsApi {
10
13
  #private;
11
14
  constructor(inner: InnerClient);
15
+ /**
16
+ * Get a group by its ID and parameters.
17
+ */
12
18
  get(groupId: string, groupParams: GroupGetParams): Promise<Group>;
13
19
  }
package/dist/groups.js CHANGED
@@ -29,6 +29,9 @@ class Groups {
29
29
  _Groups_inner.set(this, void 0);
30
30
  __classPrivateFieldSet(this, _Groups_inner, inner, "f");
31
31
  }
32
+ /**
33
+ * Get a group by its ID and parameters.
34
+ */
32
35
  get(groupId, groupParams) {
33
36
  return __awaiter(this, void 0, void 0, function* () {
34
37
  const invocationConfig = {
package/dist/items.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface ItemsApi {
17
17
  */
18
18
  createAll(vaultId: string, params: ItemCreateParams[]): Promise<ItemsUpdateAllResponse>;
19
19
  /**
20
- * Get an item by vault and item ID
20
+ * Get an item by vault and item ID.
21
21
  */
22
22
  get(vaultId: string, itemId: string): Promise<Item>;
23
23
  /**
@@ -31,7 +31,7 @@ export interface ItemsApi {
31
31
  /**
32
32
  * Delete an item.
33
33
  */
34
- delete(vaultId: string, itemId: string): any;
34
+ delete(vaultId: string, itemId: string): Promise<void>;
35
35
  /**
36
36
  * Delete items in batch, within a single vault.
37
37
  */
@@ -39,7 +39,7 @@ export interface ItemsApi {
39
39
  /**
40
40
  * Archive an item.
41
41
  */
42
- archive(vaultId: string, itemId: string): any;
42
+ archive(vaultId: string, itemId: string): Promise<void>;
43
43
  /**
44
44
  * List items based on filters.
45
45
  */
@@ -59,7 +59,7 @@ export declare class Items implements ItemsApi {
59
59
  */
60
60
  createAll(vaultId: string, params: ItemCreateParams[]): Promise<ItemsUpdateAllResponse>;
61
61
  /**
62
- * Get an item by vault and item ID
62
+ * Get an item by vault and item ID.
63
63
  */
64
64
  get(vaultId: string, itemId: string): Promise<Item>;
65
65
  /**
package/dist/items.js CHANGED
@@ -73,7 +73,7 @@ class Items {
73
73
  });
74
74
  }
75
75
  /**
76
- * Get an item by vault and item ID
76
+ * Get an item by vault and item ID.
77
77
  */
78
78
  get(vaultId, itemId) {
79
79
  return __awaiter(this, void 0, void 0, function* () {
@@ -2,19 +2,19 @@ import { InnerClient } from "./core.js";
2
2
  import { DocumentCreateParams, FileAttributes, FileCreateParams, Item } from "./types.js";
3
3
  export interface ItemsFilesApi {
4
4
  /**
5
- * Attach files to Items
5
+ * Attach files to Items.
6
6
  */
7
7
  attach(item: Item, fileParams: FileCreateParams): Promise<Item>;
8
8
  /**
9
- * Read file content from the Item
9
+ * Read file content from the Item.
10
10
  */
11
11
  read(vaultId: string, itemId: string, attr: FileAttributes): Promise<Uint8Array>;
12
12
  /**
13
- * Delete a field file from Item using the section and field IDs
13
+ * Delete a field file from Item using the section and field IDs.
14
14
  */
15
15
  delete(item: Item, sectionId: string, fieldId: string): Promise<Item>;
16
16
  /**
17
- * Replace the document file within a document item
17
+ * Replace the document file within a document item.
18
18
  */
19
19
  replaceDocument(item: Item, docParams: DocumentCreateParams): Promise<Item>;
20
20
  }
@@ -22,19 +22,19 @@ export declare class ItemsFiles implements ItemsFilesApi {
22
22
  #private;
23
23
  constructor(inner: InnerClient);
24
24
  /**
25
- * Attach files to Items
25
+ * Attach files to Items.
26
26
  */
27
27
  attach(item: Item, fileParams: FileCreateParams): Promise<Item>;
28
28
  /**
29
- * Read file content from the Item
29
+ * Read file content from the Item.
30
30
  */
31
31
  read(vaultId: string, itemId: string, attr: FileAttributes): Promise<Uint8Array>;
32
32
  /**
33
- * Delete a field file from Item using the section and field IDs
33
+ * Delete a field file from Item using the section and field IDs.
34
34
  */
35
35
  delete(item: Item, sectionId: string, fieldId: string): Promise<Item>;
36
36
  /**
37
- * Replace the document file within a document item
37
+ * Replace the document file within a document item.
38
38
  */
39
39
  replaceDocument(item: Item, docParams: DocumentCreateParams): Promise<Item>;
40
40
  }
@@ -30,7 +30,7 @@ class ItemsFiles {
30
30
  __classPrivateFieldSet(this, _ItemsFiles_inner, inner, "f");
31
31
  }
32
32
  /**
33
- * Attach files to Items
33
+ * Attach files to Items.
34
34
  */
35
35
  attach(item, fileParams) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
@@ -50,7 +50,7 @@ class ItemsFiles {
50
50
  });
51
51
  }
52
52
  /**
53
- * Read file content from the Item
53
+ * Read file content from the Item.
54
54
  */
55
55
  read(vaultId, itemId, attr) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
@@ -71,7 +71,7 @@ class ItemsFiles {
71
71
  });
72
72
  }
73
73
  /**
74
- * Delete a field file from Item using the section and field IDs
74
+ * Delete a field file from Item using the section and field IDs.
75
75
  */
76
76
  delete(item, sectionId, fieldId) {
77
77
  return __awaiter(this, void 0, void 0, function* () {
@@ -92,7 +92,7 @@ class ItemsFiles {
92
92
  });
93
93
  }
94
94
  /**
95
- * Replace the document file within a document item
95
+ * Replace the document file within a document item.
96
96
  */
97
97
  replaceDocument(item, docParams) {
98
98
  return __awaiter(this, void 0, void 0, function* () {
package/dist/sdk.d.ts CHANGED
@@ -3,10 +3,10 @@ import { Client } from "./client.js";
3
3
  export declare const DEFAULT_INTEGRATION_NAME = "Unknown";
4
4
  export declare const DEFAULT_INTEGRATION_VERSION = "Unknown";
5
5
  export { Secrets } from "./secrets.js";
6
+ export { DesktopAuth } from "./configuration.js";
6
7
  export * from "./client.js";
7
8
  export * from "./errors.js";
8
9
  export * from "./types.js";
9
- export { DesktopAuth } from "./configuration.js";
10
10
  /**
11
11
  * Creates a default 1Password SDK client.
12
12
  * @returns The authenticated 1Password SDK client.
package/dist/sdk.js CHANGED
@@ -32,11 +32,11 @@ exports.DEFAULT_INTEGRATION_VERSION = "Unknown";
32
32
  // auto-generated static exports
33
33
  var secrets_js_1 = require("./secrets.js");
34
34
  Object.defineProperty(exports, "Secrets", { enumerable: true, get: function () { return secrets_js_1.Secrets; } });
35
+ var configuration_js_1 = require("./configuration.js");
36
+ Object.defineProperty(exports, "DesktopAuth", { enumerable: true, get: function () { return configuration_js_1.DesktopAuth; } });
35
37
  __exportStar(require("./client.js"), exports);
36
38
  __exportStar(require("./errors.js"), exports);
37
39
  __exportStar(require("./types.js"), exports);
38
- var configuration_js_1 = require("./configuration.js");
39
- Object.defineProperty(exports, "DesktopAuth", { enumerable: true, get: function () { return configuration_js_1.DesktopAuth; } });
40
40
  /**
41
41
  * Creates a default 1Password SDK client.
42
42
  * @returns The authenticated 1Password SDK client.
package/dist/secrets.d.ts CHANGED
@@ -29,5 +29,8 @@ export declare class Secrets implements SecretsApi {
29
29
  * Validate the secret reference to ensure there are no syntax errors.
30
30
  */
31
31
  static validateSecretReference(secretReference: string): void;
32
+ /**
33
+ * Generate a password using the provided recipe.
34
+ */
32
35
  static generatePassword(recipe: PasswordRecipe): GeneratePasswordResponse;
33
36
  }
package/dist/secrets.js CHANGED
@@ -85,6 +85,9 @@ class Secrets {
85
85
  };
86
86
  sharedCore.invoke_sync(invocationConfig);
87
87
  }
88
+ /**
89
+ * Generate a password using the provided recipe.
90
+ */
88
91
  static generatePassword(recipe) {
89
92
  const sharedCore = new core_js_1.SharedCore();
90
93
  const invocationConfig = {
package/dist/types.d.ts CHANGED
@@ -18,6 +18,15 @@ export interface DocumentCreateParams {
18
18
  /** The content of the file */
19
19
  content: Uint8Array;
20
20
  }
21
+ /** Represents an environment variable (name:value pair) and its masked state */
22
+ export interface EnvironmentVariable {
23
+ /** An environment variable's name */
24
+ name: string;
25
+ /** An environment variable's value */
26
+ value: string;
27
+ /** An environment variable's masked state */
28
+ masked: boolean;
29
+ }
21
30
  export interface FileAttributes {
22
31
  /** The name of the file */
23
32
  name: string;
@@ -44,6 +53,11 @@ export interface GeneratePasswordResponse {
44
53
  /** The generated password. */
45
54
  password: string;
46
55
  }
56
+ /** Response containing the full set of environment variables from an Environment. */
57
+ export interface GetVariablesResponse {
58
+ /** List of environment variables. */
59
+ variables: EnvironmentVariable[];
60
+ }
47
61
  export declare enum GroupType {
48
62
  /**
49
63
  * The owners group, which gives the following permissions:
@@ -120,7 +134,7 @@ export interface Group {
120
134
  */
121
135
  export interface GroupAccess {
122
136
  /** The group's ID */
123
- group_id: string;
137
+ groupId: string;
124
138
  /** The group's set of permissions for the vault */
125
139
  permissions: number;
126
140
  }
@@ -130,9 +144,9 @@ export interface GroupGetParams {
130
144
  /** Represents a group's access to a 1Password vault. */
131
145
  export interface GroupVaultAccess {
132
146
  /** The vault's ID */
133
- vault_id: string;
147
+ vaultId: string;
134
148
  /** The group's ID */
135
- group_id: string;
149
+ groupId: string;
136
150
  /** The group's set of permissions for the vault */
137
151
  permissions: number;
138
152
  }
@@ -610,6 +624,11 @@ export interface Vault {
610
624
  /** The access information associated with the vault. */
611
625
  access?: VaultAccess[];
612
626
  }
627
+ export interface VaultCreateParams {
628
+ title: string;
629
+ description?: string;
630
+ allowAdminsAccess?: boolean;
631
+ }
613
632
  /** Represents the possible query parameters used for retrieving extra information about a vault. */
614
633
  export interface VaultGetParams {
615
634
  /** The vault's accessor params. */
@@ -639,6 +658,10 @@ export interface VaultOverview {
639
658
  /** The time the vault was updated at */
640
659
  updatedAt: Date;
641
660
  }
661
+ export interface VaultUpdateParams {
662
+ title?: string;
663
+ description?: string;
664
+ }
642
665
  export type ItemListFilter = {
643
666
  type: "ByState";
644
667
  content: {
package/dist/vaults.d.ts CHANGED
@@ -1,29 +1,83 @@
1
1
  import { InnerClient } from "./core.js";
2
- import { GroupAccess, GroupVaultAccess, Vault, VaultGetParams, VaultListParams, VaultOverview } from "./types.js";
2
+ import { GroupAccess, GroupVaultAccess, Vault, VaultCreateParams, VaultGetParams, VaultListParams, VaultOverview, VaultUpdateParams } from "./types.js";
3
3
  /**
4
4
  * The Vaults API holds all the operations the SDK client can perform on 1Password vaults.
5
5
  */
6
6
  export interface VaultsApi {
7
+ /**
8
+ * Create a new user vault.
9
+ */
10
+ create(params: VaultCreateParams): Promise<Vault>;
7
11
  /**
8
12
  * List information about vaults that's configurable based on some input parameters.
9
13
  */
10
- list(params: VaultListParams | undefined): Promise<VaultOverview[]>;
11
- getOverview(vaultUuid: string): Promise<VaultOverview>;
12
- get(vaultUuid: string, vaultParams: VaultGetParams): Promise<Vault>;
13
- grantGroupPermissions(vaultId: string, groupPermissionsList: GroupAccess[]): any;
14
- updateGroupPermissions(groupPermissionsList: GroupVaultAccess[]): any;
15
- revokeGroupPermissions(vaultId: string, groupId: string): any;
14
+ list(params?: VaultListParams): Promise<VaultOverview[]>;
15
+ /**
16
+ * Get an overview of a vault by its ID.
17
+ */
18
+ getOverview(vaultId: string): Promise<VaultOverview>;
19
+ /**
20
+ * Get detailed vault information by vault ID and parameters.
21
+ */
22
+ get(vaultId: string, vaultParams: VaultGetParams): Promise<Vault>;
23
+ /**
24
+ * Update a vault
25
+ */
26
+ update(vaultId: string, params: VaultUpdateParams): Promise<Vault>;
27
+ /**
28
+ * Delete a vault by its ID.
29
+ */
30
+ delete(vaultId: string): Promise<void>;
31
+ /**
32
+ * Grant group permissions to a vault.
33
+ */
34
+ grantGroupPermissions(vaultId: string, groupPermissionsList: GroupAccess[]): Promise<void>;
35
+ /**
36
+ * Update group permissions for vaults.
37
+ */
38
+ updateGroupPermissions(groupPermissionsList: GroupVaultAccess[]): Promise<void>;
39
+ /**
40
+ * Revoke group permissions from a vault.
41
+ */
42
+ revokeGroupPermissions(vaultId: string, groupId: string): Promise<void>;
16
43
  }
17
44
  export declare class Vaults implements VaultsApi {
18
45
  #private;
19
46
  constructor(inner: InnerClient);
47
+ /**
48
+ * Create a new user vault.
49
+ */
50
+ create(params: VaultCreateParams): Promise<Vault>;
20
51
  /**
21
52
  * List information about vaults that's configurable based on some input parameters.
22
53
  */
23
- list(params: VaultListParams | undefined): Promise<VaultOverview[]>;
24
- getOverview(vaultUuid: string): Promise<VaultOverview>;
25
- get(vaultUuid: string, vaultParams: VaultGetParams): Promise<Vault>;
54
+ list(params?: VaultListParams): Promise<VaultOverview[]>;
55
+ /**
56
+ * Get an overview of a vault by its ID.
57
+ */
58
+ getOverview(vaultId: string): Promise<VaultOverview>;
59
+ /**
60
+ * Get detailed vault information by vault ID and parameters.
61
+ */
62
+ get(vaultId: string, vaultParams: VaultGetParams): Promise<Vault>;
63
+ /**
64
+ * Update a vault
65
+ */
66
+ update(vaultId: string, params: VaultUpdateParams): Promise<Vault>;
67
+ /**
68
+ * Delete a vault by its ID.
69
+ */
70
+ delete(vaultId: string): Promise<void>;
71
+ /**
72
+ * Grant group permissions to a vault.
73
+ */
26
74
  grantGroupPermissions(vaultId: string, groupPermissionsList: GroupAccess[]): Promise<void>;
75
+ /**
76
+ * Update group permissions for vaults.
77
+ */
27
78
  updateGroupPermissions(groupPermissionsList: GroupVaultAccess[]): Promise<void>;
79
+ /**
80
+ * Revoke group permissions from a vault.
81
+ */
28
82
  revokeGroupPermissions(vaultId: string, groupId: string): Promise<void>;
29
83
  }
package/dist/vaults.js CHANGED
@@ -29,6 +29,25 @@ class Vaults {
29
29
  _Vaults_inner.set(this, void 0);
30
30
  __classPrivateFieldSet(this, _Vaults_inner, inner, "f");
31
31
  }
32
+ /**
33
+ * Create a new user vault.
34
+ */
35
+ create(params) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const invocationConfig = {
38
+ invocation: {
39
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
40
+ parameters: {
41
+ name: "VaultsCreate",
42
+ parameters: {
43
+ params,
44
+ },
45
+ },
46
+ },
47
+ };
48
+ return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
49
+ });
50
+ }
32
51
  /**
33
52
  * List information about vaults that's configurable based on some input parameters.
34
53
  */
@@ -48,7 +67,10 @@ class Vaults {
48
67
  return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
49
68
  });
50
69
  }
51
- getOverview(vaultUuid) {
70
+ /**
71
+ * Get an overview of a vault by its ID.
72
+ */
73
+ getOverview(vaultId) {
52
74
  return __awaiter(this, void 0, void 0, function* () {
53
75
  const invocationConfig = {
54
76
  invocation: {
@@ -56,7 +78,7 @@ class Vaults {
56
78
  parameters: {
57
79
  name: "VaultsGetOverview",
58
80
  parameters: {
59
- vault_uuid: vaultUuid,
81
+ vault_id: vaultId,
60
82
  },
61
83
  },
62
84
  },
@@ -64,7 +86,10 @@ class Vaults {
64
86
  return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
65
87
  });
66
88
  }
67
- get(vaultUuid, vaultParams) {
89
+ /**
90
+ * Get detailed vault information by vault ID and parameters.
91
+ */
92
+ get(vaultId, vaultParams) {
68
93
  return __awaiter(this, void 0, void 0, function* () {
69
94
  const invocationConfig = {
70
95
  invocation: {
@@ -72,7 +97,7 @@ class Vaults {
72
97
  parameters: {
73
98
  name: "VaultsGet",
74
99
  parameters: {
75
- vault_uuid: vaultUuid,
100
+ vault_id: vaultId,
76
101
  vault_params: vaultParams,
77
102
  },
78
103
  },
@@ -81,6 +106,48 @@ class Vaults {
81
106
  return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
82
107
  });
83
108
  }
109
+ /**
110
+ * Update a vault
111
+ */
112
+ update(vaultId, params) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const invocationConfig = {
115
+ invocation: {
116
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
117
+ parameters: {
118
+ name: "VaultsUpdate",
119
+ parameters: {
120
+ vault_id: vaultId,
121
+ params,
122
+ },
123
+ },
124
+ },
125
+ };
126
+ return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
127
+ });
128
+ }
129
+ /**
130
+ * Delete a vault by its ID.
131
+ */
132
+ delete(vaultId) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const invocationConfig = {
135
+ invocation: {
136
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
137
+ parameters: {
138
+ name: "VaultsDelete",
139
+ parameters: {
140
+ vault_id: vaultId,
141
+ },
142
+ },
143
+ },
144
+ };
145
+ yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
146
+ });
147
+ }
148
+ /**
149
+ * Grant group permissions to a vault.
150
+ */
84
151
  grantGroupPermissions(vaultId, groupPermissionsList) {
85
152
  return __awaiter(this, void 0, void 0, function* () {
86
153
  const invocationConfig = {
@@ -98,6 +165,9 @@ class Vaults {
98
165
  yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
99
166
  });
100
167
  }
168
+ /**
169
+ * Update group permissions for vaults.
170
+ */
101
171
  updateGroupPermissions(groupPermissionsList) {
102
172
  return __awaiter(this, void 0, void 0, function* () {
103
173
  const invocationConfig = {
@@ -114,6 +184,9 @@ class Vaults {
114
184
  yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
115
185
  });
116
186
  }
187
+ /**
188
+ * Revoke group permissions from a vault.
189
+ */
117
190
  revokeGroupPermissions(vaultId, groupId) {
118
191
  return __awaiter(this, void 0, void 0, function* () {
119
192
  const invocationConfig = {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.4.0-beta.2";
2
- export declare const SDK_BUILD_NUMBER = "0040002";
1
+ export declare const SDK_VERSION = "0.4.1-beta.1";
2
+ export declare const SDK_BUILD_NUMBER = "0040101";
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_BUILD_NUMBER = exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.4.0-beta.2";
5
- exports.SDK_BUILD_NUMBER = "0040002";
6
- const SDK_CORE_VERSION = "0.4.0-beta.2";
4
+ exports.SDK_VERSION = "0.4.1-beta.1";
5
+ exports.SDK_BUILD_NUMBER = "0040101";
6
+ const SDK_CORE_VERSION = "0.4.1-beta.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1password/sdk",
3
- "version": "0.4.0-beta.2",
3
+ "version": "0.4.1-beta.1",
4
4
  "description": "The 1Password JavaScript SDK offers programmatic read access to your secrets in 1Password in an interface native to JavaScript. The SDK currently supports `Node.JS`",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -26,7 +26,7 @@
26
26
  "main": "./dist/sdk.js",
27
27
  "types": "./dist/sdk.d.ts",
28
28
  "dependencies": {
29
- "@1password/sdk-core": "0.4.0-beta.2"
29
+ "@1password/sdk-core": "0.4.1-beta.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@1password/eslint-config": "^4.0.0",