@devopness/sdk-js 2.98.0 → 2.100.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/dist/api/generated/apis/servers-api.d.ts +2 -1
- package/dist/api/generated/apis/servers-api.js +9 -1
- package/dist/api/generated/apis/users-environments-api.d.ts +28 -0
- package/dist/api/generated/apis/users-environments-api.js +59 -0
- package/dist/api/generated/apis/users-projects-api.d.ts +28 -0
- package/dist/api/generated/apis/users-projects-api.js +59 -0
- package/dist/api/generated/models/archived-environment-relation.d.ts +7 -0
- package/dist/api/generated/models/environment-relation.d.ts +7 -0
- package/dist/api/generated/models/network-rule-direction.d.ts +0 -1
- package/dist/api/generated/models/network-rule-direction.js +0 -1
- package/dist/api/generated/models/project-relation.d.ts +6 -0
- package/dist/api/generated/models/resource-event.d.ts +2 -2
- package/dist/api/generated/models/resource-link-relation.d.ts +2 -2
- package/dist/api/generated/models/user-billing.d.ts +0 -7
- package/dist/services/UserService.d.ts +5 -1
- package/dist/services/UserService.js +5 -1
- package/package.json +1 -1
|
@@ -29,8 +29,9 @@ export declare class ServersApiService extends ApiBaseService {
|
|
|
29
29
|
*
|
|
30
30
|
* @summary Delete a given server
|
|
31
31
|
* @param {number} serverId The ID of the server.
|
|
32
|
+
* @param {boolean} [destroyServerDisks] Indicates whether disks associated with a cloud server should be deleted after the server is destroyed
|
|
32
33
|
*/
|
|
33
|
-
deleteServer(serverId: number): Promise<ApiResponse<void>>;
|
|
34
|
+
deleteServer(serverId: number, destroyServerDisks?: boolean): Promise<ApiResponse<void>>;
|
|
34
35
|
/**
|
|
35
36
|
*
|
|
36
37
|
* @summary Get a server by ID
|
|
@@ -53,13 +53,21 @@ class ServersApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
53
53
|
*
|
|
54
54
|
* @summary Delete a given server
|
|
55
55
|
* @param {number} serverId The ID of the server.
|
|
56
|
+
* @param {boolean} [destroyServerDisks] Indicates whether disks associated with a cloud server should be deleted after the server is destroyed
|
|
56
57
|
*/
|
|
57
|
-
deleteServer(serverId) {
|
|
58
|
+
deleteServer(serverId, destroyServerDisks) {
|
|
58
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
60
|
if (serverId === null || serverId === undefined) {
|
|
60
61
|
throw new Exceptions_1.ArgumentNullException('serverId', 'deleteServer');
|
|
61
62
|
}
|
|
62
63
|
let queryString = '';
|
|
64
|
+
const queryParams = { destroy_server_disks: destroyServerDisks, };
|
|
65
|
+
for (const key in queryParams) {
|
|
66
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
70
|
+
}
|
|
63
71
|
const requestUrl = '/servers/{server_id}' + (queryString ? `?${queryString}` : '');
|
|
64
72
|
const response = yield this.delete(requestUrl.replace(`{${"server_id"}}`, encodeURIComponent(String(serverId))));
|
|
65
73
|
return new ApiResponse_1.ApiResponse(response);
|
|
@@ -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 { EnvironmentRelation } from '../../generated/models';
|
|
15
|
+
/**
|
|
16
|
+
* UsersEnvironmentsApiService - Auto-generated
|
|
17
|
+
*/
|
|
18
|
+
export declare class UsersEnvironmentsApiService extends ApiBaseService {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @summary Return a list of all environments owned by the current user
|
|
22
|
+
* @param {number} userId The ID of the user.
|
|
23
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
24
|
+
* @param {number} [perPage] Number of items returned per page
|
|
25
|
+
* @param {number} [subscriptionId] ID of a user subscription to calculate the amount of credits used from that subscription on each user environment. If provided, and being a valid subscription belonging to current user, the \'used_credits\' field will be added to the response.
|
|
26
|
+
*/
|
|
27
|
+
listUserEnvironments(userId: number, page?: number, perPage?: number, subscriptionId?: number): Promise<ApiResponse<Array<EnvironmentRelation>>>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.UsersEnvironmentsApiService = 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
|
+
* UsersEnvironmentsApiService - Auto-generated
|
|
30
|
+
*/
|
|
31
|
+
class UsersEnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Return a list of all environments owned by the current user
|
|
35
|
+
* @param {number} userId The ID of the user.
|
|
36
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
37
|
+
* @param {number} [perPage] Number of items returned per page
|
|
38
|
+
* @param {number} [subscriptionId] ID of a user subscription to calculate the amount of credits used from that subscription on each user environment. If provided, and being a valid subscription belonging to current user, the \'used_credits\' field will be added to the response.
|
|
39
|
+
*/
|
|
40
|
+
listUserEnvironments(userId, page, perPage, subscriptionId) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (userId === null || userId === undefined) {
|
|
43
|
+
throw new Exceptions_1.ArgumentNullException('userId', 'listUserEnvironments');
|
|
44
|
+
}
|
|
45
|
+
let queryString = '';
|
|
46
|
+
const queryParams = { page: page, per_page: perPage, subscription_id: subscriptionId, };
|
|
47
|
+
for (const key in queryParams) {
|
|
48
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
52
|
+
}
|
|
53
|
+
const requestUrl = '/users/{user_id}/environments' + (queryString ? `?${queryString}` : '');
|
|
54
|
+
const response = yield this.get(requestUrl.replace(`{${"user_id"}}`, encodeURIComponent(String(userId))));
|
|
55
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.UsersEnvironmentsApiService = UsersEnvironmentsApiService;
|
|
@@ -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 { ProjectRelation } from '../../generated/models';
|
|
15
|
+
/**
|
|
16
|
+
* UsersProjectsApiService - Auto-generated
|
|
17
|
+
*/
|
|
18
|
+
export declare class UsersProjectsApiService extends ApiBaseService {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @summary Return a list of all projects owned by the current user
|
|
22
|
+
* @param {number} userId The ID of the user.
|
|
23
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
24
|
+
* @param {number} [perPage] Number of items returned per page
|
|
25
|
+
* @param {number} [subscriptionId] ID of a user subscription to calculate the amount of credits used from that subscription on each user project. If provided, and being a valid subscription belonging to current user, the \'used_credits\' field will be added to the response.
|
|
26
|
+
*/
|
|
27
|
+
listUserProjects(userId: number, page?: number, perPage?: number, subscriptionId?: number): Promise<ApiResponse<Array<ProjectRelation>>>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.UsersProjectsApiService = 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
|
+
* UsersProjectsApiService - Auto-generated
|
|
30
|
+
*/
|
|
31
|
+
class UsersProjectsApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Return a list of all projects owned by the current user
|
|
35
|
+
* @param {number} userId The ID of the user.
|
|
36
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
37
|
+
* @param {number} [perPage] Number of items returned per page
|
|
38
|
+
* @param {number} [subscriptionId] ID of a user subscription to calculate the amount of credits used from that subscription on each user project. If provided, and being a valid subscription belonging to current user, the \'used_credits\' field will be added to the response.
|
|
39
|
+
*/
|
|
40
|
+
listUserProjects(userId, page, perPage, subscriptionId) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (userId === null || userId === undefined) {
|
|
43
|
+
throw new Exceptions_1.ArgumentNullException('userId', 'listUserProjects');
|
|
44
|
+
}
|
|
45
|
+
let queryString = '';
|
|
46
|
+
const queryParams = { page: page, per_page: perPage, subscription_id: subscriptionId, };
|
|
47
|
+
for (const key in queryParams) {
|
|
48
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
52
|
+
}
|
|
53
|
+
const requestUrl = '/users/{user_id}/projects' + (queryString ? `?${queryString}` : '');
|
|
54
|
+
const response = yield this.get(requestUrl.replace(`{${"user_id"}}`, encodeURIComponent(String(userId))));
|
|
55
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.UsersProjectsApiService = UsersProjectsApiService;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import { EnvironmentType } from './environment-type';
|
|
13
|
+
import { ProjectRelation } from './project-relation';
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
* @export
|
|
@@ -64,4 +65,10 @@ export interface ArchivedEnvironmentRelation {
|
|
|
64
65
|
* @memberof ArchivedEnvironmentRelation
|
|
65
66
|
*/
|
|
66
67
|
archived_at: string | null;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @type {ProjectRelation}
|
|
71
|
+
* @memberof ArchivedEnvironmentRelation
|
|
72
|
+
*/
|
|
73
|
+
project: ProjectRelation | null;
|
|
67
74
|
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import { EnvironmentType } from './environment-type';
|
|
13
|
+
import { ProjectRelation } from './project-relation';
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
* @export
|
|
@@ -64,4 +65,10 @@ export interface EnvironmentRelation {
|
|
|
64
65
|
* @memberof EnvironmentRelation
|
|
65
66
|
*/
|
|
66
67
|
archived_at: string | null;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @type {ProjectRelation}
|
|
71
|
+
* @memberof EnvironmentRelation
|
|
72
|
+
*/
|
|
73
|
+
project: ProjectRelation | null;
|
|
67
74
|
}
|
|
@@ -20,7 +20,6 @@ exports.NetworkRuleDirection = void 0;
|
|
|
20
20
|
*/
|
|
21
21
|
var NetworkRuleDirection;
|
|
22
22
|
(function (NetworkRuleDirection) {
|
|
23
|
-
NetworkRuleDirection["Any"] = "any";
|
|
24
23
|
NetworkRuleDirection["Inbound"] = "inbound";
|
|
25
24
|
NetworkRuleDirection["Outbound"] = "outbound";
|
|
26
25
|
})(NetworkRuleDirection = exports.NetworkRuleDirection || (exports.NetworkRuleDirection = {}));
|
|
@@ -52,6 +52,12 @@ export interface ProjectRelation {
|
|
|
52
52
|
* @memberof ProjectRelation
|
|
53
53
|
*/
|
|
54
54
|
created_by_user: UserRelation;
|
|
55
|
+
/**
|
|
56
|
+
* Number of credits used in the current monthly billing cycle by actions of resources in the project.
|
|
57
|
+
* @type {number}
|
|
58
|
+
* @memberof ProjectRelation
|
|
59
|
+
*/
|
|
60
|
+
used_credits?: number;
|
|
55
61
|
/**
|
|
56
62
|
* The date and time when the record was created
|
|
57
63
|
* @type {string}
|
|
@@ -24,10 +24,10 @@ export interface ResourceEvent {
|
|
|
24
24
|
resource_type: string;
|
|
25
25
|
/**
|
|
26
26
|
* The resource ID.
|
|
27
|
-
* @type {
|
|
27
|
+
* @type {number}
|
|
28
28
|
* @memberof ResourceEvent
|
|
29
29
|
*/
|
|
30
|
-
resource_id:
|
|
30
|
+
resource_id: number;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
33
|
* @type {Subscription}
|
|
@@ -36,10 +36,10 @@ export interface ResourceLinkRelation {
|
|
|
36
36
|
resource_type: string;
|
|
37
37
|
/**
|
|
38
38
|
* The linked resource ID
|
|
39
|
-
* @type {
|
|
39
|
+
* @type {number}
|
|
40
40
|
* @memberof ResourceLinkRelation
|
|
41
41
|
*/
|
|
42
|
-
resource_id:
|
|
42
|
+
resource_id: number;
|
|
43
43
|
/**
|
|
44
44
|
* If false, the link cannot be manually removed
|
|
45
45
|
* @type {boolean}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { EnvironmentRelation } from './environment-relation';
|
|
13
12
|
import { Subscription } from './subscription';
|
|
14
13
|
/**
|
|
15
14
|
*
|
|
@@ -23,10 +22,4 @@ export interface UserBilling {
|
|
|
23
22
|
* @memberof UserBilling
|
|
24
23
|
*/
|
|
25
24
|
active_subscription: Subscription | null;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @type {Array<EnvironmentRelation>}
|
|
29
|
-
* @memberof UserBilling
|
|
30
|
-
*/
|
|
31
|
-
environments: Array<EnvironmentRelation>;
|
|
32
25
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { UsersApiService } from '../api/generated/apis/users-api';
|
|
2
2
|
import { UsersTeamInvitationsApiService } from '../api/generated/apis/users-team-invitations-api';
|
|
3
3
|
import { UsersPasswordsApiService } from '../api/generated/apis/users-passwords-api';
|
|
4
|
+
import { UsersEnvironmentsApiService } from '../api/generated/apis/users-environments-api';
|
|
5
|
+
import { UsersProjectsApiService } from '../api/generated/apis/users-projects-api';
|
|
4
6
|
export declare class UserService extends UsersApiService {
|
|
5
|
-
|
|
7
|
+
environments: UsersEnvironmentsApiService;
|
|
6
8
|
passwords: UsersPasswordsApiService;
|
|
9
|
+
projects: UsersProjectsApiService;
|
|
10
|
+
teamInvitations: UsersTeamInvitationsApiService;
|
|
7
11
|
}
|
|
@@ -4,11 +4,15 @@ exports.UserService = void 0;
|
|
|
4
4
|
const users_api_1 = require("../api/generated/apis/users-api");
|
|
5
5
|
const users_team_invitations_api_1 = require("../api/generated/apis/users-team-invitations-api");
|
|
6
6
|
const users_passwords_api_1 = require("../api/generated/apis/users-passwords-api");
|
|
7
|
+
const users_environments_api_1 = require("../api/generated/apis/users-environments-api");
|
|
8
|
+
const users_projects_api_1 = require("../api/generated/apis/users-projects-api");
|
|
7
9
|
class UserService extends users_api_1.UsersApiService {
|
|
8
10
|
constructor() {
|
|
9
11
|
super(...arguments);
|
|
10
|
-
this.
|
|
12
|
+
this.environments = new users_environments_api_1.UsersEnvironmentsApiService();
|
|
11
13
|
this.passwords = new users_passwords_api_1.UsersPasswordsApiService();
|
|
14
|
+
this.projects = new users_projects_api_1.UsersProjectsApiService();
|
|
15
|
+
this.teamInvitations = new users_team_invitations_api_1.UsersTeamInvitationsApiService();
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
exports.UserService = UserService;
|