@devopness/sdk-js 2.22.1 → 2.23.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.
@@ -13,6 +13,7 @@ import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Pipeline } from '../../generated/models';
15
15
  import { PipelineCreate } from '../../generated/models';
16
+ import { PipelineRelation } from '../../generated/models';
16
17
  import { PipelineUpdate } from '../../generated/models';
17
18
  /**
18
19
  * PipelinesApiService - Auto-generated
@@ -38,6 +39,15 @@ export declare class PipelinesApiService extends ApiBaseService {
38
39
  * @param {number} pipelineId The ID of the pipeline.
39
40
  */
40
41
  getPipeline(pipelineId: number): Promise<ApiResponse<Pipeline>>;
42
+ /**
43
+ *
44
+ * @summary Return a list of pipelines to a resource
45
+ * @param {number} resourceId The resource ID.
46
+ * @param {string} resourceType The resource type to get pipelines from.
47
+ * @param {number} [page] Number of the page to be retrieved
48
+ * @param {number} [perPage] Number of items returned per page
49
+ */
50
+ listPipelinesByResourceType(resourceId: number, resourceType: string, page?: number, perPage?: number): Promise<ApiResponse<Array<PipelineRelation>>>;
41
51
  /**
42
52
  *
43
53
  * @summary Update an existing Pipeline
@@ -85,6 +85,35 @@ class PipelinesApiService extends ApiBaseService_1.ApiBaseService {
85
85
  return new ApiResponse_1.ApiResponse(response);
86
86
  });
87
87
  }
88
+ /**
89
+ *
90
+ * @summary Return a list of pipelines to a resource
91
+ * @param {number} resourceId The resource ID.
92
+ * @param {string} resourceType The resource type to get pipelines from.
93
+ * @param {number} [page] Number of the page to be retrieved
94
+ * @param {number} [perPage] Number of items returned per page
95
+ */
96
+ listPipelinesByResourceType(resourceId, resourceType, page, perPage) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ if (resourceId === null || resourceId === undefined) {
99
+ throw new Exceptions_1.ArgumentNullException('resourceId', 'listPipelinesByResourceType');
100
+ }
101
+ if (resourceType === null || resourceType === undefined) {
102
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listPipelinesByResourceType');
103
+ }
104
+ let queryString = '';
105
+ const queryParams = { page: page, per_page: perPage, };
106
+ for (const key in queryParams) {
107
+ if (queryParams[key] === undefined || queryParams[key] === null) {
108
+ continue;
109
+ }
110
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
111
+ }
112
+ const requestUrl = '/pipelines/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
113
+ const response = yield this.get(requestUrl.replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))));
114
+ return new ApiResponse_1.ApiResponse(response);
115
+ });
116
+ }
88
117
  /**
89
118
  *
90
119
  * @summary Update an existing Pipeline
@@ -1,7 +1,5 @@
1
1
  import { PipelinesApiService } from "../api/generated/apis/pipelines-api";
2
- import { PipelinesResourcesApiService } from "../api/generated/apis/pipelines-resources-api";
3
2
  import { PipelinesStepsApiService } from "../api/generated/apis/pipelines-steps-api";
4
3
  export declare class PipelineService extends PipelinesApiService {
5
- resources: PipelinesResourcesApiService;
6
4
  steps: PipelinesStepsApiService;
7
5
  }
@@ -2,12 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PipelineService = void 0;
4
4
  const pipelines_api_1 = require("../api/generated/apis/pipelines-api");
5
- const pipelines_resources_api_1 = require("../api/generated/apis/pipelines-resources-api");
6
5
  const pipelines_steps_api_1 = require("../api/generated/apis/pipelines-steps-api");
7
6
  class PipelineService extends pipelines_api_1.PipelinesApiService {
8
7
  constructor() {
9
8
  super(...arguments);
10
- this.resources = new pipelines_resources_api_1.PipelinesResourcesApiService();
11
9
  this.steps = new pipelines_steps_api_1.PipelinesStepsApiService();
12
10
  }
13
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.22.1",
3
+ "version": "2.23.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,28 +0,0 @@
1
- /**
2
- * devopness API
3
- * Devopness API - Painless essential DevOps to everyone
4
- *
5
- * The version of the OpenAPI document: latest
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- import { ApiBaseService } from "../../../services/ApiBaseService";
13
- import { ApiResponse } from "../../../common/ApiResponse";
14
- import { Pipeline } from '../../generated/models';
15
- /**
16
- * PipelinesResourcesApiService - Auto-generated
17
- */
18
- export declare class PipelinesResourcesApiService extends ApiBaseService {
19
- /**
20
- *
21
- * @summary Returns a list of pipelines to a resource
22
- * @param {string} resourceType Pipeline\&#39;s resource type to get pipelines from
23
- * @param {number} resourceId Unique ID of the resource to get pipelines from
24
- * @param {number} [page] Number of the page to be retrieved
25
- * @param {number} [perPage] Number of items returned per page
26
- */
27
- listPipelines(resourceType: string, resourceId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<Pipeline>>>;
28
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- /* eslint-disable */
3
- /**
4
- * devopness API
5
- * Devopness API - Painless essential DevOps to everyone
6
- *
7
- * The version of the OpenAPI document: latest
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
13
- */
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.PipelinesResourcesApiService = void 0;
25
- const ApiBaseService_1 = require("../../../services/ApiBaseService");
26
- const ApiResponse_1 = require("../../../common/ApiResponse");
27
- const Exceptions_1 = require("../../../common/Exceptions");
28
- /**
29
- * PipelinesResourcesApiService - Auto-generated
30
- */
31
- class PipelinesResourcesApiService extends ApiBaseService_1.ApiBaseService {
32
- /**
33
- *
34
- * @summary Returns a list of pipelines to a resource
35
- * @param {string} resourceType Pipeline\&#39;s resource type to get pipelines from
36
- * @param {number} resourceId Unique ID of the resource to get pipelines from
37
- * @param {number} [page] Number of the page to be retrieved
38
- * @param {number} [perPage] Number of items returned per page
39
- */
40
- listPipelines(resourceType, resourceId, page, perPage) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- if (resourceType === null || resourceType === undefined) {
43
- throw new Exceptions_1.ArgumentNullException('resourceType', 'listPipelines');
44
- }
45
- if (resourceId === null || resourceId === undefined) {
46
- throw new Exceptions_1.ArgumentNullException('resourceId', 'listPipelines');
47
- }
48
- let queryString = '';
49
- const queryParams = { page: page, per_page: perPage, };
50
- for (const key in queryParams) {
51
- if (queryParams[key] === undefined || queryParams[key] === null) {
52
- continue;
53
- }
54
- queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
55
- }
56
- const requestUrl = '/pipelines/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
57
- const response = yield this.get(requestUrl.replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))));
58
- return new ApiResponse_1.ApiResponse(response);
59
- });
60
- }
61
- }
62
- exports.PipelinesResourcesApiService = PipelinesResourcesApiService;