@1password/sdk 0.4.0-beta.2 → 0.4.0
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 +1 -1
- package/dist/configuration.d.ts +2 -2
- package/dist/configuration.js +1 -1
- package/dist/groups.d.ts +6 -0
- package/dist/groups.js +3 -0
- package/dist/items.d.ts +4 -4
- package/dist/items.js +1 -1
- package/dist/items_files.d.ts +8 -8
- package/dist/items_files.js +4 -4
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +2 -2
- package/dist/secrets.d.ts +3 -0
- package/dist/secrets.js +3 -0
- package/dist/types.d.ts +12 -3
- package/dist/vaults.d.ts +64 -10
- package/dist/vaults.js +77 -4
- package/dist/version.d.ts +2 -2
- package/dist/version.js +3 -3
- package/package.json +2 -2
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
|
|
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/configuration.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientAuthConfig } from "./core.js";
|
|
2
2
|
export declare const LANGUAGE = "JS";
|
|
3
|
-
export declare const VERSION = "
|
|
3
|
+
export declare const VERSION = "0040003";
|
|
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
|
|
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;
|
package/dist/configuration.js
CHANGED
|
@@ -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
|
|
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) {
|
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):
|
|
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):
|
|
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
package/dist/items_files.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/items_files.js
CHANGED
|
@@ -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
package/dist/types.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ export interface Group {
|
|
|
120
120
|
*/
|
|
121
121
|
export interface GroupAccess {
|
|
122
122
|
/** The group's ID */
|
|
123
|
-
|
|
123
|
+
groupId: string;
|
|
124
124
|
/** The group's set of permissions for the vault */
|
|
125
125
|
permissions: number;
|
|
126
126
|
}
|
|
@@ -130,9 +130,9 @@ export interface GroupGetParams {
|
|
|
130
130
|
/** Represents a group's access to a 1Password vault. */
|
|
131
131
|
export interface GroupVaultAccess {
|
|
132
132
|
/** The vault's ID */
|
|
133
|
-
|
|
133
|
+
vaultId: string;
|
|
134
134
|
/** The group's ID */
|
|
135
|
-
|
|
135
|
+
groupId: string;
|
|
136
136
|
/** The group's set of permissions for the vault */
|
|
137
137
|
permissions: number;
|
|
138
138
|
}
|
|
@@ -610,6 +610,11 @@ export interface Vault {
|
|
|
610
610
|
/** The access information associated with the vault. */
|
|
611
611
|
access?: VaultAccess[];
|
|
612
612
|
}
|
|
613
|
+
export interface VaultCreateParams {
|
|
614
|
+
title: string;
|
|
615
|
+
description?: string;
|
|
616
|
+
allowAdminsAccess?: boolean;
|
|
617
|
+
}
|
|
613
618
|
/** Represents the possible query parameters used for retrieving extra information about a vault. */
|
|
614
619
|
export interface VaultGetParams {
|
|
615
620
|
/** The vault's accessor params. */
|
|
@@ -639,6 +644,10 @@ export interface VaultOverview {
|
|
|
639
644
|
/** The time the vault was updated at */
|
|
640
645
|
updatedAt: Date;
|
|
641
646
|
}
|
|
647
|
+
export interface VaultUpdateParams {
|
|
648
|
+
title?: string;
|
|
649
|
+
description?: string;
|
|
650
|
+
}
|
|
642
651
|
export type ItemListFilter = {
|
|
643
652
|
type: "ByState";
|
|
644
653
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
export declare const SDK_BUILD_NUMBER = "
|
|
1
|
+
export declare const SDK_VERSION = "0.4.0";
|
|
2
|
+
export declare const SDK_BUILD_NUMBER = "0040003";
|
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
|
|
5
|
-
exports.SDK_BUILD_NUMBER = "
|
|
6
|
-
const SDK_CORE_VERSION = "0.4.0
|
|
4
|
+
exports.SDK_VERSION = "0.4.0";
|
|
5
|
+
exports.SDK_BUILD_NUMBER = "0040003";
|
|
6
|
+
const SDK_CORE_VERSION = "0.4.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1password/sdk",
|
|
3
|
-
"version": "0.4.0
|
|
3
|
+
"version": "0.4.0",
|
|
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
|
|
29
|
+
"@1password/sdk-core": "0.4.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@1password/eslint-config": "^4.0.0",
|