@devopness/sdk-js 3.0.0 → 3.1.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.
@@ -13,6 +13,7 @@ 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';
16
17
  import { ProjectRelation } from '../../generated/models';
17
18
  import { ProjectUpdate } from '../../generated/models';
18
19
  /**
@@ -21,7 +22,14 @@ import { ProjectUpdate } from '../../generated/models';
21
22
  export declare class ProjectsApiService extends ApiBaseService {
22
23
  /**
23
24
  *
24
- * @summary Create a project for a user or an organization
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
+ /**
31
+ *
32
+ * @summary Create a project for the authenticated user
25
33
  * @param {ProjectCreate} projectCreate A JSON object containing the resource data
26
34
  */
27
35
  addProject(projectCreate: ProjectCreate): Promise<ApiResponse<Project>>;
@@ -31,6 +39,14 @@ export declare class ProjectsApiService extends ApiBaseService {
31
39
  * @param {number} projectId The ID of the project.
32
40
  */
33
41
  getProject(projectId: number): Promise<ApiResponse<Project>>;
42
+ /**
43
+ *
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>>>;
34
50
  /**
35
51
  *
36
52
  * @summary Return a list of all projects the current user has access to
@@ -31,7 +31,27 @@ const Exceptions_1 = require("../../../common/Exceptions");
31
31
  class ProjectsApiService extends ApiBaseService_1.ApiBaseService {
32
32
  /**
33
33
  *
34
- * @summary Create a project for a user or an organization
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
+ /**
53
+ *
54
+ * @summary Create a project for the authenticated user
35
55
  * @param {ProjectCreate} projectCreate A JSON object containing the resource data
36
56
  */
37
57
  addProject(projectCreate) {
@@ -61,6 +81,31 @@ class ProjectsApiService extends ApiBaseService_1.ApiBaseService {
61
81
  return new ApiResponse_1.ApiResponse(response);
62
82
  });
63
83
  }
84
+ /**
85
+ *
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
+ }
64
109
  /**
65
110
  *
66
111
  * @summary Return a list of all projects the current user has access to
@@ -11,17 +11,17 @@
11
11
  */
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
- import { ProjectRelation } from '../../generated/models';
14
+ import { MembershipRelation } from '../../generated/models';
15
15
  /**
16
- * OrganizationsProjectsApiService - Auto-generated
16
+ * TeamsMembershipsApiService - Auto-generated
17
17
  */
18
- export declare class OrganizationsProjectsApiService extends ApiBaseService {
18
+ export declare class TeamsMembershipsApiService extends ApiBaseService {
19
19
  /**
20
20
  *
21
- * @summary Return a list of all projects owned by an organization
22
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
21
+ * @summary Return a list of all memberships of a team
22
+ * @param {number} teamId The ID of the team.
23
23
  * @param {number} [page] Number of the page to be retrieved
24
24
  * @param {number} [perPage] Number of items returned per page
25
25
  */
26
- listOrganizationProjects(organizationId: string, page?: number, perPage?: number): Promise<ApiResponse<Array<ProjectRelation>>>;
26
+ listTeamMemberships(teamId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<MembershipRelation>>>;
27
27
  }
@@ -21,25 +21,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.OrganizationsProjectsApiService = void 0;
24
+ exports.TeamsMembershipsApiService = void 0;
25
25
  const ApiBaseService_1 = require("../../../services/ApiBaseService");
26
26
  const ApiResponse_1 = require("../../../common/ApiResponse");
27
27
  const Exceptions_1 = require("../../../common/Exceptions");
28
28
  /**
29
- * OrganizationsProjectsApiService - Auto-generated
29
+ * TeamsMembershipsApiService - Auto-generated
30
30
  */
31
- class OrganizationsProjectsApiService extends ApiBaseService_1.ApiBaseService {
31
+ class TeamsMembershipsApiService extends ApiBaseService_1.ApiBaseService {
32
32
  /**
33
33
  *
34
- * @summary Return a list of all projects owned by an organization
35
- * @param {string} organizationId The numeric ID or URL Slug of an organization.
34
+ * @summary Return a list of all memberships of a team
35
+ * @param {number} teamId The ID of the team.
36
36
  * @param {number} [page] Number of the page to be retrieved
37
37
  * @param {number} [perPage] Number of items returned per page
38
38
  */
39
- listOrganizationProjects(organizationId, page, perPage) {
39
+ listTeamMemberships(teamId, page, perPage) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
- if (organizationId === null || organizationId === undefined) {
42
- throw new Exceptions_1.ArgumentNullException('organizationId', 'listOrganizationProjects');
41
+ if (teamId === null || teamId === undefined) {
42
+ throw new Exceptions_1.ArgumentNullException('teamId', 'listTeamMemberships');
43
43
  }
44
44
  let queryString = '';
45
45
  const queryParams = { page: page, per_page: perPage, };
@@ -49,10 +49,10 @@ class OrganizationsProjectsApiService extends ApiBaseService_1.ApiBaseService {
49
49
  }
50
50
  queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
51
51
  }
52
- const requestUrl = '/organizations/{organization_id}/projects' + (queryString ? `?${queryString}` : '');
53
- const response = yield this.get(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))));
52
+ const requestUrl = '/teams/{team_id}/memberships' + (queryString ? `?${queryString}` : '');
53
+ const response = yield this.get(requestUrl.replace(`{${"team_id"}}`, encodeURIComponent(String(teamId))));
54
54
  return new ApiResponse_1.ApiResponse(response);
55
55
  });
56
56
  }
57
57
  }
58
- exports.OrganizationsProjectsApiService = OrganizationsProjectsApiService;
58
+ exports.TeamsMembershipsApiService = TeamsMembershipsApiService;
@@ -137,6 +137,7 @@ export * from './linked-resource-summary-field';
137
137
  export * from './log';
138
138
  export * from './member';
139
139
  export * from './member-relation';
140
+ export * from './membership-relation';
140
141
  export * from './network';
141
142
  export * from './network-environment-create';
142
143
  export * from './network-provision-input';
@@ -181,6 +182,7 @@ export * from './pipeline-trigger-when';
181
182
  export * from './pipeline-update';
182
183
  export * from './project';
183
184
  export * from './project-create';
185
+ export * from './project-organization-create';
184
186
  export * from './project-relation';
185
187
  export * from './project-update';
186
188
  export * from './provider-code';
@@ -153,6 +153,7 @@ __exportStar(require("./linked-resource-summary-field"), exports);
153
153
  __exportStar(require("./log"), exports);
154
154
  __exportStar(require("./member"), exports);
155
155
  __exportStar(require("./member-relation"), exports);
156
+ __exportStar(require("./membership-relation"), exports);
156
157
  __exportStar(require("./network"), exports);
157
158
  __exportStar(require("./network-environment-create"), exports);
158
159
  __exportStar(require("./network-provision-input"), exports);
@@ -197,6 +198,7 @@ __exportStar(require("./pipeline-trigger-when"), exports);
197
198
  __exportStar(require("./pipeline-update"), exports);
198
199
  __exportStar(require("./project"), exports);
199
200
  __exportStar(require("./project-create"), exports);
201
+ __exportStar(require("./project-organization-create"), exports);
200
202
  __exportStar(require("./project-relation"), exports);
201
203
  __exportStar(require("./project-update"), exports);
202
204
  __exportStar(require("./provider-code"), exports);
@@ -0,0 +1,44 @@
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 { EnvironmentRelation } from './environment-relation';
13
+ import { RoleRelation } from './role-relation';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface MembershipRelation
18
+ */
19
+ export interface MembershipRelation {
20
+ /**
21
+ *
22
+ * @type {EnvironmentRelation}
23
+ * @memberof MembershipRelation
24
+ */
25
+ environment: EnvironmentRelation | null;
26
+ /**
27
+ *
28
+ * @type {RoleRelation}
29
+ * @memberof MembershipRelation
30
+ */
31
+ role: RoleRelation | null;
32
+ /**
33
+ * The date and time when the record was created
34
+ * @type {string}
35
+ * @memberof MembershipRelation
36
+ */
37
+ created_at: string;
38
+ /**
39
+ * The date and time when the record was last updated
40
+ * @type {string}
41
+ * @memberof MembershipRelation
42
+ */
43
+ updated_at: string;
44
+ }
@@ -0,0 +1,14 @@
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 });
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import { ResourceSummaryItem } from './resource-summary-item';
13
+ import { UserRelation } from './user-relation';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -40,6 +41,12 @@ export interface OrganizationRelation {
40
41
  * @memberof OrganizationRelation
41
42
  */
42
43
  resource_summary?: Array<ResourceSummaryItem>;
44
+ /**
45
+ *
46
+ * @type {UserRelation}
47
+ * @memberof OrganizationRelation
48
+ */
49
+ owner: UserRelation;
43
50
  /**
44
51
  * The date and time when the organization was created
45
52
  * @type {string}
@@ -21,12 +21,6 @@ export interface ProjectCreate {
21
21
  * @memberof ProjectCreate
22
22
  */
23
23
  name: string;
24
- /**
25
- * The ID of the organization that owns the project.
26
- * @type {number}
27
- * @memberof ProjectCreate
28
- */
29
- organization_id?: number;
30
24
  /**
31
25
  * A base64 string representation of the logo image.
32
26
  * @type {string}
@@ -0,0 +1,36 @@
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
+ }
@@ -0,0 +1,14 @@
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 });
@@ -1,7 +1,5 @@
1
1
  import { OrganizationsApiService } from "../api/generated/apis/organizations-api";
2
2
  import { OrganizationsEnvironmentsApiService } from "../api/generated/apis/organizations-environments-api";
3
- import { OrganizationsProjectsApiService } from "../api/generated/apis/organizations-projects-api";
4
3
  export declare class OrganizationService extends OrganizationsApiService {
5
4
  environments: OrganizationsEnvironmentsApiService;
6
- projects: OrganizationsProjectsApiService;
7
5
  }
@@ -3,12 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OrganizationService = void 0;
4
4
  const organizations_api_1 = require("../api/generated/apis/organizations-api");
5
5
  const organizations_environments_api_1 = require("../api/generated/apis/organizations-environments-api");
6
- const organizations_projects_api_1 = require("../api/generated/apis/organizations-projects-api");
7
6
  class OrganizationService extends organizations_api_1.OrganizationsApiService {
8
7
  constructor() {
9
8
  super(...arguments);
10
9
  this.environments = new organizations_environments_api_1.OrganizationsEnvironmentsApiService();
11
- this.projects = new organizations_projects_api_1.OrganizationsProjectsApiService();
12
10
  }
13
11
  }
14
12
  exports.OrganizationService = OrganizationService;
@@ -1,7 +1,9 @@
1
1
  import { TeamsApiService } from '../api/generated/apis/teams-api';
2
2
  import { TeamsInvitationsApiService } from '../api/generated/apis/teams-invitations-api';
3
3
  import { TeamsMembersApiService } from '../api/generated/apis/teams-members-api';
4
+ import { TeamsMembershipsApiService } from '../api/generated/apis/teams-memberships-api';
4
5
  export declare class TeamService extends TeamsApiService {
5
6
  invitations: TeamsInvitationsApiService;
6
7
  members: TeamsMembersApiService;
8
+ memberships: TeamsMembershipsApiService;
7
9
  }
@@ -4,11 +4,13 @@ exports.TeamService = void 0;
4
4
  const teams_api_1 = require("../api/generated/apis/teams-api");
5
5
  const teams_invitations_api_1 = require("../api/generated/apis/teams-invitations-api");
6
6
  const teams_members_api_1 = require("../api/generated/apis/teams-members-api");
7
+ const teams_memberships_api_1 = require("../api/generated/apis/teams-memberships-api");
7
8
  class TeamService extends teams_api_1.TeamsApiService {
8
9
  constructor() {
9
10
  super(...arguments);
10
11
  this.invitations = new teams_invitations_api_1.TeamsInvitationsApiService();
11
12
  this.members = new teams_members_api_1.TeamsMembersApiService();
13
+ this.memberships = new teams_memberships_api_1.TeamsMembershipsApiService();
12
14
  }
13
15
  }
14
16
  exports.TeamService = TeamService;
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.0.0",
4
+ "version": "3.1.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -54,9 +54,9 @@
54
54
  "@eslint/js": "^9.37.0",
55
55
  "@openapitools/openapi-generator-cli": "^2.25.0",
56
56
  "@types/jest": "^30.0.0",
57
- "@typescript-eslint/parser": "^8.46.1",
57
+ "@typescript-eslint/parser": "^8.46.2",
58
58
  "axios-mock-adapter": "^2.1.0",
59
- "eslint": "^9.37.0",
59
+ "eslint": "^9.38.0",
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,7 +66,7 @@
66
66
  "ts-jest": "^29.4.5",
67
67
  "typedoc": "^0.28.14",
68
68
  "typescript": "^5.9.3",
69
- "typescript-eslint": "^8.46.1"
69
+ "typescript-eslint": "^8.46.2"
70
70
  },
71
71
  "dependencies": {
72
72
  "@types/parse-link-header": "^2.0.3",