Skip to content

Commit

Permalink
Version 1.1.0 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
silas authored Feb 11, 2024
1 parent d0d3ab9 commit 9ccf803
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ await jenkins.build.term("example", 1);

### jenkins.credentials.create(options)

Create credential in a folder or system.
Create credentials in a folder or system.

Options

- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, can be `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain
- xml (String): configuration XML

Usage
Expand All @@ -280,14 +280,14 @@ await jenkins.credentials.create("folder", "store", "domain", "xml");

### jenkins.credentials.exists(options)

Check if the credential exist in a folder or system.
Check if credentials exist in a folder or system.

Options

- id (String): the id of the credential
- id (String): the id of the credentials
- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, can be `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain

Usage

Expand All @@ -299,14 +299,14 @@ await jenkins.credentials.exists("id", "folder", "store", "domain");

### jenkins.credentials.config(options)

Get XML configuration of a credential.
Get XML configuration of credentials.

Options

- id (String): the id of the credential
- id (String): the id of the credentials
- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, can be `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain

Usage

Expand All @@ -318,20 +318,20 @@ await jenkins.credentials.config("id", "folder", "store", "domain");

### jenkins.credentials.config(options)

Update Credential
Update credentials.

Options

- id (String): the id of the credential
- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, can be `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain
- xml (String): configuration XML

Usage

```javascript
await jenkins.credentials.exists("id", "folder", "store", "domain", "xml");
await jenkins.credentials.update("id", "folder", "store", "domain", "xml");
```

<a id="credentials-destroy"></a>
Expand All @@ -344,8 +344,8 @@ Options

- id (String): the id of the credential
- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain

Usage

Expand All @@ -362,8 +362,8 @@ Get a list of credentials in a folder or system.
Options

- folder (String): path of the folder or `manage` for **system** credentials
- store (String): the store where credentials should be created, `folder` or `system`
- domain (String): domain where to create the credentials
- store (String): the credentials store, can be either `folder` or `system`
- domain (String): the credentials domain

Usage

Expand Down
14 changes: 13 additions & 1 deletion lib/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Credentials {
}

/**
* Get or update config
* Get or update credentials
*/
async config(id, folderPath, store, domain, xml, opts) {
opts = utils.parse(
Expand Down Expand Up @@ -64,6 +64,9 @@ class Credentials {
);
}

/**
* Create credentials
*/
async create(folder, store, domain, xml, opts) {
opts = utils.parse([...arguments], "folder", "store", "domain", "xml");

Expand Down Expand Up @@ -99,6 +102,9 @@ class Credentials {
return await this.jenkins._post(req, middleware.empty);
}

/**
* Check if credentials exist
*/
async exists(id, folderPath, store, domain, opts) {
opts = utils.parse([...arguments], "id", "folder", "store", "domain");

Expand Down Expand Up @@ -131,6 +137,9 @@ class Credentials {
return await this.jenkins._head(req, middleware.exists);
}

/**
* Destroy credentials
*/
async destroy(id, folderPath, store, domain, opts) {
opts = utils.parse([...arguments], "id", "folder", "store", "domain");

Expand Down Expand Up @@ -163,6 +172,9 @@ class Credentials {
return await this.jenkins._delete(req, middleware.empty);
}

/**
* List credentials
*/
async list(folderPath, store, domain, opts) {
opts = utils.parse([...arguments], "folder", "store", "domain");

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jenkins",
"description": "Jenkins client",
"version": "1.0.2",
"version": "1.1.0",
"main": "./lib",
"files": [
"./lib"
Expand Down

0 comments on commit 9ccf803

Please sign in to comment.