@devopness/sdk-js 3.1.3 → 3.1.5

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.
@@ -13,20 +13,12 @@ import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Project } from '../../generated/models';
15
15
  import { ProjectCreate } from '../../generated/models';
16
- import { ProjectOrganizationCreate } from '../../generated/models';
17
16
  import { ProjectRelation } from '../../generated/models';
18
17
  import { ProjectUpdate } from '../../generated/models';
19
18
  /**
20
19
  * ProjectsApiService - Auto-generated
21
20
  */
22
21
  export declare class ProjectsApiService extends ApiBaseService {
23
- /**
24
- *
25
- * @summary Create a project to a given organization
26
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
27
- * @param {ProjectOrganizationCreate} projectOrganizationCreate A JSON object containing the resource data
28
- */
29
- addOrganizationProject(organizationId: string, projectOrganizationCreate: ProjectOrganizationCreate): Promise<ApiResponse<Project>>;
30
22
  /**
31
23
  *
32
24
  * @summary Create a project for the authenticated user
@@ -41,19 +33,12 @@ export declare class ProjectsApiService extends ApiBaseService {
41
33
  getProject(projectId: number): Promise<ApiResponse<Project>>;
42
34
  /**
43
35
  *
44
- * @summary List all projects belonging to an organization
45
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
46
- * @param {number} [page] Number of the page to be retrieved
47
- * @param {number} [perPage] Number of items returned per page
48
- */
49
- listOrganizationProjects(organizationId: string, page?: number, perPage?: number): Promise<ApiResponse<Array<ProjectRelation>>>;
50
- /**
51
- *
52
- * @summary Return a list of all projects the current user has access to
36
+ * @summary Return a list of projects
53
37
  * @param {number} [page] Number of the page to be retrieved
54
38
  * @param {number} [perPage] Number of items returned per page
39
+ * @param {string} [owner] Filter by project\&#39;s owner ID or URL Slug. If not provided, projects accessible by currently authenticated user are returned.
55
40
  */
56
- listProjects(page?: number, perPage?: number): Promise<ApiResponse<Array<ProjectRelation>>>;
41
+ listProjects(page?: number, perPage?: number, owner?: string): Promise<ApiResponse<Array<ProjectRelation>>>;
57
42
  /**
58
43
  *
59
44
  * @summary Update an existing Project
@@ -29,26 +29,6 @@ const Exceptions_1 = require("../../../common/Exceptions");
29
29
  * ProjectsApiService - Auto-generated
30
30
  */
31
31
  class ProjectsApiService extends ApiBaseService_1.ApiBaseService {
32
- /**
33
- *
34
- * @summary Create a project to a given organization
35
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
36
- * @param {ProjectOrganizationCreate} projectOrganizationCreate A JSON object containing the resource data
37
- */
38
- addOrganizationProject(organizationId, projectOrganizationCreate) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (organizationId === null || organizationId === undefined) {
41
- throw new Exceptions_1.ArgumentNullException('organizationId', 'addOrganizationProject');
42
- }
43
- if (projectOrganizationCreate === null || projectOrganizationCreate === undefined) {
44
- throw new Exceptions_1.ArgumentNullException('projectOrganizationCreate', 'addOrganizationProject');
45
- }
46
- let queryString = '';
47
- const requestUrl = '/organizations/{organization_id}/projects' + (queryString ? `?${queryString}` : '');
48
- const response = yield this.post(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))), projectOrganizationCreate);
49
- return new ApiResponse_1.ApiResponse(response);
50
- });
51
- }
52
32
  /**
53
33
  *
54
34
  * @summary Create a project for the authenticated user
@@ -83,39 +63,15 @@ class ProjectsApiService extends ApiBaseService_1.ApiBaseService {
83
63
  }
84
64
  /**
85
65
  *
86
- * @summary List all projects belonging to an organization
87
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
88
- * @param {number} [page] Number of the page to be retrieved
89
- * @param {number} [perPage] Number of items returned per page
90
- */
91
- listOrganizationProjects(organizationId, page, perPage) {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- if (organizationId === null || organizationId === undefined) {
94
- throw new Exceptions_1.ArgumentNullException('organizationId', 'listOrganizationProjects');
95
- }
96
- let queryString = '';
97
- const queryParams = { page: page, per_page: perPage, };
98
- for (const key in queryParams) {
99
- if (queryParams[key] === undefined || queryParams[key] === null) {
100
- continue;
101
- }
102
- queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
103
- }
104
- const requestUrl = '/organizations/{organization_id}/projects' + (queryString ? `?${queryString}` : '');
105
- const response = yield this.get(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))));
106
- return new ApiResponse_1.ApiResponse(response);
107
- });
108
- }
109
- /**
110
- *
111
- * @summary Return a list of all projects the current user has access to
66
+ * @summary Return a list of projects
112
67
  * @param {number} [page] Number of the page to be retrieved
113
68
  * @param {number} [perPage] Number of items returned per page
69
+ * @param {string} [owner] Filter by project\&#39;s owner ID or URL Slug. If not provided, projects accessible by currently authenticated user are returned.
114
70
  */
