From 9ccf8030a1bdfa3eea0ebabd33b55639994e7282 Mon Sep 17 00:00:00 2001 From: Silas Sewell Date: Sat, 10 Feb 2024 19:15:08 -0500 Subject: [PATCH] Version 1.1.0 (#123) --- README.md | 38 +++++++++++++++++++------------------- lib/credentials.js | 14 +++++++++++++- package.json | 2 +- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7e1c34b..f28fc73 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 @@ -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"); ``` @@ -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 @@ -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 diff --git a/lib/credentials.js b/lib/credentials.js index 9740b63..b186174 100644 --- a/lib/credentials.js +++ b/lib/credentials.js @@ -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( @@ -64,6 +64,9 @@ class Credentials { ); } + /** + * Create credentials + */ async create(folder, store, domain, xml, opts) { opts = utils.parse([...arguments], "folder", "store", "domain", "xml"); @@ -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"); @@ -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"); @@ -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"); diff --git a/package.json b/package.json index d640a45..0a74877 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jenkins", "description": "Jenkins client", - "version": "1.0.2", + "version": "1.1.0", "main": "./lib", "files": [ "./lib"