@devopness/sdk-js 2.32.0 → 2.34.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
@@ -74,25 +74,51 @@ getUserProfile();
74
74
  This package includes TypeScript declarations for every method.
75
75
  TypeScript versions `>= 3.8` are supported.
76
76
 
77
- Some methods in `Devopness SDK JavaScript` accept and return objects from the Devopness API. The type declarations for these objects will always track the latest version of the API. Therefore, if you'e using the latest version of this package, you can rely on the Devopness API documentation for checking the input and return types of each API endpoint.
77
+ >Some methods in `Devopness SDK JavaScript` accept and return objects from the Devopness API. The type declarations for these objects will always track the latest version of the API. Therefore, if you'e using the latest version of this package, you can rely on the Devopness API documentation for checking the input and return types of each API endpoint.
78
+
79
+ ## Development & Testing
80
+ To build and test the SDK locally, [**fork this repository**](https://github.com/devopness/devopness/fork) and follow these steps:
81
+
82
+ ### With Docker
83
+ #### Pre-requisites
84
+ - [Docker](https://www.docker.com/products/docker-desktop/)
85
+ - [make](https://www.gnu.org/software/make/)
86
+ - `make` is pre-installed in most Linux systems. In `macOS` it is included as part of the `Xcode` command line utils
87
+ ### Setup and run in local environment
88
+ #### 1. Build Docker Image
89
+ ```
90
+ make build-image
91
+ ```
92
+
93
+ #### 2. Install Dependencies
94
+ ```
95
+ make npm-ci
96
+ ```
78
97
 
79
- ## Building and testing
80
- To build and test the SDK locally, follow these steps:
81
- 1. Clone de repository
98
+ #### 3. Build SDK
82
99
  ```
83
- git clone https://github.com/devopness/devopness.git
100
+ make build-sdk-js
84
101
  ```
85
- 2. Install missing dependencies
86
102
 
87
- This command will install all modules listed as dependencies in [package.json](package.json). A working Java Runtime Environment is also required. Please, check out the installation instructions for your operating system.
103
+ #### 4. Run Tests
104
+ ```
105
+ make test
106
+ ```
107
+
108
+ ### Without Docker
109
+
110
+ #### 1. Install missing dependencies
111
+ This command will install all modules listed as dependencies in [package.json](package.json). **A working Java Runtime Environment is also required.** Please, check out the installation instructions for your operating system.
88
112
  ```
89
113
  npm install
90
114
  ```
91
- 3. Build
115
+
116
+ #### 2. Build SDK
92
117
  ```
93
- npm run build-api-models
118
+ npm run build
94
119
  ```
95
- 4. Run tests
120
+
121
+ #### 3. Run tests
96
122
  ```
97
123
  npm run test
98
124
  ```
@@ -11,7 +11,6 @@
11
11
  */
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
- import { EnvironmentLinkItem } from '../../generated/models';
15
14
  import { Server } from '../../generated/models';
16
15
  import { ServerEnvironmentCreate } from '../../generated/models';
17
16
  import { ServerRelation } from '../../generated/models';
@@ -26,14 +25,6 @@ export declare class EnvironmentsServersApiService extends ApiBaseService {
26
25
  * @param {ServerEnvironmentCreate} serverEnvironmentCreate A JSON object containing the resource data
27
26
  */
28
27
  addEnvironmentServer(environmentId: number, serverEnvironmentCreate: ServerEnvironmentCreate): Promise<ApiResponse<Server>>;
29
- /**
30
- *
31
- * @summary Link a server to an environment
32
- * @param {number} environmentId Unique ID of the environment
33
- * @param {number} serverId Unique ID of the server to be linked
34
- * @param {EnvironmentLinkItem} [environmentLinkItem] A JSON object containing environment server link optional parameters
35
- */
36
- linkServerToEnvironment(environmentId: number, serverId: number, environmentLinkItem?: EnvironmentLinkItem): Promise<ApiResponse<void>>;
37
28
  /**
38
29
  *
39
30
  * @summary Return a list of all servers belonging to a environment
@@ -42,18 +33,4 @@ export declare class EnvironmentsServersApiService extends ApiBaseService {
42
33
  * @param {number} [perPage] Number of items returned per page
43
34
  */
44
35
  listEnvironmentServers(environmentId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<ServerRelation>>>;
45
- /**
46
- *
47
- * @summary Replace all linked servers by new ones. Immediately deploying all changes to previously and newly linked servers
48
- * @param {number} environmentId Unique ID of the environment
49
- * @param {EnvironmentLinkItem} environmentLinkItem A JSON object containing environment server link parameters
50
- */
51
- replaceLinkedServers(environmentId: number, environmentLinkItem: EnvironmentLinkItem): Promise<ApiResponse<void>>;
52
- /**
53
- *
54
- * @summary Unlink/Remove a server from an environment
55
- * @param {number} environmentId Unique ID of the environment
56
- * @param {number} serverId Unique ID of the server to unlink
57
- */
58
- unlinkServerFromEnvironment(environmentId: number, serverId: number): Promise<ApiResponse<void>>;
59
36
  }
@@ -49,27 +49,6 @@ class EnvironmentsServersApiService extends ApiBaseService_1.ApiBaseService {
49
49
  return new ApiResponse_1.ApiResponse(response);
50
50
  });
51
51
  }
52
- /**
53
- *
54
- * @summary Link a server to an environment
55
- * @param {number} environmentId Unique ID of the environment
56
- * @param {number} serverId Unique ID of the server to be linked
57
- * @param {EnvironmentLinkItem} [environmentLinkItem] A JSON object containing environment server link optional parameters
58
- */
59
- linkServerToEnvironment(environmentId, serverId, environmentLinkItem) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- if (environmentId === null || environmentId === undefined) {
62
- throw new Exceptions_1.ArgumentNullException('environmentId', 'linkServerToEnvironment');
63
- }
64
- if (serverId === null || serverId === undefined) {
65
- throw new Exceptions_1.ArgumentNullException('serverId', 'linkServerToEnvironment');
66
- }
67
- let queryString = '';
68
- const requestUrl = '/environments/{environment_id}/servers/{server_id}/link' + (queryString ? `?${queryString}` : '');
69
- const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))).replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))), environmentLinkItem);
70
- return new ApiResponse_1.ApiResponse(response);
71
- });
72
- }
73
52
  /**
74
53
  *
75
54
  * @summary Return a list of all servers belonging to a environment
@@ -95,45 +74,5 @@ class EnvironmentsServersApiService extends ApiBaseService_1.ApiBaseService {
95
74
  return new ApiResponse_1.ApiResponse(response);
96
75
  });
97
76
  }
98
- /**
99
- *
100
- * @summary Replace all linked servers by new ones. Immediately deploying all changes to previously and newly linked servers
101
- * @param {number} environmentId Unique ID of the environment
102
- * @param {EnvironmentLinkItem} environmentLinkItem A JSON object containing environment server link parameters
103
- */
104
- replaceLinkedServers(environmentId, environmentLinkItem) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- if (environmentId === null || environmentId === undefined) {
107
- throw new Exceptions_1.ArgumentNullException('environmentId', 'replaceLinkedServers');
108
- }
109
- if (environmentLinkItem === null || environmentLinkItem === undefined) {
110
- throw new Exceptions_1.ArgumentNullException('environmentLinkItem', 'replaceLinkedServers');
111
- }
112
- let queryString = '';
113
- const requestUrl = '/environments/{environment_id}/servers/replace-linked-servers' + (queryString ? `?${queryString}` : '');
114
- const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))), environmentLinkItem);
115
- return new ApiResponse_1.ApiResponse(response);
116
- });
117
- }
118
- /**
119
- *
120
- * @summary Unlink/Remove a server from an environment
121
- * @param {number} environmentId Unique ID of the environment
122
- * @param {number} serverId Unique ID of the server to unlink
123
- */
124
- unlinkServerFromEnvironment(environmentId, serverId) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- if (environmentId === null || environmentId === undefined) {
127
- throw new Exceptions_1.ArgumentNullException('environmentId', 'unlinkServerFromEnvironment');
128
- }
129
- if (serverId === null || serverId === undefined) {
130
- throw new Exceptions_1.ArgumentNullException('serverId', 'unlinkServerFromEnvironment');
131
- }
132
- let queryString = '';
133
- const requestUrl = '/environments/{environment_id}/servers/{server_id}/unlink' + (queryString ? `?${queryString}` : '');
134
- const response = yield this.delete(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))).replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
135
- return new ApiResponse_1.ApiResponse(response);
136
- });
137
- }
138
77
  }
139
78
  exports.EnvironmentsServersApiService = EnvironmentsServersApiService;
@@ -135,5 +135,5 @@ export interface ApplicationEnvironmentCreate {
135
135
  * @type {Array<number>}
136
136
  * @memberof ApplicationEnvironmentCreate
137
137
  */
138
- servers?: Array<number>;
138
+ servers: Array<number>;
139
139
  }
@@ -185,12 +185,6 @@ export interface Application {
185
185
  * @memberof Application
186
186
  */
187
187
  environment: EnvironmentRelation;
188
- /**
189
- *
190
- * @type {Array<EnvironmentRelation>}
191
- * @memberof Application
192
- */
193
- environments: Array<EnvironmentRelation>;
194
188
  /**
195
189
  *
196
190
  * @type {Array<ServerRelation>}
@@ -50,5 +50,5 @@ export interface CronJobEnvironmentCreate {
50
50
  * @type {Array<number>}
51
51
  * @memberof CronJobEnvironmentCreate
52
52
  */
53
- servers?: Array<number>;
53
+ servers: Array<number>;
54
54
  }
@@ -56,5 +56,5 @@ export interface CronJobUpdate {
56
56
  * @type {Array<number>}
57
57
  * @memberof CronJobUpdate
58
58
  */
59
- servers?: Array<number>;
59
+ servers: Array<number>;
60
60
  }
@@ -90,10 +90,10 @@ export interface CronJob {
90
90
  project: ProjectRelation | null;
91
91
  /**
92
92
  *
93
- * @type {Array<EnvironmentRelation>}
93
+ * @type {EnvironmentRelation}
94
94
  * @memberof CronJob
95
95
  */
96
- environments: Array<EnvironmentRelation>;
96
+ environment: EnvironmentRelation;
97
97
  /**
98
98
  *
99
99
  * @type {Array<ServerRelation>}
@@ -50,5 +50,5 @@ export interface DaemonEnvironmentCreate {
50
50
  * @type {Array<number>}
51
51
  * @memberof DaemonEnvironmentCreate
52
52
  */
53
- servers?: Array<number>;
53
+ servers: Array<number>;
54
54
  }
@@ -62,5 +62,5 @@ export interface DaemonUpdate {
62
62
  * @type {Array<number>}
63
63
  * @memberof DaemonUpdate
64
64
  */
65
- servers?: Array<number>;
65
+ servers: Array<number>;
66
66
  }
@@ -86,12 +86,6 @@ export interface Daemon {
86
86
  * @memberof Daemon
87
87
  */
88
88
  environment: EnvironmentRelation;
89
- /**
90
- *
91
- * @type {Array<EnvironmentRelation>}
92
- * @memberof Daemon
93
- */
94
- environments: Array<EnvironmentRelation>;
95
89
  /**
96
90
  *
97
91
  * @type {Array<ServerRelation>}
@@ -64,5 +64,5 @@ export interface NetworkRuleEnvironmentCreate {
64
64
  * @type {Array<number>}
65
65
  * @memberof NetworkRuleEnvironmentCreate
66
66
  */
67
- servers?: Array<number>;
67
+ servers: Array<number>;
68
68
  }
@@ -58,5 +58,5 @@ export interface NetworkRuleUpdate {
58
58
  * @type {Array<number>}
59
59
  * @memberof NetworkRuleUpdate
60
60
  */
61
- servers?: Array<number>;
61
+ servers: Array<number>;
62
62
  }