115
- listProjects(page, perPage) {
71
+ listProjects(page, perPage, owner) {
116
72
  return __awaiter(this, void 0, void 0, function* () {
117
73
  let queryString = '';
118
- const queryParams = { page: page, per_page: perPage, };
74
+ const queryParams = { page: page, per_page: perPage, owner: owner, };
119
75
  for (const key in queryParams) {
120
76
  if (queryParams[key] === undefined || queryParams[key] === null) {
121
77
  continue;
@@ -32,8 +32,8 @@ export declare class UsersApiService extends ApiBaseService {
32
32
  addUser(): Promise<ApiResponse<void>>;
33
33
  /**
34
34
  *
35
- * @summary Get a user by ID or URL Slug
36
- * @param {string} userId The numeric ID or URL Slug of a user.
35
+ * @summary Get public details of a user
36
+ * @param {string} userId The URL Slug of a user.
37
37
  */
38
38
  getUser(userId: string): Promise<ApiResponse<User>>;
39
39
  /**
@@ -44,8 +44,8 @@ class UsersApiService extends ApiBaseService_1.ApiBaseService {
44
44
  }
45
45
  /**
46
46
  *
47
- * @summary Get a user by ID or URL Slug
48
- * @param {string} userId The numeric ID or URL Slug of a user.
47
+ * @summary Get public details of a user
48
+ * @param {string} userId The URL Slug of a user.
49
49
  */
50
50
  getUser(userId) {
51
51
  return __awaiter(this, void 0, void 0, function* () {
@@ -181,7 +181,6 @@ export * from './pipeline-trigger-when';
181
181
  export * from './pipeline-update';
182
182
  export * from './project';
183
183
  export * from './project-create';
184
- export * from './project-organization-create';
185
184
  export * from './project-owner-relation';
186
185
  export * from './project-owner-type';
187
186
  export * from './project-relation';
@@ -312,6 +311,7 @@ export * from './user-refresh-token-response';
312
311
  export * from './user-relation';
313
312
  export * from './user-resend-verification';
314
313
  export * from './user-team-stats';
314
+ export * from './user-type';
315
315
  export * from './user-url';
316
316
  export * from './variable';
317
317
  export * from './variable-application-create';
@@ -197,7 +197,6 @@ __exportStar(require("./pipeline-trigger-when"), exports);
197
197
  __exportStar(require("./pipeline-update"), exports);
198
198
  __exportStar(require("./project"), exports);
199
199
  __exportStar(require("./project-create"), exports);
200
- __exportStar(require("./project-organization-create"), exports);
201
200
  __exportStar(require("./project-owner-relation"), exports);
202
201
  __exportStar(require("./project-owner-type"), exports);
203
202
  __exportStar(require("./project-relation"), exports);
@@ -328,6 +327,7 @@ __exportStar(require("./user-refresh-token-response"), exports);
328
327
  __exportStar(require("./user-relation"), exports);
329
328
  __exportStar(require("./user-resend-verification"), exports);
330
329
  __exportStar(require("./user-team-stats"), exports);
330
+ __exportStar(require("./user-type"), exports);
331
331
  __exportStar(require("./user-url"), exports);
332
332
  __exportStar(require("./variable"), exports);
333
333
  __exportStar(require("./variable-application-create"), exports);
@@ -1,5 +1,3 @@
1
- "use strict";
2
- /* eslint-disable */
3
1
  /**
4
2
  * devopness API
5
3
  * Devopness API - Painless essential DevOps to everyone
@@ -11,4 +9,12 @@
11
9
  * https://openapi-generator.tech
12
10
  * Do not edit the class manually.
13
11
  */
14
- Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**
13
+ * The possible types of users.
14
+ * @export
15
+ * @enum {string}
16
+ */
17
+ export declare enum UserType {
18
+ User = "user",
19
+ Org = "org"
20
+ }
@@ -0,0 +1,25 @@
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 });
15
+ exports.UserType = void 0;
16
+ /**
17
+ * The possible types of users.
18
+ * @export
19
+ * @enum {string}
20
+ */
21
+ var UserType;
22
+ (function (UserType) {
23
+ UserType["User"] = "user";
24
+ UserType["Org"] = "org";
25
+ })(UserType || (exports.UserType = UserType = {}));
@@ -9,8 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { Language } from './language';
13
- import { SocialAccountRelation } from './social-account-relation';
12
+ import { UserType } from './user-type';
14
13
  /**
15
14
  *
16
15
  * @export
@@ -18,23 +17,11 @@ import { SocialAccountRelation } from './social-account-relation';
18
17
  */
19
18
  export interface User {
20
19
  /**
21
- * The unique ID of the given user
20
+ * The unique ID of the user
22
21
  * @type {number}
23
22
  * @memberof User
24
23
  */
25
24
  id: number;
26
- /**
27
- * User\'s full name
28
- * @type {string}
29
- * @memberof User
30
- */
31
- name: string;
32
- /**
33
- * The e-mail that will uniquely identify the user on the system and become its login credential
34
- * @type {string}
35
- * @memberof User
36
- */
37
- email: string;
38
25
  /**
39
26
  * The URL Slug of the user
40
27
  * @type {string}
@@ -43,32 +30,8 @@ export interface User {
43
30
  url_slug?: string;
44
31
  /**
45
32
  *
46
- * @type {Language}
47
- * @memberof User
48
- */
49
- language: Language | null;
50
- /**
51
- * Tells if the user is active or not
52
- * @type {boolean}
53
- * @memberof User
54
- */
55
- active: boolean;
56
- /**
57
- *
58
- * @type {Array<SocialAccountRelation>}
59
- * @memberof User
60
- */
61
- social_accounts: Array<SocialAccountRelation>;
62
- /**
63
- * The date and time when the record was created
64
- * @type {string}
65
- * @memberof User
66
- */
67
- created_at: string;
68
- /**
69
- * The date and time when the record was last updated
70
- * @type {string}
33
+ * @type {UserType}
71
34
  * @memberof User
72
35
  */
73
- updated_at: string;
36
+ type: UserType;
74
37
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@devopness/sdk-js",
4
- "version": "3.1.3",
4
+ "version": "3.1.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -51,12 +51,12 @@
51
51
  },
52
52
  "homepage": "https://github.com/devopness/devopness#readme",
53
53
  "devDependencies": {
54
- "@eslint/js": "^9.39.0",
55
- "@openapitools/openapi-generator-cli": "^2.25.0",
54
+ "@eslint/js": "^9.39.1",
55
+ "@openapitools/openapi-generator-cli": "^2.25.2",
56
56
  "@types/jest": "^30.0.0",
57
- "@typescript-eslint/parser": "^8.46.2",
57
+ "@typescript-eslint/parser": "^8.48.0",
58
58
  "axios-mock-adapter": "^2.1.0",
59
- "eslint": "^9.38.0",
59
+ "eslint": "^9.39.1",
60
60
  "eslint-import-resolver-typescript": "^4.4.4",
61
61
  "eslint-plugin-import": "^2.32.0",
62
62
  "eslint-plugin-n": "^17.23.1",
@@ -66,11 +66,11 @@
66
66
  "ts-jest": "^29.4.5",
67
67
  "typedoc": "^0.28.14",
68
68
  "typescript": "^5.9.3",
69
- "typescript-eslint": "^8.46.2"
69
+ "typescript-eslint": "^8.47.0"
70
70
  },
71
71
  "dependencies": {
72
72
  "@types/parse-link-header": "^2.0.3",
73
- "axios": "^1.13.1",
73
+ "axios": "^1.13.2",
74
74
  "parse-link-header": "^2.0.0"
75
75
  }
76
76
  }
@@ -1,36 +0,0 @@
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
- /**
13
- *
14
- * @export
15
- * @interface ProjectOrganizationCreate
16
- */
17
- export interface ProjectOrganizationCreate {
18
- /**
19
- * The name of the project. Must not be greater than 60 characters.
20
- * @type {string}
21
- * @memberof ProjectOrganizationCreate
22
- */
23
- name: string;
24
- /**
25
- * A base64 string representation of the logo image.
26
- * @type {string}
27
- * @memberof ProjectOrganizationCreate
28
- */
29
- logo_image?: string;
30
- /**
31
- * A URL path to the project\'s logo image. Must be a valid URL.
32
- * @type {string}
33
- * @memberof ProjectOrganizationCreate
34
- */
35
- logo_url?: string;
36
- }