@devopness/sdk-js 1.101.1 → 1.102.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
@@ -1,19 +1,11 @@
1
1
  # Devopness SDK - JavaScript
2
2
 
3
- [![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/devopness/devopness-sdk-js/blob/master/LICENSE)
4
- ![CI](https://github.com/devopness/sdk-js/workflows/CI/badge.svg)
5
-
6
3
  [![NPM](https://nodei.co/npm/@devopness/sdk-js.png?downloads=true&stars=true)](https://nodei.co/npm/@devopness/sdk-js/)
7
4
 
8
5
  The official Devopness SDK for JavaScript, available for browsers, mobile devices and `Node.js` backends.
9
6
 
10
7
  Devopness SDK includes a pre-defined set of classes that provide convenient access to Devopness platform data. This SDK aims to make it easy and fun to consume Devopness API resources from web, Node.js or mobile apps written in the JavaScript programming language.
11
8
 
12
- ## About Devopness
13
- `Devopness` aims to drastically change the way software developers deploy applications and manage on-premise and cloud servers in a secure and performant fashion.
14
-
15
- By streamlining essential DevOps practices we're making first class software deployment and server management tools accessible and affordable to every developer in the world.
16
-
17
9
  ## Usage
18
10
 
19
11
  ### Install/Upgrade
@@ -57,7 +49,7 @@ async function authenticate(email, pass) {
57
49
  authenticate('user@email.com', 'secret-password');
58
50
  ```
59
51
 
60
- In the example above, `userTokens` is a instance of `ApiResponse` and the `data` property has the data requested from the API. See [ApiResponse.ts](https://github.com/devopness/devopness-sdk-js/blob/master/src/common/ApiResponse.ts) for reference.
52
+ In the example above, `userTokens` is a instance of `ApiResponse` and the `data` property has the data requested from the API. See [ApiResponse.ts](https://github.com/devopness/devopness/blob/master/src/common/ApiResponse.ts) for reference.
61
53
 
62
54
  ### Invoking authentication protected endpoints
63
55
  Once an authentication token is set, any protected endpoint can be invoked.
@@ -88,7 +80,7 @@ Some methods in `Devopness SDK JavaScript` accept and return objects from the De
88
80
  To build and test the SDK locally, follow these steps:
89
81
  1. Clone de repository
90
82
  ```
91
- git clone https://github.com/devopness/devopness-sdk-js.git
83
+ git clone https://github.com/devopness/devopness.git
92
84
  ```
93
85
  2. Install missing dependencies
94
86
 
@@ -13,6 +13,7 @@ import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Action } from '../../generated/models';
15
15
  import { ActionListItem } from '../../generated/models';
16
+ import { ActionType } from '../../generated/models';
16
17
  /**
17
18
  * ActionsApiService - Auto-generated
18
19
  */
@@ -30,4 +31,29 @@ export declare class ActionsApiService extends ApiBaseService {
30
31
  * @param {number} [perPage] Number of items returned per page
31
32
  */
32
33
  listActions(page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
34
+ /**
35
+ *
36
+ * @summary List resource actions
37
+ * @param {string} resourceType The resource type to get related actions
38
+ * @param {number} resourceId Unique ID of the resource that is being searched
39
+ * @param {number} [page] Number of the page to be retrieved
40
+ * @param {number} [perPage] Number of items returned per page
41
+ */
42
+ listResourceActions(resourceType: string, resourceId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
43
+ /**
44
+ *
45
+ * @summary List resource actions of an action type
46
+ * @param {string} resourceType The resource type to get related actions
47
+ * @param {number} resourceId Unique ID of the resource that is being searched
48
+ * @param {ActionType} actionType The action type
49
+ * @param {number} [page] Number of the page to be retrieved
50
+ * @param {number} [perPage] Number of items returned per page
51
+ */
52
+ listResourceActionsOfResourceTypeActionType(resourceType: string, resourceId: number, actionType: ActionType, page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
53
+ /**
54
+ *
55
+ * @summary Retry an action
56
+ * @param {number} actionId Numeric ID of the action to be retried
57
+ */
58
+ retryAction(actionId: number): Promise<ApiResponse<Action>>;
33
59
  }
@@ -66,5 +66,83 @@ class ActionsApiService extends ApiBaseService_1.ApiBaseService {
66
66
  return new ApiResponse_1.ApiResponse(response);
67
67
  });
68
68
  }
69
+ /**
70
+ *
71
+ * @summary List resource actions
72
+ * @param {string} resourceType The resource type to get related actions
73
+ * @param {number} resourceId Unique ID of the resource that is being searched
74
+ * @param {number} [page] Number of the page to be retrieved
75
+ * @param {number} [perPage] Number of items returned per page
76
+ */
77
+ listResourceActions(resourceType, resourceId, page, perPage) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ if (resourceType === null || resourceType === undefined) {
80
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listResourceActions');
81
+ }
82
+ if (resourceId === null || resourceId === undefined) {
83
+ throw new Exceptions_1.ArgumentNullException('resourceId', 'listResourceActions');
84
+ }
85
+ let queryString = '';
86
+ const queryParams = { page: page, per_page: perPage, };
87
+ for (const key in queryParams) {
88
+ if (queryParams[key] === undefined || queryParams[key] === null) {
89
+ continue;
90
+ }
91
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
92
+ }
93
+ const requestUrl = '/actions/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
94
+ const response = yield this.get(requestUrl.replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))));
95
+ return new ApiResponse_1.ApiResponse(response);
96
+ });
97
+ }
98
+ /**
99
+ *
100
+ * @summary List resource actions of an action type
101
+ * @param {string} resourceType The resource type to get related actions
102
+ * @param {number} resourceId Unique ID of the resource that is being searched
103
+ * @param {ActionType} actionType The action type
104
+ * @param {number} [page] Number of the page to be retrieved
105
+ * @param {number} [perPage] Number of items returned per page
106
+ */
107
+ listResourceActionsOfResourceTypeActionType(resourceType, resourceId, actionType, page, perPage) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ if (resourceType === null || resourceType === undefined) {
110
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listResourceActionsOfResourceTypeActionType');
111
+ }
112
+ if (resourceId === null || resourceId === undefined) {
113
+ throw new Exceptions_1.ArgumentNullException('resourceId', 'listResourceActionsOfResourceTypeActionType');
114
+ }
115
+ if (actionType === null || actionType === undefined) {
116
+ throw new Exceptions_1.ArgumentNullException('actionType', 'listResourceActionsOfResourceTypeActionType');
117
+ }
118
+ let queryString = '';
119
+ const queryParams = { page: page, per_page: perPage, };
120
+ for (const key in queryParams) {
121
+ if (queryParams[key] === undefined || queryParams[key] === null) {
122
+ continue;
123
+ }
124
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
125
+ }
126
+ const requestUrl = '/actions/{resource_type}/{resource_id}/{action_type}' + (queryString ? `?${queryString}` : '');
127
+ const response = yield this.get(requestUrl.replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))).replace(`{${"action_type"}}`, encodeURIComponent(String(actionType))));
128
+ return new ApiResponse_1.ApiResponse(response);
129
+ });
130
+ }
131
+ /**
132
+ *
133
+ * @summary Retry an action
134
+ * @param {number} actionId Numeric ID of the action to be retried
135
+ */
136
+ retryAction(actionId) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ if (actionId === null || actionId === undefined) {
139
+ throw new Exceptions_1.ArgumentNullException('actionId', 'retryAction');
140
+ }
141
+ let queryString = '';
142
+ const requestUrl = '/actions/{action_id}/retry' + (queryString ? `?${queryString}` : '');
143
+ const response = yield this.post(requestUrl.replace(`{${"action_id"}}`, encodeURIComponent(String(actionId))));
144
+ return new ApiResponse_1.ApiResponse(response);
145
+ });
146
+ }
69
147
  }
70
148
  exports.ActionsApiService = ActionsApiService;
@@ -0,0 +1,28 @@
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 { ActionListItem } from '../../generated/models';
15
+ /**
16
+ * EnvironmentsActionsApiService - Auto-generated
17
+ */
18
+ export declare class EnvironmentsActionsApiService extends ApiBaseService {
19
+ /**
20
+ *
21
+ * @summary List environment actions of a resource type
22
+ * @param {number} environmentId Unique ID of the environment to get
23
+ * @param {string} resourceType The resource type to get related actions
24
+ * @param {number} [page] Number of the page to be retrieved
25
+ * @param {number} [perPage] Number of items returned per page
26
+ */
27
+ listEnvironmentActionsOfResourceType(environmentId: number, resourceType: string, page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
28
+ }
@@ -0,0 +1,62 @@
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.EnvironmentsActionsApiService = 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
+ * EnvironmentsActionsApiService - Auto-generated
30
+ */
31
+ class EnvironmentsActionsApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary List environment actions of a resource type
35
+ * @param {number} environmentId Unique ID of the environment to get
36
+ * @param {string} resourceType The resource type to get related actions
37
+ * @param {number} [page] Number of the page to be retrieved
38
+ * @param {number} [perPage] Number of items returned per page
39
+ */
40
+ listEnvironmentActionsOfResourceType(environmentId, resourceType, page, perPage) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ if (environmentId === null || environmentId === undefined) {
43
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'listEnvironmentActionsOfResourceType');
44
+ }
45
+ if (resourceType === null || resourceType === undefined) {
46
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listEnvironmentActionsOfResourceType');
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 = '/environments/{environment_id}/actions/{resource_type}' + (queryString ? `?${queryString}` : '');
57
+ const response = yield this.get(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))));
58
+ return new ApiResponse_1.ApiResponse(response);
59
+ });
60
+ }
61
+ }
62
+ exports.EnvironmentsActionsApiService = EnvironmentsActionsApiService;
@@ -0,0 +1,39 @@
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 { ActionListItem } from '../../generated/models';
15
+ import { ActionType } from '../../generated/models';
16
+ /**
17
+ * ProjectsActionsApiService - Auto-generated
18
+ */
19
+ export declare class ProjectsActionsApiService extends ApiBaseService {
20
+ /**
21
+ *
22
+ * @summary List resource actions of a resource type
23
+ * @param {number} projectId Unique ID of the project to get
24
+ * @param {string} resourceType The resource type to get related actions
25
+ * @param {number} [page] Number of the page to be retrieved
26
+ * @param {number} [perPage] Number of items returned per page
27
+ */
28
+ listProjectActionsOfResourceType(projectId: number, resourceType: string, page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
29
+ /**
30
+ *
31
+ * @summary List project actions of a resource type and action type
32
+ * @param {number} projectId Unique ID of the project to get
33
+ * @param {string} resourceType The resource type to get related actions
34
+ * @param {ActionType} actionType The action type
35
+ * @param {number} [page] Number of the page to be retrieved
36
+ * @param {number} [perPage] Number of items returned per page
37
+ */
38
+ listProjectActionsOfResourceTypeActionType(projectId: number, resourceType: string, actionType: ActionType, page?: number, perPage?: number): Promise<ApiResponse<Array<ActionListItem>>>;
39
+ }
@@ -0,0 +1,95 @@
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.ProjectsActionsApiService = 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
+ * ProjectsActionsApiService - Auto-generated
30
+ */
31
+ class ProjectsActionsApiService extends ApiBaseService_1.ApiBaseService {
32
+ /**
33
+ *
34
+ * @summary List resource actions of a resource type
35
+ * @param {number} projectId Unique ID of the project to get
36
+ * @param {string} resourceType The resource type to get related actions
37
+ * @param {number} [page] Number of the page to be retrieved
38
+ * @param {number} [perPage] Number of items returned per page
39
+ */
40
+ listProjectActionsOfResourceType(projectId, resourceType, page, perPage) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ if (projectId === null || projectId === undefined) {
43
+ throw new Exceptions_1.ArgumentNullException('projectId', 'listProjectActionsOfResourceType');
44
+ }
45
+ if (resourceType === null || resourceType === undefined) {
46
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listProjectActionsOfResourceType');
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 = '/projects/{project_id}/actions/{resource_type}' + (queryString ? `?${queryString}` : '');
57
+ const response = yield this.get(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))));
58
+ return new ApiResponse_1.ApiResponse(response);
59
+ });
60
+ }
61
+ /**
62
+ *
63
+ * @summary List project actions of a resource type and action type
64
+ * @param {number} projectId Unique ID of the project to get
65
+ * @param {string} resourceType The resource type to get related actions
66
+ * @param {ActionType} actionType The action type
67
+ * @param {number} [page] Number of the page to be retrieved
68
+ * @param {number} [perPage] Number of items returned per page
69
+ */
70
+ listProjectActionsOfResourceTypeActionType(projectId, resourceType, actionType, page, perPage) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ if (projectId === null || projectId === undefined) {
73
+ throw new Exceptions_1.ArgumentNullException('projectId', 'listProjectActionsOfResourceTypeActionType');
74
+ }
75
+ if (resourceType === null || resourceType === undefined) {
76
+ throw new Exceptions_1.ArgumentNullException('resourceType', 'listProjectActionsOfResourceTypeActionType');
77
+ }
78
+ if (actionType === null || actionType === undefined) {
79
+ throw new Exceptions_1.ArgumentNullException('actionType', 'listProjectActionsOfResourceTypeActionType');
80
+ }
81
+ let queryString = '';
82
+ const queryParams = { page: page, per_page: perPage, };
83
+ for (const key in queryParams) {
84
+ if (queryParams[key] === undefined || queryParams[key] === null) {
85
+ continue;
86
+ }
87
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
88
+ }
89
+ const requestUrl = '/projects/{project_id}/actions/{resource_type}/{action_type}' + (queryString ? `?${queryString}` : '');
90
+ const response = yield this.get(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))).replace(`{${"action_type"}}`, encodeURIComponent(String(actionType))));
91
+ return new ApiResponse_1.ApiResponse(response);
92
+ });
93
+ }
94
+ }
95
+ exports.ProjectsActionsApiService = ProjectsActionsApiService;
@@ -20,7 +20,7 @@ export declare class ResourceEventsApiService extends ApiBaseService {
20
20
  *
21
21
  * @summary Return a list of all events belonging to a resource
22
22
  * @param {string} resourceType The resource type to get related events
23
- * @param {number} resourceId Unique ID of the resource that\&#39;s being searched
23
+ * @param {number} resourceId Unique ID of the resource that is being searched
24
24
  * @param {number} [page] Number of the page to be retrieved
25
25
  * @param {number} [perPage] Number of items returned per page
26
26
  */
@@ -33,7 +33,7 @@ class ResourceEventsApiService extends ApiBaseService_1.ApiBaseService {
33
33
  *
34
34
  * @summary Return a list of all events belonging to a resource
35
35
  * @param {string} resourceType The resource type to get related events
36
- * @param {number} resourceId Unique ID of the resource that\&#39;s being searched
36
+ * @param {number} resourceId Unique ID of the resource that is being searched
37
37
  * @param {number} [page] Number of the page to be retrieved
38
38
  * @param {number} [perPage] Number of items returned per page
39
39
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "1.101.1",
3
+ "version": "1.102.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,7 +37,7 @@
37
37
  "license": "MIT",
38
38
  "release": {
39
39
  "branches": [
40
- "master"
40
+ "main"
41
41
  ]
42
42
  },
43
43
  "bugs": {
@@ -59,7 +59,7 @@
59
59
  "husky": "^8.0.1",
60
60
  "jest": "^27.0.6",
61
61
  "ts-jest": "^27.0.3",
62
- "typedoc": "^0.22.3",
62
+ "typedoc": "^0.23.1",
63
63
  "typescript": "^4.4.0"
64
64
  },
65
65
  "dependencies": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Devopness
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.