@devopness/sdk-js 2.4.0 → 2.5.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.
@@ -0,0 +1,41 @@
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 { PipelineStep } from '../../generated/models';
15
+ import { PipelineStepCreate } from '../../generated/models';
16
+ /**
17
+ * PipelinesStepsApiService - Auto-generated
18
+ */
19
+ export declare class PipelinesStepsApiService extends ApiBaseService {
20
+ /**
21
+ *
22
+ * @summary Creates a step for a pipeline
23
+ * @param {number} pipelineId Unique ID of the pipeline to add the step to
24
+ * @param {PipelineStepCreate} pipelineStepCreate A JSON object containing pipeline script data
25
+ */
26
+ createPipelineStep(pipelineId: number, pipelineStepCreate: PipelineStepCreate): Promise<ApiResponse<PipelineStep>>;
27
+ /**
28
+ *
29
+ * @summary Link a step to a pipeline
30
+ * @param {number} pipelineId Unique ID of the pipeline
31
+ * @param {number} stepId Unique ID of the step to be linked
32
+ */
33
+ linkStepToPipeline(pipelineId: number, stepId: number): Promise<ApiResponse<void>>;
34
+ /**
35
+ *
36
+ * @summary Unlink a step from a pipeline
37
+ * @param {number} pipelineId Unique ID of the pipeline
38
+ * @param {number} stepId Unique ID of the step to be unlinked
39
+ */
40
+ unlinkStepFromPipeline(pipelineId: number, stepId: number): Promise<ApiResponse<void>>;
41
+ }
@@ -0,0 +1,93 @@
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.PipelinesStepsApiService = 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
+ * PipelinesStepsApiService - Auto-generated
30
+ */
31
+ class PipelinesStepsApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary Creates a step for a pipeline
35
+ * @param {number} pipelineId Unique ID of the pipeline to add the step to
36
+ * @param {PipelineStepCreate} pipelineStepCreate A JSON object containing pipeline script data
37
+ */
38
+ createPipelineStep(pipelineId, pipelineStepCreate) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (pipelineId === null || pipelineId === undefined) {
41
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'createPipelineStep');
42
+ }
43
+ if (pipelineStepCreate === null || pipelineStepCreate === undefined) {
44
+ throw new Exceptions_1.ArgumentNullException('pipelineStepCreate', 'createPipelineStep');
45
+ }
46
+ let queryString = '';
47
+ const requestUrl = '/pipelines/{pipeline_id}/steps' + (queryString ? `?${queryString}` : '');
48
+ const response = yield this.post(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))), pipelineStepCreate);
49
+ return new ApiResponse_1.ApiResponse(response);
50
+ });
51
+ }
52
+ /**
53
+ *
54
+ * @summary Link a step to a pipeline
55
+ * @param {number} pipelineId Unique ID of the pipeline
56
+ * @param {number} stepId Unique ID of the step to be linked
57
+ */
58
+ linkStepToPipeline(pipelineId, stepId) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ if (pipelineId === null || pipelineId === undefined) {
61
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'linkStepToPipeline');
62
+ }
63
+ if (stepId === null || stepId === undefined) {
64
+ throw new Exceptions_1.ArgumentNullException('stepId', 'linkStepToPipeline');
65
+ }
66
+ let queryString = '';
67
+ const requestUrl = '/pipelines/{pipeline_id}/steps/{step_id}' + (queryString ? `?${queryString}` : '');
68
+ const response = yield this.post(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))).replace(`{${"step_id"}}`, encodeURIComponent(String(stepId))));
69
+ return new ApiResponse_1.ApiResponse(response);
70
+ });
71
+ }
72
+ /**
73
+ *
74
+ * @summary Unlink a step from a pipeline
75
+ * @param {number} pipelineId Unique ID of the pipeline
76
+ * @param {number} stepId Unique ID of the step to be unlinked
77
+ */
78
+ unlinkStepFromPipeline(pipelineId, stepId) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (pipelineId === null || pipelineId === undefined) {
81
+ throw new Exceptions_1.ArgumentNullException('pipelineId', 'unlinkStepFromPipeline');
82
+ }
83
+ if (stepId === null || stepId === undefined) {
84
+ throw new Exceptions_1.ArgumentNullException('stepId', 'unlinkStepFromPipeline');
85
+ }
86
+ let queryString = '';
87
+ const requestUrl = '/pipelines/{pipeline_id}/steps/{step_id}' + (queryString ? `?${queryString}` : '');
88
+ const response = yield this.delete(requestUrl.replace(`{${"pipeline_id"}}`, encodeURIComponent(String(pipelineId))).replace(`{${"step_id"}}`, encodeURIComponent(String(stepId))));
89
+ return new ApiResponse_1.ApiResponse(response);
90
+ });
91
+ }
92
+ }
93
+ exports.PipelinesStepsApiService = PipelinesStepsApiService;
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { DeploymentDefaultStep } from './deployment-default-step';
13
13
  import { LanguageRuntime } from './language-runtime';
14
+ import { ScriptRunner } from './script-runner';
14
15
  /**
15
16
  *
16
17
  * @export
@@ -29,4 +30,10 @@ export interface ApplicationOptions {
29
30
  * @memberof ApplicationOptions
30
31
  */
31
32
  language_runtimes: Array<LanguageRuntime>;
33
+ /**
34
+ *
35
+ * @type {Array<ScriptRunner>}
36
+ * @memberof ApplicationOptions
37
+ */
38
+ script_runners: Array<ScriptRunner>;
32
39
  }
@@ -117,6 +117,9 @@ export * from './operating-system';
117
117
  export * from './operating-system-supported-versions';
118
118
  export * from './pipeline';
119
119
  export * from './pipeline-create';
120
+ export * from './pipeline-step';
121
+ export * from './pipeline-step-create';
122
+ export * from './pipeline-step-runner-name';
120
123
  export * from './project';
121
124
  export * from './project-create';
122
125
  export * from './project-relation';
@@ -128,6 +131,7 @@ export * from './resource-event';
128
131
  export * from './resource-type';
129
132
  export * from './script';
130
133
  export * from './script-create';
134
+ export * from './script-runner';
131
135
  export * from './script-update';
132
136
  export * from './server';
133
137
  export * from './server-action';
@@ -133,6 +133,9 @@ __exportStar(require("./operating-system"), exports);
133
133
  __exportStar(require("./operating-system-supported-versions"), exports);
134
134
  __exportStar(require("./pipeline"), exports);
135
135
  __exportStar(require("./pipeline-create"), exports);
136
+ __exportStar(require("./pipeline-step"), exports);
137
+ __exportStar(require("./pipeline-step-create"), exports);
138
+ __exportStar(require("./pipeline-step-runner-name"), exports);
136
139
  __exportStar(require("./project"), exports);
137
140
  __exportStar(require("./project-create"), exports);
138
141
  __exportStar(require("./project-relation"), exports);
@@ -144,6 +147,7 @@ __exportStar(require("./resource-event"), exports);
144
147
  __exportStar(require("./resource-type"), exports);
145
148
  __exportStar(require("./script"), exports);
146
149
  __exportStar(require("./script-create"), exports);
150
+ __exportStar(require("./script-runner"), exports);
147
151
  __exportStar(require("./script-update"), exports);
148
152
  __exportStar(require("./server"), exports);
149
153
  __exportStar(require("./server-action"), exports);
@@ -0,0 +1,43 @@
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 { PipelineStepRunnerName } from './pipeline-step-runner-name';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface PipelineStepCreate
17
+ */
18
+ export interface PipelineStepCreate {
19
+ /**
20
+ * Name/short description of the script
21
+ * @type {string}
22
+ * @memberof PipelineStepCreate
23
+ */
24
+ name: string;
25
+ /**
26
+ * A command line or multiline bash script
27
+ * @type {string}
28
+ * @memberof PipelineStepCreate
29
+ */
30
+ command: string;
31
+ /**
32
+ *
33
+ * @type {PipelineStepRunnerName}
34
+ * @memberof PipelineStepCreate
35
+ */
36
+ runner: PipelineStepRunnerName;
37
+ /**
38
+ * The name of the Unix user on behalf of which the script will be executed
39
+ * @type {string}
40
+ * @memberof PipelineStepCreate
41
+ */
42
+ run_as_user?: string;
43
+ }
@@ -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,22 @@
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
+ * Name of the script runner that will run the script
14
+ * @export
15
+ * @enum {string}
16
+ */
17
+ export declare enum PipelineStepRunnerName {
18
+ Composer = "composer",
19
+ Npm = "npm",
20
+ Pip = "pip",
21
+ Yarn = "yarn"
22
+ }
@@ -0,0 +1,27 @@
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 });
15
+ exports.PipelineStepRunnerName = void 0;
16
+ /**
17
+ * Name of the script runner that will run the script
18
+ * @export
19
+ * @enum {string}
20
+ */
21
+ var PipelineStepRunnerName;
22
+ (function (PipelineStepRunnerName) {
23
+ PipelineStepRunnerName["Composer"] = "composer";
24
+ PipelineStepRunnerName["Npm"] = "npm";
25
+ PipelineStepRunnerName["Pip"] = "pip";
26
+ PipelineStepRunnerName["Yarn"] = "yarn";
27
+ })(PipelineStepRunnerName = exports.PipelineStepRunnerName || (exports.PipelineStepRunnerName = {}));
@@ -0,0 +1,73 @@
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 { PipelineStepRunnerName } from './pipeline-step-runner-name';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface PipelineStep
17
+ */
18
+ export interface PipelineStep {
19
+ /**
20
+ * The Id of the given script
21
+ * @type {number}
22
+ * @memberof PipelineStep
23
+ */
24
+ id: number;
25
+ /**
26
+ * The id of the user that own the script
27
+ * @type {number}
28
+ * @memberof PipelineStep
29
+ */
30
+ created_by: number;
31
+ /**
32
+ * Name/short description of the script
33
+ * @type {string}
34
+ * @memberof PipelineStep
35
+ */
36
+ name: string;
37
+ /**
38
+ * A command line or multiline bash script
39
+ * @type {string}
40
+ * @memberof PipelineStep
41
+ */
42
+ command: string;
43
+ /**
44
+ *
45
+ * @type {PipelineStepRunnerName}
46
+ * @memberof PipelineStep
47
+ */
48
+ runner: PipelineStepRunnerName;
49
+ /**
50
+ * The name of the Unix user on behalf of which the script will be executed
51
+ * @type {string}
52
+ * @memberof PipelineStep
53
+ */
54
+ run_as_user: string;
55
+ /**
56
+ * The relative order of the script execution in case the event has multiple scripts attached
57
+ * @type {number}
58
+ * @memberof PipelineStep
59
+ */
60
+ trigger_order: number;
61
+ /**
62
+ * The date and time when the record was created
63
+ * @type {string}
64
+ * @memberof PipelineStep
65
+ */
66
+ created_at?: string;
67
+ /**
68
+ * The date and time when the record was last updated
69
+ * @type {string}
70
+ * @memberof PipelineStep
71
+ */
72
+ updated_at?: string;
73
+ }
@@ -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,36 @@
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 ScriptRunner
16
+ */
17
+ export interface ScriptRunner {
18
+ /**
19
+ * How to call the runner in CLI
20
+ * @type {string}
21
+ * @memberof ScriptRunner
22
+ */
23
+ value: string;
24
+ /**
25
+ * The formatted name of the runner
26
+ * @type {string}
27
+ * @memberof ScriptRunner
28
+ */
29
+ human_readable: string;
30
+ /**
31
+ * A brief description about the runner
32
+ * @type {string}
33
+ * @memberof ScriptRunner
34
+ */
35
+ hint: string;
36
+ }
@@ -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 });
@@ -1,5 +1,7 @@
1
1
  import { PipelinesApiService } from "../api/generated/apis/pipelines-api";
2
2
  import { PipelinesResourcesApiService } from "../api/generated/apis/pipelines-resources-api";
3
+ import { PipelinesStepsApiService } from "../api/generated/apis/pipelines-steps-api";
3
4
  export declare class PipelineService extends PipelinesApiService {
4
5
  resources: PipelinesResourcesApiService;
6
+ steps: PipelinesStepsApiService;
5
7
  }
@@ -3,10 +3,12 @@ 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
5
  const pipelines_resources_api_1 = require("../api/generated/apis/pipelines-resources-api");
6
+ const pipelines_steps_api_1 = require("../api/generated/apis/pipelines-steps-api");
6
7
  class PipelineService extends pipelines_api_1.PipelinesApiService {
7
8
  constructor() {
8
9
  super(...arguments);
9
10
  this.resources = new pipelines_resources_api_1.PipelinesResourcesApiService();
11
+ this.steps = new pipelines_steps_api_1.PipelinesStepsApiService();
10
12
  }
11
13
  }
12
14
  exports.PipelineService = PipelineService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },