@devopness/sdk-js 2.3.0 → 2.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.
@@ -24,6 +24,7 @@ import { InvitationService } from './services/InvitationService';
24
24
  import { TeamService } from './services/TeamService';
25
25
  import { ResourceEventService } from './services/ResourceEventService';
26
26
  import { ActionService } from './services/ActionService';
27
+ import { PipelineService } from './services/PipelineService';
27
28
  export declare class DevopnessApiClient {
28
29
  actions: ActionService;
29
30
  applications: ApplicationService;
@@ -37,6 +38,7 @@ export declare class DevopnessApiClient {
37
38
  logs: LogService;
38
39
  networkRules: NetworkRuleService;
39
40
  outgoingHooks: HookOutgoingService;
41
+ pipelines: PipelineService;
40
42
  projects: ProjectService;
41
43
  resourceEvents: ResourceEventService;
42
44
  scripts: ScriptService;
@@ -27,6 +27,7 @@ const InvitationService_1 = require("./services/InvitationService");
27
27
  const TeamService_1 = require("./services/TeamService");
28
28
  const ResourceEventService_1 = require("./services/ResourceEventService");
29
29
  const ActionService_1 = require("./services/ActionService");
30
+ const PipelineService_1 = require("./services/PipelineService");
30
31
  class DevopnessApiClient {
31
32
  constructor(options) {
32
33
  ApiBaseService_1.ApiBaseService.configuration = new ApiBaseService_1.Configuration(options || {});
@@ -45,6 +46,7 @@ class DevopnessApiClient {
45
46
  this.logs = new LogService_1.LogService();
46
47
  this.networkRules = new NetworkRuleService_1.NetworkRuleService();
47
48
  this.outgoingHooks = new HookOutgoingService_1.HookOutgoingService();
49
+ this.pipelines = new PipelineService_1.PipelineService();
48
50
  this.projects = new ProjectService_1.ProjectService();
49
51
  this.resourceEvents = new ResourceEventService_1.ResourceEventService();
50
52
  this.scripts = new ScriptService_1.ScriptService();
@@ -0,0 +1,38 @@
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
+ * PipelinesApiService - Auto-generated
17
+ */
18
+ export declare class PipelinesApiService extends ApiBaseService {
19
+ /**
20
+ *
21
+ * @summary Delete a pipeline by ID
22
+ * @param {number} pipelineId Unique ID of the pipeline to be deleted
23
+ */
24
+ deletePipeline(pipelineId: number): Promise<ApiResponse<void>>;
25
+ /**
26
+ *
27
+ * @summary Get a pipeline by ID
28
+ * @param {number} pipelineId Unique ID of the pipeline to get information from
29
+ */
30
+ getPipeline(pipelineId: number): Promise<ApiResponse<Pipeline>>;
31
+ /**
32
+ *
33
+ * @summary Update a pipeline by ID
34
+ * @param {number} pipelineId Unique ID of the pipeline to update information from
35
+ * @param {Pipeline} pipeline A JSON object containing pipeline data
36
+ */
37
+ updatePipeline(pipelineId: number, pipeline: Pipeline): Promise<ApiResponse<void>>;
38
+ }
@@ -0,0 +1,85 @@
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.PipelinesApiService = 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
+ * PipelinesApiService - Auto-generated
30
+ */
31
+ class PipelinesApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary Delete a pipeline by ID
35
+ * @param {number} pipelineId Unique ID of the pipeline to be deleted
36
+ */
37
+ deletePipeline(pipelineId) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ if (pipelineId === null || pipelineId === undefined) {
40
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'deletePipeline');
41
+ }
42
+ let queryString = '';
43
+ const requestUrl = '/pipelines/{pipeline_id}' + (queryString ? `?${queryString}` : '');
44
+ const response = yield this.delete(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))));
45
+ return new ApiResponse_1.ApiResponse(response);
46
+ });
47
+ }
48
+ /**
49
+ *
50
+ * @summary Get a pipeline by ID
51
+ * @param {number} pipelineId Unique ID of the pipeline to get information from
52
+ */
53
+ getPipeline(pipelineId) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ if (pipelineId === null || pipelineId === undefined) {
56
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'getPipeline');
57
+ }
58
+ let queryString = '';
59
+ const requestUrl = '/pipelines/{pipeline_id}' + (queryString ? `?${queryString}` : '');
60
+ const response = yield this.get(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))));
61
+ return new ApiResponse_1.ApiResponse(response);
62
+ });
63
+ }
64
+ /**
65
+ *
66
+ * @summary Update a pipeline by ID
67
+ * @param {number} pipelineId Unique ID of the pipeline to update information from
68
+ * @param {Pipeline} pipeline A JSON object containing pipeline data
69
+ */
70
+ updatePipeline(pipelineId, pipeline) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ if (pipelineId === null || pipelineId === undefined) {
73
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'updatePipeline');
74
+ }
75
+ if (pipeline === null || pipeline === undefined) {
76
+ throw new Exceptions_1.ArgumentNullException('pipeline', 'updatePipeline');
77
+ }
78
+ let queryString = '';
79
+ const requestUrl = '/pipelines/{pipeline_id}' + (queryString ? `?${queryString}` : '');
80
+ const response = yield this.put(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))), pipeline);
81
+ return new ApiResponse_1.ApiResponse(response);
82
+ });
83
+ }
84
+ }
85
+ exports.PipelinesApiService = PipelinesApiService;
@@ -0,0 +1,37 @@
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
+ import { PipelineCreate } from '../../generated/models';
16
+ /**
17
+ * PipelinesResourcesApiService - Auto-generated
18
+ */
19
+ export declare class PipelinesResourcesApiService extends ApiBaseService {
20
+ /**
21
+ *
22
+ * @summary Create a new pipeline to a resource
23
+ * @param {string} resourceType Pipeline\&#39;s resource type to create
24
+ * @param {number} resourceId Unique ID of the resource to create a pipeline
25
+ * @param {PipelineCreate} pipelineCreate A JSON object containing pipeline data
26
+ */
27
+ addPipeline(resourceType: string, resourceId: number, pipelineCreate: PipelineCreate): Promise<ApiResponse<Pipeline>>;
28
+ /**
29
+ *
30
+ * @summary Returns a list of pipelines to a resource
31
+ * @param {string} resourceType Pipeline\&#39;s resource type to get pipelines from
32
+ * @param {number} resourceId Unique ID of the resource to get pipelines from
33
+ * @param {number} [page] Number of the page to be retrieved
34
+ * @param {number} [perPage] Number of items returned per page
35
+ */
36
+ listPipelines(resourceType: string, resourceId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<Pipeline>>>;
37
+ }
@@ -0,0 +1,86 @@
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 Create a new pipeline to a resource
35
+ * @param {string} resourceType Pipeline\&#39;s resource type to create
36
+ * @param {number} resourceId Unique ID of the resource to create a pipeline
37
+ * @param {PipelineCreate} pipelineCreate A JSON object containing pipeline data
38
+ */
39
+ addPipeline(resourceType, resourceId, pipelineCreate) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (resourceType === null || resourceType === undefined) {
42
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'addPipeline');
43
+ }
44
+ if (resourceId === null || resourceId === undefined) {
45
+ throw new Exceptions_1.ArgumentNullException('resourceId', 'addPipeline');
46
+ }
47
+ if (pipelineCreate === null || pipelineCreate === undefined) {
48
+ throw new Exceptions_1.ArgumentNullException('pipelineCreate', 'addPipeline');
49
+ }
50
+ let queryString = '';
51
+ const requestUrl = '/pipelines/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
52
+ const response = yield this.post(requestUrl.replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))), pipelineCreate);
53
+ return new ApiResponse_1.ApiResponse(response);
54
+ });
55
+ }
56
+ /**
57
+ *
58
+ * @summary Returns a list of pipelines to a resource
59
+ * @param {string} resourceType Pipeline\&#39;s resource type to get pipelines from
60
+ * @param {number} resourceId Unique ID of the resource to get pipelines from
61
+ * @param {number} [page] Number of the page to be retrieved
62
+ * @param {number} [perPage] Number of items returned per page
63
+ */
64
+ listPipelines(resourceType, resourceId, page, perPage) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ if (resourceType === null || resourceType === undefined) {
67
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listPipelines');
68
+ }
69
+ if (resourceId === null || resourceId === undefined) {
70
+ throw new Exceptions_1.ArgumentNullException('resourceId', 'listPipelines');
71
+ }
72
+ let queryString = '';
73
+ const queryParams = { page: page, per_page: perPage, };
74
+ for (const key in queryParams) {
75
+ if (queryParams[key] === undefined || queryParams[key] === null) {
76
+ continue;
77
+ }
78
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
79
+ }
80
+ const requestUrl = '/pipelines/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
81
+ const response = yield this.get(requestUrl.replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))));
82
+ return new ApiResponse_1.ApiResponse(response);
83
+ });
84
+ }
85
+ }
86
+ exports.PipelinesResourcesApiService = PipelinesResourcesApiService;
@@ -0,0 +1,30 @@
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface ApplicationPipeline
16
+ */
17
+ export interface ApplicationPipeline {
18
+ /**
19
+ * The unique id of the given record
20
+ * @type {number}
21
+ * @memberof ApplicationPipeline
22
+ */
23
+ id: number;
24
+ /**
25
+ * The pipeline\'s name
26
+ * @type {string}
27
+ * @memberof ApplicationPipeline
28
+ */
29
+ name: string;
30
+ }
@@ -0,0 +1,14 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { ActionRelation } from './action-relation';
13
+ import { ApplicationPipeline } from './application-pipeline';
13
14
  import { ApplicationType } from './application-type';
14
15
  /**
15
16
  *
@@ -155,6 +156,12 @@ export interface ApplicationRelation {
155
156
  * @memberof ApplicationRelation
156
157
  */
157
158
  last_action?: ActionRelation | null;
159
+ /**
160
+ *
161
+ * @type {ApplicationPipeline}
162
+ * @memberof ApplicationRelation
163
+ */
164
+ default_pipeline?: ApplicationPipeline | null;
158
165
  /**
159
166
  * The date and time when the record was created
160
167
  * @type {string}
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { ActionRelation } from './action-relation';
13
13
  import { ApplicationLastDeployments } from './application-last-deployments';
14
+ import { ApplicationPipeline } from './application-pipeline';
14
15
  import { ApplicationType } from './application-type';
15
16
  import { EnvironmentRelation } from './environment-relation';
16
17
  import { ServerRelation } from './server-relation';
@@ -209,4 +210,10 @@ export interface Application {
209
210
  * @memberof Application
210
211
  */
211
212
  updated_at?: string;
213
+ /**
214
+ *
215
+ * @type {ApplicationPipeline}
216
+ * @memberof Application
217
+ */
218
+ default_pipeline?: ApplicationPipeline | null;
212
219
  }
@@ -24,6 +24,7 @@ export * from './application-create';
24
24
  export * from './application-deployment';
25
25
  export * from './application-last-deployments';
26
26
  export * from './application-options';
27
+ export * from './application-pipeline';
27
28
  export * from './application-relation';
28
29
  export * from './application-type';
29
30
  export * from './application-update';
@@ -114,6 +115,8 @@ export * from './network-rule-type';
114
115
  export * from './network-rule-update';
115
116
  export * from './operating-system';
116
117
  export * from './operating-system-supported-versions';
118
+ export * from './pipeline';
119
+ export * from './pipeline-create';
117
120
  export * from './project';
118
121
  export * from './project-create';
119
122
  export * from './project-relation';
@@ -40,6 +40,7 @@ __exportStar(require("./application-create"), exports);
40
40
  __exportStar(require("./application-deployment"), exports);
41
41
  __exportStar(require("./application-last-deployments"), exports);
42
42
  __exportStar(require("./application-options"), exports);
43
+ __exportStar(require("./application-pipeline"), exports);
43
44
  __exportStar(require("./application-relation"), exports);
44
45
  __exportStar(require("./application-type"), exports);
45
46
  __exportStar(require("./application-update"), exports);
@@ -130,6 +131,8 @@ __exportStar(require("./network-rule-type"), exports);
130
131
  __exportStar(require("./network-rule-update"), exports);
131
132
  __exportStar(require("./operating-system"), exports);
132
133
  __exportStar(require("./operating-system-supported-versions"), exports);
134
+ __exportStar(require("./pipeline"), exports);
135
+ __exportStar(require("./pipeline-create"), exports);
133
136
  __exportStar(require("./project"), exports);
134
137
  __exportStar(require("./project-create"), exports);
135
138
  __exportStar(require("./project-relation"), exports);
@@ -0,0 +1,24 @@
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface PipelineCreate
16
+ */
17
+ export interface PipelineCreate {
18
+ /**
19
+ * The pipeline\'s name
20
+ * @type {string}
21
+ * @memberof PipelineCreate
22
+ */
23
+ name: string;
24
+ }
@@ -0,0 +1,14 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,66 @@
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
+ /**
13
+ *
14
+ * @export
15
+ * @interface Pipeline
16
+ */
17
+ export interface Pipeline {
18
+ /**
19
+ * The unique id of the given record
20
+ * @type {number}
21
+ * @memberof Pipeline
22
+ */
23
+ id: number;
24
+ /**
25
+ * The pipeline\'s name
26
+ * @type {string}
27
+ * @memberof Pipeline
28
+ */
29
+ name: string;
30
+ /**
31
+ * The pipeline\'s resource type
32
+ * @type {string}
33
+ * @memberof Pipeline
34
+ */
35
+ resource_type: string;
36
+ /**
37
+ * The pipeline\'s resource id
38
+ * @type {number}
39
+ * @memberof Pipeline
40
+ */
41
+ resource_id: number;
42
+ /**
43
+ * The pipeline\'s project id
44
+ * @type {number}
45
+ * @memberof Pipeline
46
+ */
47
+ project_id: number;
48
+ /**
49
+ * id of the user responsible for creating the pipeline
50
+ * @type {number}
51
+ * @memberof Pipeline
52
+ */
53
+ created_by: number;
54
+ /**
55
+ * The date and time when the record was created
56
+ * @type {string}
57
+ * @memberof Pipeline
58
+ */
59
+ created_at: string;
60
+ /**
61
+ * The date and time when the record was last updated
62
+ * @type {string}
63
+ * @memberof Pipeline
64
+ */
65
+ updated_at: string;
66
+ }
@@ -0,0 +1,14 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { PipelinesApiService } from "../api/generated/apis/pipelines-api";
2
+ import { PipelinesResourcesApiService } from "../api/generated/apis/pipelines-resources-api";
3
+ export declare class PipelineService extends PipelinesApiService {
4
+ resources: PipelinesResourcesApiService;
5
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PipelineService = void 0;
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
+ class PipelineService extends pipelines_api_1.PipelinesApiService {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.resources = new pipelines_resources_api_1.PipelinesResourcesApiService();
10
+ }
11
+ }
12
+ exports.PipelineService = PipelineService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },