@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/dist/vaults.d.ts CHANGED
@@ -1,19 +1,29 @@
1
1
  import { InnerClient } from "./core.js";
2
- import { VaultOverview } from "./types.js";
2
+ import { GroupAccess, GroupVaultAccess, Vault, VaultGetParams, VaultListParams, VaultOverview } 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
7
  /**
8
- * List all vaults
8
+ * List information about vaults that's configurable based on some input parameters.
9
9
  */
10
- list(): Promise<VaultOverview[]>;
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;
11
16
  }
12
17
  export declare class Vaults implements VaultsApi {
13
18
  #private;
14
19
  constructor(inner: InnerClient);
15
20
  /**
16
- * List all vaults
21
+ * List information about vaults that's configurable based on some input parameters.
17
22
  */
18
- list(): Promise<VaultOverview[]>;
23
+ list(params: VaultListParams | undefined): Promise<VaultOverview[]>;
24
+ getOverview(vaultUuid: string): Promise<VaultOverview>;
25
+ get(vaultUuid: string, vaultParams: VaultGetParams): Promise<Vault>;
26
+ grantGroupPermissions(vaultId: string, groupPermissionsList: GroupAccess[]): Promise<void>;
27
+ updateGroupPermissions(groupPermissionsList: GroupVaultAccess[]): Promise<void>;
28
+ revokeGroupPermissions(vaultId: string, groupId: string): Promise<void>;
19
29
  }
package/dist/vaults.js CHANGED
@@ -30,20 +30,105 @@ class Vaults {
30
30
  __classPrivateFieldSet(this, _Vaults_inner, inner, "f");
31
31
  }
32
32
  /**
33
- * List all vaults
33
+ * List information about vaults that's configurable based on some input parameters.
34
34
  */
35
- list() {
35
+ list(params) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
37
  const invocationConfig = {
38
38
  invocation: {
39
39
  clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
40
40
  parameters: {
41
41
  name: "VaultsList",
42
- parameters: {},
42
+ parameters: {
43
+ params,
44
+ },
43
45
  },
44
46
  },
45
47
  };
46
- return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").core.invoke(invocationConfig), types_js_1.ReviverFunc);
48
+ return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
49
+ });
50
+ }
51
+ getOverview(vaultUuid) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const invocationConfig = {
54
+ invocation: {
55
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
56
+ parameters: {
57
+ name: "VaultsGetOverview",
58
+ parameters: {
59
+ vault_uuid: vaultUuid,
60
+ },
61
+ },
62
+ },
63
+ };
64
+ return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
65
+ });
66
+ }
67
+ get(vaultUuid, vaultParams) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const invocationConfig = {
70
+ invocation: {
71
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
72
+ parameters: {
73
+ name: "VaultsGet",
74
+ parameters: {
75
+ vault_uuid: vaultUuid,
76
+ vault_params: vaultParams,
77
+ },
78
+ },
79
+ },
80
+ };
81
+ return JSON.parse(yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig), types_js_1.ReviverFunc);
82
+ });
83
+ }
84
+ grantGroupPermissions(vaultId, groupPermissionsList) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ const invocationConfig = {
87
+ invocation: {
88
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
89
+ parameters: {
90
+ name: "VaultsGrantGroupPermissions",
91
+ parameters: {
92
+ vault_id: vaultId,
93
+ group_permissions_list: groupPermissionsList,
94
+ },
95
+ },
96
+ },
97
+ };
98
+ yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
99
+ });
100
+ }
101
+ updateGroupPermissions(groupPermissionsList) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ const invocationConfig = {
104
+ invocation: {
105
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
106
+ parameters: {
107
+ name: "VaultsUpdateGroupPermissions",
108
+ parameters: {
109
+ group_permissions_list: groupPermissionsList,
110
+ },
111
+ },
112
+ },
113
+ };
114
+ yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
115
+ });
116
+ }
117
+ revokeGroupPermissions(vaultId, groupId) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ const invocationConfig = {
120
+ invocation: {
121
+ clientId: __classPrivateFieldGet(this, _Vaults_inner, "f").id,
122
+ parameters: {
123
+ name: "VaultsRevokeGroupPermissions",
124
+ parameters: {
125
+ vault_id: vaultId,
126
+ group_id: groupId,
127
+ },
128
+ },
129
+ },
130
+ };
131
+ yield __classPrivateFieldGet(this, _Vaults_inner, "f").invoke(invocationConfig);
47
132
  });
48
133
  }
49
134
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.3.1";
2
- export declare const SDK_BUILD_NUMBER = "0030101";
1
+ export declare const SDK_VERSION = "0.4.0-beta.2";
2
+ export declare const SDK_BUILD_NUMBER = "0040002";
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.3.1";
5
- exports.SDK_BUILD_NUMBER = "0030101";
6
- const SDK_CORE_VERSION = "0.3.1";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1password/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.4.0-beta.2",
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.3.1"
29
+ "@1password/sdk-core": "0.4.0-beta.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@1password/eslint-config": "^4.0.0",