@@ -93,12 +93,6 @@ export interface NetworkRule {
93
93
  * @memberof NetworkRule
94
94
  */
95
95
  environment: EnvironmentRelation;
96
- /**
97
- *
98
- * @type {Array<EnvironmentRelation>}
99
- * @memberof NetworkRule
100
- */
101
- environments: Array<EnvironmentRelation>;
102
96
  /**
103
97
  *
104
98
  * @type {Array<ServerRelation>}
@@ -111,12 +111,6 @@ export interface Server {
111
111
  * @memberof Server
112
112
  */
113
113
  environment: EnvironmentRelation;
114
- /**
115
- *
116
- * @type {Array<EnvironmentRelation>}
117
- * @memberof Server
118
- */
119
- environments: Array<EnvironmentRelation>;
120
114
  /**
121
115
  * The date and time when the record was created
122
116
  * @type {string}
@@ -46,5 +46,5 @@ export interface ServiceEnvironmentCreate {
46
46
  * @type {Array<number>}
47
47
  * @memberof ServiceEnvironmentCreate
48
48
  */
49
- servers?: Array<number>;
49
+ servers: Array<number>;
50
50
  }
@@ -26,5 +26,5 @@ export interface ServiceUpdate {
26
26
  * @type {Array<number>}
27
27
  * @memberof ServiceUpdate
28
28
  */
29
- servers?: Array<number>;
29
+ servers: Array<number>;
30
30
  }
@@ -81,12 +81,6 @@ export interface Service {
81
81
  * @memberof Service
82
82
  */
83
83
  environment: EnvironmentRelation;
84
- /**
85
- *
86
- * @type {Array<EnvironmentRelation>}
87
- * @memberof Service
88
- */
89
- environments: Array<EnvironmentRelation>;
90
84
  /**
91
85
  *
92
86
  * @type {UserRelation}
@@ -32,5 +32,5 @@ export interface SshKeyEnvironmentCreate {
32
32
  * @type {Array<number>}
33
33
  * @memberof SshKeyEnvironmentCreate
34
34
  */
35
- servers?: Array<number>;
35
+ servers: Array<number>;
36
36
  }
@@ -32,5 +32,5 @@ export interface SshKeyUpdate {
32
32
  * @type {Array<number>}
33
33
  * @memberof SshKeyUpdate
34
34
  */
35
- servers?: Array<number>;
35
+ servers: Array<number>;
36
36
  }
@@ -63,10 +63,10 @@ export interface SshKey {
63
63
  created_by_user: UserRelation;
64
64
  /**
65
65
  *
66
- * @type {Array<EnvironmentRelation>}
66
+ * @type {EnvironmentRelation}
67
67
  * @memberof SshKey
68
68
  */
69
- environments: Array<EnvironmentRelation>;
69
+ environment: EnvironmentRelation;
70
70
  /**
71
71
  *
72
72
  * @type {Array<ServerRelation>}
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { UserRelation } from './user-relation';
12
13
  import { VariableTarget } from './variable-target';
13
14
  import { VariableType } from './variable-type';
14
15
  /**
@@ -71,6 +72,12 @@ export interface VariableRelation {
71
72
  * @memberof VariableRelation
72
73
  */
73
74
  hidden: boolean;
75
+ /**
76
+ *
77
+ * @type {UserRelation}
78
+ * @memberof VariableRelation
79
+ */
80
+ created_by_user: UserRelation;
74
81
  /**
75
82
  * The date and time when the record was created
76
83
  * @type {string}
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { UserRelation } from './user-relation';
12
13
  import { VariableTarget } from './variable-target';
13
14
  import { VariableType } from './variable-type';
14
15
  /**
@@ -71,6 +72,12 @@ export interface Variable {
71
72
  * @memberof Variable
72
73
  */
73
74
  hidden: boolean;
75
+ /**
76
+ *
77
+ * @type {UserRelation}
78
+ * @memberof Variable
79
+ */
80
+ created_by_user: UserRelation;
74
81
  /**
75
82
  * The date and time when the record was created
76
83
  * @type {string}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.32.0",
3
+ "version": "2.34.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },