@devopness/sdk-js 2.60.0 → 2.62.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/README.md CHANGED
@@ -89,22 +89,27 @@ To build and test the SDK locally, [**fork this repository**](https://github.com
89
89
  xcode-select --install
90
90
  ```
91
91
  ### Setup and run in local environment
92
- #### 1. Build Docker Image
92
+ #### 1. Navigate to the project directory
93
+ ```shell
94
+ cd packages/sdks/javascript/
95
+ ```
96
+
97
+ #### 2. Build Docker Image
93
98
  ```
94
99
  make build-image
95
100
  ```
96
101
 
97
- #### 2. Install Dependencies
102
+ #### 3. Install Dependencies
98
103
  ```
99
104
  make npm-ci
100
105
  ```
101
106
 
102
- #### 3. Build SDK
107
+ #### 4. Build SDK
103
108
  ```
104
109
  make build-sdk-js
105
110
  ```
106
111
 
107
- #### 4. Run Tests
112
+ #### 5. Run Tests
108
113
  ```
109
114
  make test
110
115
  ```
@@ -112,7 +117,7 @@ make test
112
117
  ### Without Docker
113
118
  Installing on ``Linux`` or ``macOS`` systems.
114
119
 
115
- #### 1. Navigate to the project directory!
120
+ #### 1. Navigate to the project directory
116
121
  ```shell
117
122
  cd packages/sdks/javascript/
118
123
  ```
@@ -17,6 +17,12 @@ import { EnvironmentUpdate } from '../../generated/models';
17
17
  * EnvironmentsApiService - Auto-generated
18
18
  */
19
19
  export declare class EnvironmentsApiService extends ApiBaseService {
20
+ /**
21
+ *
22
+ * @summary Archive an environment
23
+ * @param {number} environmentId The ID of the environment.
24
+ */
25
+ archiveEnvironment(environmentId: number): Promise<ApiResponse<void>>;
20
26
  /**
21
27
  *
22
28
  * @summary Delete a given environment
@@ -29,6 +35,12 @@ export declare class EnvironmentsApiService extends ApiBaseService {
29
35
  * @param {number} environmentId The ID of the environment.
30
36
  */
31
37
  getEnvironment(environmentId: number): Promise<ApiResponse<Environment>>;
38
+ /**
39
+ *
40
+ * @summary Unarchive an environment
41
+ * @param {number} environmentId The ID of the environment.
42
+ */
43
+ unarchiveEnvironment(environmentId: number): Promise<ApiResponse<void>>;
32
44
  /**
33
45
  *
34
46
  * @summary Update a given environment
@@ -29,6 +29,22 @@ const Exceptions_1 = require("../../../common/Exceptions");
29
29
  * EnvironmentsApiService - Auto-generated
30
30
  */
31
31
  class EnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary Archive an environment
35
+ * @param {number} environmentId The ID of the environment.
36
+ */
37
+ archiveEnvironment(environmentId) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ if (environmentId === null || environmentId === undefined) {
40
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'archiveEnvironment');
41
+ }
42
+ let queryString = '';
43
+ const requestUrl = '/environments/{environment_id}/archive' + (queryString ? `?${queryString}` : '');
44
+ const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
45
+ return new ApiResponse_1.ApiResponse(response);
46
+ });
47
+ }
32
48
  /**
33
49
  *
34
50
  * @summary Delete a given environment
@@ -61,6 +77,22 @@ class EnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
61
77
  return new ApiResponse_1.ApiResponse(response);
62
78
  });
63
79
  }
80
+ /**
81
+ *
82
+ * @summary Unarchive an environment
83
+ * @param {number} environmentId The ID of the environment.
84
+ */
85
+ unarchiveEnvironment(environmentId) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ if (environmentId === null || environmentId === undefined) {
88
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'unarchiveEnvironment');
89
+ }
90
+ let queryString = '';
91
+ const requestUrl = '/environments/{environment_id}/unarchive' + (queryString ? `?${queryString}` : '');
92
+ const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
93
+ return new ApiResponse_1.ApiResponse(response);
94
+ });
95
+ }
64
96
  /**
65
97
  *
66
98
  * @summary Update a given environment
@@ -0,0 +1,27 @@
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 { ArchivedEnvironmentRelation } from '../../generated/models';
15
+ /**
16
+ * ProjectsArchivedEnvironmentsApiService - Auto-generated
17
+ */
18
+ export declare class ProjectsArchivedEnvironmentsApiService extends ApiBaseService {
19
+ /**
20
+ *
21
+ * @summary Return a list of all archived environments belonging to a project
22
+ * @param {number} projectId The ID of the project.
23
+ * @param {number} [page] Number of the page to be retrieved
24
+ * @param {number} [perPage] Number of items returned per page
25
+ */
26
+ listProjectArchivedEnvironments(projectId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<ArchivedEnvironmentRelation>>>;
27
+ }
@@ -0,0 +1,58 @@
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.ProjectsArchivedEnvironmentsApiService = 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
+ * ProjectsArchivedEnvironmentsApiService - Auto-generated
30
+ */
31
+ class ProjectsArchivedEnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary Return a list of all archived environments belonging to a project
35
+ * @param {number} projectId The ID of the project.
36
+ * @param {number} [page] Number of the page to be retrieved
37
+ * @param {number} [perPage] Number of items returned per page
38
+ */
39
+ listProjectArchivedEnvironments(projectId, page, perPage) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ if (projectId === null || projectId === undefined) {
42
+ throw new Exceptions_1.ArgumentNullException('projectId', 'listProjectArchivedEnvironments');
43
+ }
44
+ let queryString = '';
45
+ const queryParams = { page: page, per_page: perPage, };
46
+ for (const key in queryParams) {
47
+ if (queryParams[key] === undefined || queryParams[key] === null) {
48
+ continue;
49
+ }
50
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
51
+ }
52
+ const requestUrl = '/projects/{project_id}/environments/archived' + (queryString ? `?${queryString}` : '');
53
+ const response = yield this.get(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))));
54
+ return new ApiResponse_1.ApiResponse(response);
55
+ });
56
+ }
57
+ }
58
+ exports.ProjectsArchivedEnvironmentsApiService = ProjectsArchivedEnvironmentsApiService;
@@ -25,6 +25,12 @@ export declare class ServersApiService extends ApiBaseService {
25
25
  * @param {number} serverId The ID of the server.
26
26
  */
27
27
  connectServer(activationToken: string, serverId: number): Promise<ApiResponse<string>>;
28
+ /**
29
+ *
30
+ * @summary Delete a given server
31
+ * @param {number} serverId The ID of the server.
32
+ */
33
+ deleteServer(serverId: number): Promise<ApiResponse<void>>;
28
34
  /**
29
35
  *
30
36
  * @summary Get a server by ID
@@ -37,6 +43,30 @@ export declare class ServersApiService extends ApiBaseService {
37
43
  * @param {number} serverId The ID of the server.
38
44
  */
39
45
  getServerCommands(serverId: number): Promise<ApiResponse<ServerCommand>>;
46
+ /**
47
+ *
48
+ * @summary Get current status of the server on the cloud provider
49
+ * @param {number} serverId The ID of the server.
50
+ */
51
+ getStatusServer(serverId: number): Promise<ApiResponse<void>>;
52
+ /**
53
+ *
54
+ * @summary Restart a current running server
55
+ * @param {number} serverId The ID of the server.
56
+ */
57
+ restartServer(serverId: number): Promise<ApiResponse<void>>;
58
+ /**
59
+ *
60
+ * @summary Start a previously stopped server
61
+ * @param {number} serverId The ID of the server.
62
+ */
63
+ startServer(serverId: number): Promise<ApiResponse<void>>;
64
+ /**
65
+ *
66
+ * @summary Stop a running server
67
+ * @param {number} serverId The ID of the server.
68
+ */
69
+ stopServer(serverId: number): Promise<ApiResponse<void>>;
40
70
  /**
41
71
  *
42
72
  * @summary Update an existing server
@@ -49,6 +49,22 @@ class ServersApiService extends ApiBaseService_1.ApiBaseService {
49
49
  return new ApiResponse_1.ApiResponse(response);
50
50
  });
51
51
  }
52
+ /**
53
+ *
54
+ * @summary Delete a given server
55
+ * @param {number} serverId The ID of the server.
56
+ */
57
+ deleteServer(serverId) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ if (serverId === null || serverId === undefined) {
60
+ throw new Exceptions_1.ArgumentNullException('serverId', 'deleteServer');
61
+ }
62
+ let queryString = '';
63
+ const requestUrl = '/servers/{server_id}' + (queryString ? `?${queryString}` : '');
64
+ const response = yield this.delete(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
65
+ return new ApiResponse_1.ApiResponse(response);
66
+ });
67
+ }
52
68
  /**
53
69
  *
54
70
  * @summary Get a server by ID
@@ -81,6 +97,70 @@ class ServersApiService extends ApiBaseService_1.ApiBaseService {
81
97
  return new ApiResponse_1.ApiResponse(response);
82
98
  });
83
99
  }
100
+ /**
101
+ *
102
+ * @summary Get current status of the server on the cloud provider
103
+ * @param {number} serverId The ID of the server.
104
+ */
105
+ getStatusServer(serverId) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ if (serverId === null || serverId === undefined) {
108
+ throw new Exceptions_1.ArgumentNullException('serverId', 'getStatusServer');
109
+ }
110
+ let queryString = '';
111
+ const requestUrl = '/servers/{server_id}/get-status' + (queryString ? `?${queryString}` : '');
112
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
113
+ return new ApiResponse_1.ApiResponse(response);
114
+ });
115
+ }
116
+ /**
117
+ *
118
+ * @summary Restart a current running server
119
+ * @param {number} serverId The ID of the server.
120
+ */
121
+ restartServer(serverId) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ if (serverId === null || serverId === undefined) {
124
+ throw new Exceptions_1.ArgumentNullException('serverId', 'restartServer');
125
+ }
126
+ let queryString = '';
127
+ const requestUrl = '/servers/{server_id}/restart' + (queryString ? `?${queryString}` : '');
128
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
129
+ return new ApiResponse_1.ApiResponse(response);
130
+ });
131
+ }
132
+ /**
133
+ *
134
+ * @summary Start a previously stopped server
135
+ * @param {number} serverId The ID of the server.
136
+ */
137
+ startServer(serverId) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ if (serverId === null || serverId === undefined) {
140
+ throw new Exceptions_1.ArgumentNullException('serverId', 'startServer');
141
+ }
142
+ let queryString = '';
143
+ const requestUrl = '/servers/{server_id}/start' + (queryString ? `?${queryString}` : '');
144
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
145
+ return new ApiResponse_1.ApiResponse(response);
146
+ });
147
+ }
148
+ /**
149
+ *
150
+ * @summary Stop a running server
151
+ * @param {number} serverId The ID of the server.
152
+ */
153
+ stopServer(serverId) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ if (serverId === null || serverId === undefined) {
156
+ throw new Exceptions_1.ArgumentNullException('serverId', 'stopServer');
157
+ }
158
+ let queryString = '';
159
+ const requestUrl = '/servers/{server_id}/stop' + (queryString ? `?${queryString}` : '');
160
+ const response = yield this.post(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
161
+ return new ApiResponse_1.ApiResponse(response);
162
+ });
163
+ }
84
164
  /**
85
165
  *
86
166
  * @summary Update an existing server
@@ -0,0 +1,61 @@
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 { EnvironmentType } from './environment-type';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface ArchivedEnvironmentRelation
17
+ */
18
+ export interface ArchivedEnvironmentRelation {
19
+ /**
20
+ * Unique id of the given record
21
+ * @type {number}
22
+ * @memberof ArchivedEnvironmentRelation
23
+ */
24
+ id: number;
25
+ /**
26
+ * Environment\'s name
27
+ * @type {string}
28
+ * @memberof ArchivedEnvironmentRelation
29
+ */
30
+ name: string;
31
+ /**
32
+ *
33
+ * @type {EnvironmentType}
34
+ * @memberof ArchivedEnvironmentRelation
35
+ */
36
+ type: EnvironmentType;
37
+ /**
38
+ * The human readable version of the type
39
+ * @type {string}
40
+ * @memberof ArchivedEnvironmentRelation
41
+ */
42
+ type_human_readable: string;
43
+ /**
44
+ * The date and time when the record was created
45
+ * @type {string}
46
+ * @memberof ArchivedEnvironmentRelation
47
+ */
48
+ created_at: string;
49
+ /**
50
+ * The date and time when the record was last updated
51
+ * @type {string}
52
+ * @memberof ArchivedEnvironmentRelation
53
+ */
54
+ updated_at: string;
55
+ /**
56
+ * The date and time when the record was archived
57
+ * @type {string}
58
+ * @memberof ArchivedEnvironmentRelation
59
+ */
60
+ archived_at: string | null;
61
+ }
@@ -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 });
@@ -52,4 +52,10 @@ export interface EnvironmentRelation {
52
52
  * @memberof EnvironmentRelation
53
53
  */
54
54
  updated_at: string;
55
+ /**
56
+ * The date and time when the record was archived
57
+ * @type {string}
58
+ * @memberof EnvironmentRelation
59
+ */
60
+ archived_at: string | null;
55
61
  }
@@ -25,6 +25,7 @@ export * from './application-pipeline';
25
25
  export * from './application-relation';
26
26
  export * from './application-type';
27
27
  export * from './application-update';
28
+ export * from './archived-environment-relation';
28
29
  export * from './blueprint-service';
29
30
  export * from './cloud-aws-ec2-settings';
30
31
  export * from './cloud-digital-ocean-droplet-settings';
@@ -41,6 +41,7 @@ __exportStar(require("./application-pipeline"), exports);
41
41
  __exportStar(require("./application-relation"), exports);
42
42
  __exportStar(require("./application-type"), exports);
43
43
  __exportStar(require("./application-update"), exports);
44
+ __exportStar(require("./archived-environment-relation"), exports);
44
45
  __exportStar(require("./blueprint-service"), exports);
45
46
  __exportStar(require("./cloud-aws-ec2-settings"), exports);
46
47
  __exportStar(require("./cloud-digital-ocean-droplet-settings"), exports);
@@ -3,8 +3,10 @@ import { ProjectsActionsApiService } from '../api/generated/apis/projects-action
3
3
  import { ProjectsEnvironmentsApiService } from '../api/generated/apis/projects-environments-api';
4
4
  import { ProjectsRolesApiService } from '../api/generated/apis/projects-roles-api';
5
5
  import { ProjectsTeamsApiService } from '../api/generated/apis/projects-teams-api';
6
+ import { ProjectsArchivedEnvironmentsApiService } from '../api/generated/apis/projects-archived-environments-api';
6
7
  export declare class ProjectService extends ProjectsApiService {
7
8
  actions: ProjectsActionsApiService;
9
+ archivedEnvironments: ProjectsArchivedEnvironmentsApiService;
8
10
  environments: ProjectsEnvironmentsApiService;
9
11
  roles: ProjectsRolesApiService;
10
12
  teams: ProjectsTeamsApiService;
@@ -6,10 +6,12 @@ const projects_actions_api_1 = require("../api/generated/apis/projects-actions-a
6
6
  const projects_environments_api_1 = require("../api/generated/apis/projects-environments-api");
7
7
  const projects_roles_api_1 = require("../api/generated/apis/projects-roles-api");
8
8
  const projects_teams_api_1 = require("../api/generated/apis/projects-teams-api");
9
+ const projects_archived_environments_api_1 = require("../api/generated/apis/projects-archived-environments-api");
9
10
  class ProjectService extends projects_api_1.ProjectsApiService {
10
11
  constructor() {
11
12
  super(...arguments);
12
13
  this.actions = new projects_actions_api_1.ProjectsActionsApiService();
14
+ this.archivedEnvironments = new projects_archived_environments_api_1.ProjectsArchivedEnvironmentsApiService();
13
15
  this.environments = new projects_environments_api_1.ProjectsEnvironmentsApiService();
14
16
  this.roles = new projects_roles_api_1.ProjectsRolesApiService();
15
17
  this.teams = new projects_teams_api_1.ProjectsTeamsApiService();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.60.0",
3
+ "version": "2.62.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },