@devopness/sdk-js 2.99.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.
@@ -18,10 +18,11 @@ import { EnvironmentRelation } from '../../generated/models';
18
18
  export declare class UsersEnvironmentsApiService extends ApiBaseService {
19
19
  /**
20
20
  *
21
- * @summary Get current user\'s environments, projects and the amount of credits used
21
+ * @summary Return a list of all environments owned by the current user
22
22
  * @param {number} userId The ID of the user.
23
23
  * @param {number} [page] Number of the page to be retrieved
24
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.
25
26
  */
26
- listUserEnvironments(userId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<EnvironmentRelation>>>;
27
+ listUserEnvironments(userId: number, page?: number, perPage?: number, subscriptionId?: number): Promise<ApiResponse<Array<EnvironmentRelation>>>;
27
28
  }
@@ -31,18 +31,19 @@ const Exceptions_1 = require("../../../common/Exceptions");
31
31
  class UsersEnvironmentsApiService extends ApiBaseService_1.ApiBaseService {
32
32
  /**
33
33
  *
34
- * @summary Get current user\'s environments, projects and the amount of credits used
34
+ * @summary Return a list of all environments owned by the current user
35
35
  * @param {number} userId The ID of the user.
36
36
  * @param {number} [page] Number of the page to be retrieved
37
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 \&#39;used_credits\&#39; field will be added to the response.
38
39
  */
39
- listUserEnvironments(userId, page, perPage) {
40
+ listUserEnvironments(userId, page, perPage, subscriptionId) {
40
41
  return __awaiter(this, void 0, void 0, function* () {
41
42
  if (userId === null || userId === undefined) {
42
43
  throw new Exceptions_1.ArgumentNullException('userId', 'listUserEnvironments');
43
44
  }
44
45
  let queryString = '';
45
- const queryParams = { page: page, per_page: perPage, };
46
+ const queryParams = { page: page, per_page: perPage, subscription_id: subscriptionId, };
46
47
  for (const key in queryParams) {
47
48
  if (queryParams[key] === undefined || queryParams[key] === null) {
48
49
  continue;
@@ -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 \&#39;used_credits\&#39; 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 \&#39;used_credits\&#39; 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;
@@ -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}
@@ -2,8 +2,10 @@ 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
4
  import { UsersEnvironmentsApiService } from '../api/generated/apis/users-environments-api';
5
+ import { UsersProjectsApiService } from '../api/generated/apis/users-projects-api';
5
6
  export declare class UserService extends UsersApiService {
6
7
  environments: UsersEnvironmentsApiService;
7
8
  passwords: UsersPasswordsApiService;
9
+ projects: UsersProjectsApiService;
8
10
  teamInvitations: UsersTeamInvitationsApiService;
9
11
  }
@@ -5,11 +5,13 @@ 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
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");
8
9
  class UserService extends users_api_1.UsersApiService {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  this.environments = new users_environments_api_1.UsersEnvironmentsApiService();
12
13
  this.passwords = new users_passwords_api_1.UsersPasswordsApiService();
14
+ this.projects = new users_projects_api_1.UsersProjectsApiService();
13
15
  this.teamInvitations = new users_team_invitations_api_1.UsersTeamInvitationsApiService();
14
16
  }
15
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devopness/sdk-js",
3
- "version": "2.99.0",
3
+ "version": "2.100.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },