@itentialopensource/adapter-gitlab 0.8.1 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ ## 0.9.0 [05-30-2023]
3
+
4
+ * Minor/adapt 2433
5
+
6
+ See merge request itentialopensource/adapters/devops-netops/adapter-gitlab!16
7
+
8
+ ---
9
+
2
10
  ## 0.8.1 [02-02-2023]
3
11
 
4
12
  * Added option to task and updated adapter-utils version to fix security issues
package/adapter.js CHANGED
@@ -14161,7 +14161,21 @@ class Gitlab extends AdapterBaseCl {
14161
14161
  */
14162
14162
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
14163
14163
  getV4ProjectsIdRepositoryTree(id, ref, pathParam, recursive, perPage, callback) {
14164
- const meth = 'adapter-getV4ProjectsIdRepositoryTree';
14164
+ const queryData = { ref, pathParam, recursive, perPage };
14165
+ this.getV4ProjectsIdRepositoryTreeWithOptions(id, queryData, callback);
14166
+ }
14167
+
14168
+ /**
14169
+ * @summary Get a project repository tree
14170
+ *
14171
+ * @function getV4ProjectsIdRepositoryTree
14172
+ * @param {string} id - The ID of a project
14173
+ * @param {object} queryData - object of query data - id, ref, pathParam, recursive, perPage, page
14174
+ * @param {getCallback} callback - a callback function to return the result
14175
+ */
14176
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
14177
+ getV4ProjectsIdRepositoryTreeWithOptions(id, queryData, callback) {
14178
+ const meth = 'adapter-getV4ProjectsIdRepositoryTreeWithOptions';
14165
14179
  const origin = `${this.id}-${meth}`;
14166
14180
  log.trace(origin);
14167
14181
 
@@ -14179,7 +14193,7 @@ class Gitlab extends AdapterBaseCl {
14179
14193
  }
14180
14194
 
14181
14195
  /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
14182
- const queryParamsAvailable = { ref, pathParam, recursive, per_page: perPage };
14196
+ const queryParamsAvailable = queryData;
14183
14197
  const queryParams = {};
14184
14198
  const pathVars = [id];
14185
14199
  const bodyVars = {};
@@ -28,4 +28,5 @@
28
28
  "signup_enabled": "string",
29
29
  "updated_at": "string",
30
30
  "user_oauth_applications": "string"
31
- }
31
+ }
32
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-gitlab",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "This adapter integrates with system described as: gitlab.",
5
5
  "main": "adapter.js",
6
6
  "systemName": "GitLab",
package/pronghorn.json CHANGED
@@ -9056,6 +9056,50 @@
9056
9056
  },
9057
9057
  "task": true
9058
9058
  },
9059
+ {
9060
+ "name": "getV4ProjectsIdRepositoryTreeWithOptions",
9061
+ "summary": "Get a project repository tree",
9062
+ "description": "Get a project repository tree",
9063
+ "input": [
9064
+ {
9065
+ "name": "id",
9066
+ "type": "string",
9067
+ "info": "The ID of a project",
9068
+ "required": true,
9069
+ "schema": {
9070
+ "title": "id",
9071
+ "type": "string"
9072
+ }
9073
+ },
9074
+ {
9075
+ "name": "queryData",
9076
+ "type": "object",
9077
+ "info": "Contains properties: id, ref, pathParam, recursive, perPage, page",
9078
+ "required": false,
9079
+ "schema": {
9080
+ "title": "queryData",
9081
+ "type": "object"
9082
+ }
9083
+ }
9084
+ ],
9085
+ "output": {
9086
+ "name": "result",
9087
+ "type": "object",
9088
+ "description": "A JSON Object containing status, code and the result",
9089
+ "schema": {
9090
+ "title": "result",
9091
+ "type": "object"
9092
+ }
9093
+ },
9094
+ "roles": [
9095
+ "admin"
9096
+ ],
9097
+ "route": {
9098
+ "verb": "POST",
9099
+ "path": "/getV4ProjectsIdRepositoryTree"
9100
+ },
9101
+ "task": true
9102
+ },
9059
9103
  {
9060
9104
  "name": "getV4ProjectsIdRunners",
9061
9105
  "summary": "Get runners available for project",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.7.4",
3
- "configLines": 27766,
2
+ "version": "0.8.0",
3
+ "configLines": 27810,
4
4
  "scriptLines": 1707,
5
- "codeLines": 45517,
6
- "testLines": 41863,
7
- "testCases": 2219,
8
- "totalCodeLines": 89087,
9
- "wfTasks": 560
5
+ "codeLines": 45531,
6
+ "testLines": 41927,
7
+ "testCases": 2222,
8
+ "totalCodeLines": 89165,
9
+ "wfTasks": 561
10
10
  }
@@ -6412,6 +6412,39 @@ describe('[integration] GitLab Adapter Test', () => {
6412
6412
  }).timeout(attemptTimeout);
6413
6413
  });
6414
6414
 
6415
+ describe('#getV4ProjectsIdRepositoryTreeWithOptions - errors', () => {
6416
+ it('should work if integrated or standalone with mockdata', (done) => {
6417
+ try {
6418
+ a.getV4ProjectsIdRepositoryTreeWithOptions(projectId, {}, (data, error) => {
6419
+ try {
6420
+ runCommonAsserts(data, error);
6421
+
6422
+ if (stub) {
6423
+ assert.equal('string', data.response.id);
6424
+ assert.equal('string', data.response.mode);
6425
+ assert.equal('string', data.response.name);
6426
+ assert.equal('string', data.response.pathParam);
6427
+ assert.equal('string', data.response.type);
6428
+ projectFileName = data.response.name;
6429
+ } else {
6430
+ runCommonAsserts(data, error);
6431
+ projectFileName = data.response[0].name;
6432
+ }
6433
+
6434
+ saveMockData('Projects', 'getV4ProjectsIdRepositoryTree', 'default', data);
6435
+ done();
6436
+ } catch (err) {
6437
+ log.error(`Test Failure: ${err}`);
6438
+ done(err);
6439
+ }
6440
+ });
6441
+ } catch (error) {
6442
+ log.error(`Adapter Exception: ${error}`);
6443
+ done(error);
6444
+ }
6445
+ }).timeout(attemptTimeout);
6446
+ });
6447
+
6415
6448
  describe('#getV4ProjectsIdRunners - errors', () => {
6416
6449
  it('should work if integrated or standalone with mockdata', (done) => {
6417
6450
  try {
@@ -8524,7 +8524,37 @@ describe('[unit] GitLab Adapter Test', () => {
8524
8524
  a.getV4ProjectsIdRepositoryTree(null, null, null, null, null, (data, error) => {
8525
8525
  try {
8526
8526
  const displayE = 'id is required';
8527
- runErrorAsserts(data, error, 'AD.300', 'Test-gitlab-adapter-getV4ProjectsIdRepositoryTree', displayE);
8527
+ runErrorAsserts(data, error, 'AD.300', 'Test-gitlab-adapter-getV4ProjectsIdRepositoryTreeWithOptions', displayE);
8528
+ done();
8529
+ } catch (err) {
8530
+ log.error(`Test Failure: ${err}`);
8531
+ done(err);
8532
+ }
8533
+ });
8534
+ } catch (error) {
8535
+ log.error(`Adapter Exception: ${error}`);
8536
+ done(error);
8537
+ }
8538
+ }).timeout(attemptTimeout);
8539
+ });
8540
+
8541
+ const fakeData = {};
8542
+ describe('#getV4ProjectsIdRepositoryTreeWithOptions - errors', () => {
8543
+ it('should have a getV4ProjectsIdRepositoryTreeWithOptions function', (done) => {
8544
+ try {
8545
+ assert.equal(true, typeof a.getV4ProjectsIdRepositoryTreeWithOptions === 'function');
8546
+ done();
8547
+ } catch (error) {
8548
+ log.error(`Test Failure: ${error}`);
8549
+ done(error);
8550
+ }
8551
+ }).timeout(attemptTimeout);
8552
+ it('should error if - missing id', (done) => {
8553
+ try {
8554
+ a.getV4ProjectsIdRepositoryTreeWithOptions(null, fakeData, (data, error) => {
8555
+ try {
8556
+ const displayE = 'id is required';
8557
+ runErrorAsserts(data, error, 'AD.300', 'Test-gitlab-adapter-getV4ProjectsIdRepositoryTreeWithOptions', displayE);
8528
8558
  done();
8529
8559
  } catch (err) {
8530
8560
  log.error(`Test Failure: ${err}`);