@devopness/sdk-js 2.164.6 → 2.164.7
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/DevopnessApiClient.d.ts +4 -0
- package/dist/DevopnessApiClient.js +8 -0
- package/dist/api/generated/apis/projects-api-tokens-api.d.ts +60 -0
- package/dist/api/generated/apis/projects-api-tokens-api.js +142 -0
- package/dist/api/generated/apis/users-personal-access-tokens-api.d.ts +55 -0
- package/dist/api/generated/apis/users-personal-access-tokens-api.js +122 -0
- package/dist/api/generated/models/api-token-allowed-expiration.d.ts +23 -0
- package/dist/api/generated/models/api-token-allowed-expiration.js +28 -0
- package/dist/api/generated/models/api-token-project-create.d.ts +37 -0
- package/dist/api/generated/models/api-token-project-create.js +14 -0
- package/dist/api/generated/models/api-token-project-rotate.d.ts +31 -0
- package/dist/api/generated/models/api-token-project-rotate.js +14 -0
- package/dist/api/generated/models/api-token-relation.d.ts +81 -0
- package/dist/api/generated/models/api-token-relation.js +14 -0
- package/dist/api/generated/models/api-token-rotate-response.d.ts +94 -0
- package/dist/api/generated/models/api-token-rotate-response.js +14 -0
- package/dist/api/generated/models/api-token-status.d.ts +21 -0
- package/dist/api/generated/models/api-token-status.js +26 -0
- package/dist/api/generated/models/api-token-type-prefix.d.ts +20 -0
- package/dist/api/generated/models/api-token-type-prefix.js +25 -0
- package/dist/api/generated/models/api-token-type.d.ts +20 -0
- package/dist/api/generated/models/api-token-type.js +25 -0
- package/dist/api/generated/models/api-token.d.ts +94 -0
- package/dist/api/generated/models/api-token.js +14 -0
- package/dist/api/generated/models/index.d.ts +14 -0
- package/dist/api/generated/models/index.js +14 -0
- package/dist/api/generated/models/personal-access-token-relation.d.ts +81 -0
- package/dist/api/generated/models/personal-access-token-relation.js +14 -0
- package/dist/api/generated/models/personal-access-token-rotate-response.d.ts +87 -0
- package/dist/api/generated/models/personal-access-token-rotate-response.js +14 -0
- package/dist/api/generated/models/personal-access-token-user-create.d.ts +31 -0
- package/dist/api/generated/models/personal-access-token-user-create.js +14 -0
- package/dist/api/generated/models/personal-access-token-user-rotate.d.ts +31 -0
- package/dist/api/generated/models/personal-access-token-user-rotate.js +14 -0
- package/dist/api/generated/models/personal-access-token.d.ts +87 -0
- package/dist/api/generated/models/personal-access-token.js +14 -0
- package/dist/services/ApiBaseService.d.ts +5 -2
- package/dist/services/ApiBaseService.js +12 -2
- package/dist/services/ApiTokenService.d.ts +7 -0
- package/dist/services/ApiTokenService.js +15 -0
- package/package.json +6 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionService } from './services/ActionService';
|
|
2
2
|
import { ConfigurationOptions } from './services/ApiBaseService';
|
|
3
|
+
import { ApiTokenService } from './services/ApiTokenService';
|
|
3
4
|
import { ApplicationService } from './services/ApplicationService';
|
|
4
5
|
import { CredentialService } from './services/CredentialService';
|
|
5
6
|
import { CronJobService } from './services/CronJobService';
|
|
@@ -30,6 +31,7 @@ import { VariableService } from './services/VariableService';
|
|
|
30
31
|
import { VirtualHostService } from './services/VirtualHostService';
|
|
31
32
|
export declare class DevopnessApiClient {
|
|
32
33
|
actions: ActionService;
|
|
34
|
+
apiTokens: ApiTokenService;
|
|
33
35
|
applications: ApplicationService;
|
|
34
36
|
credentials: CredentialService;
|
|
35
37
|
cronjobs: CronJobService;
|
|
@@ -59,6 +61,8 @@ export declare class DevopnessApiClient {
|
|
|
59
61
|
variables: VariableService;
|
|
60
62
|
virtualHosts: VirtualHostService;
|
|
61
63
|
constructor(options?: ConfigurationOptions);
|
|
64
|
+
get apiToken(): string | undefined;
|
|
65
|
+
set apiToken(value: string | undefined);
|
|
62
66
|
get accessToken(): string;
|
|
63
67
|
set accessToken(accessToken: string);
|
|
64
68
|
/**
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DevopnessApiClient = void 0;
|
|
4
4
|
const ActionService_1 = require("./services/ActionService");
|
|
5
5
|
const ApiBaseService_1 = require("./services/ApiBaseService");
|
|
6
|
+
const ApiTokenService_1 = require("./services/ApiTokenService");
|
|
6
7
|
const ApplicationService_1 = require("./services/ApplicationService");
|
|
7
8
|
const CredentialService_1 = require("./services/CredentialService");
|
|
8
9
|
const CronJobService_1 = require("./services/CronJobService");
|
|
@@ -38,6 +39,7 @@ class DevopnessApiClient {
|
|
|
38
39
|
// cause some (or all) of them depend on `ApiBaseService.configuration` property be set. Furthermore, we ensure all assertions
|
|
39
40
|
// for non provided required parameters are quickly returned to the end user before spending time loading extra resources
|
|
40
41
|
this.actions = new ActionService_1.ActionService();
|
|
42
|
+
this.apiTokens = new ApiTokenService_1.ApiTokenService();
|
|
41
43
|
this.applications = new ApplicationService_1.ApplicationService();
|
|
42
44
|
this.credentials = new CredentialService_1.CredentialService();
|
|
43
45
|
this.cronjobs = new CronJobService_1.CronJobService();
|
|
@@ -70,6 +72,12 @@ class DevopnessApiClient {
|
|
|
70
72
|
// do nothing.
|
|
71
73
|
};
|
|
72
74
|
}
|
|
75
|
+
get apiToken() {
|
|
76
|
+
return ApiBaseService_1.ApiBaseService.apiToken;
|
|
77
|
+
}
|
|
78
|
+
set apiToken(value) {
|
|
79
|
+
ApiBaseService_1.ApiBaseService.apiToken = value;
|
|
80
|
+
}
|
|
73
81
|
get accessToken() {
|
|
74
82
|
return ApiBaseService_1.ApiBaseService.accessToken;
|
|
75
83
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { ApiToken } from '../../generated/models';
|
|
15
|
+
import { ApiTokenProjectCreate } from '../../generated/models';
|
|
16
|
+
import { ApiTokenProjectRotate } from '../../generated/models';
|
|
17
|
+
import { ApiTokenRelation } from '../../generated/models';
|
|
18
|
+
import { ApiTokenRotateResponse } from '../../generated/models';
|
|
19
|
+
/**
|
|
20
|
+
* ProjectsApiTokensApiService - Auto-generated
|
|
21
|
+
*/
|
|
22
|
+
export declare class ProjectsApiTokensApiService extends ApiBaseService {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @summary Create a new api token for specific project.
|
|
26
|
+
* @param {number} projectId The ID of the project.
|
|
27
|
+
* @param {ApiTokenProjectCreate} apiTokenProjectCreate A JSON object containing the resource data
|
|
28
|
+
*/
|
|
29
|
+
addProjectApiToken(projectId: number, apiTokenProjectCreate: ApiTokenProjectCreate): Promise<ApiResponse<ApiToken>>;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @summary Get details of a specific project api token.
|
|
33
|
+
* @param {number} projectId The ID of the project.
|
|
34
|
+
* @param {string} tokenId The ID of the token.
|
|
35
|
+
*/
|
|
36
|
+
getProjectApiToken(projectId: number, tokenId: string): Promise<ApiResponse<ApiToken>>;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @summary List the api tokens of specific project.
|
|
40
|
+
* @param {number} projectId The ID of the project.
|
|
41
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
42
|
+
* @param {number} [perPage] Number of items returned per page
|
|
43
|
+
*/
|
|
44
|
+
listProjectApiTokens(projectId: number, page?: number, perPage?: number): Promise<ApiResponse<Array<ApiTokenRelation>>>;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @summary Revoke a specific project api token.
|
|
48
|
+
* @param {number} projectId The ID of the project.
|
|
49
|
+
* @param {string} tokenId The ID of the token.
|
|
50
|
+
*/
|
|
51
|
+
revokeProjectApiToken(projectId: number, tokenId: string): Promise<ApiResponse<void>>;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @summary Rotate a specific project api token.
|
|
55
|
+
* @param {number} projectId The ID of the project.
|
|
56
|
+
* @param {string} tokenId The ID of the token.
|
|
57
|
+
* @param {ApiTokenProjectRotate} apiTokenProjectRotate A JSON object containing the resource data
|
|
58
|
+
*/
|
|
59
|
+
rotateProjectApiToken(projectId: number, tokenId: string, apiTokenProjectRotate: ApiTokenProjectRotate): Promise<ApiResponse<ApiTokenRotateResponse>>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
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.ProjectsApiTokensApiService = 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
|
+
* ProjectsApiTokensApiService - Auto-generated
|
|
30
|
+
*/
|
|
31
|
+
class ProjectsApiTokensApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Create a new api token for specific project.
|
|
35
|
+
* @param {number} projectId The ID of the project.
|
|
36
|
+
* @param {ApiTokenProjectCreate} apiTokenProjectCreate A JSON object containing the resource data
|
|
37
|
+
*/
|
|
38
|
+
addProjectApiToken(projectId, apiTokenProjectCreate) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (projectId === null || projectId === undefined) {
|
|
41
|
+
throw new Exceptions_1.ArgumentNullException('projectId', 'addProjectApiToken');
|
|
42
|
+
}
|
|
43
|
+
if (apiTokenProjectCreate === null || apiTokenProjectCreate === undefined) {
|
|
44
|
+
throw new Exceptions_1.ArgumentNullException('apiTokenProjectCreate', 'addProjectApiToken');
|
|
45
|
+
}
|
|
46
|
+
let queryString = '';
|
|
47
|
+
const requestUrl = '/projects/{project_id}/tokens' + (queryString ? `?${queryString}` : '');
|
|
48
|
+
const response = yield this.post(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))), apiTokenProjectCreate);
|
|
49
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @summary Get details of a specific project api token.
|
|
55
|
+
* @param {number} projectId The ID of the project.
|
|
56
|
+
* @param {string} tokenId The ID of the token.
|
|
57
|
+
*/
|
|
58
|
+
getProjectApiToken(projectId, tokenId) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
if (projectId === null || projectId === undefined) {
|
|
61
|
+
throw new Exceptions_1.ArgumentNullException('projectId', 'getProjectApiToken');
|
|
62
|
+
}
|
|
63
|
+
if (tokenId === null || tokenId === undefined) {
|
|
64
|
+
throw new Exceptions_1.ArgumentNullException('tokenId', 'getProjectApiToken');
|
|
65
|
+
}
|
|
66
|
+
let queryString = '';
|
|
67
|
+
const requestUrl = '/projects/{project_id}/tokens/{token_id}' + (queryString ? `?${queryString}` : '');
|
|
68
|
+
const response = yield this.get(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))).replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId))));
|
|
69
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @summary List the api tokens of specific project.
|
|
75
|
+
* @param {number} projectId The ID of the project.
|
|
76
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
77
|
+
* @param {number} [perPage] Number of items returned per page
|
|
78
|
+
*/
|
|
79
|
+
listProjectApiTokens(projectId, page, perPage) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
if (projectId === null || projectId === undefined) {
|
|
82
|
+
throw new Exceptions_1.ArgumentNullException('projectId', 'listProjectApiTokens');
|
|
83
|
+
}
|
|
84
|
+
let queryString = '';
|
|
85
|
+
const queryParams = { page: page, per_page: perPage, };
|
|
86
|
+
for (const key in queryParams) {
|
|
87
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
91
|
+
}
|
|
92
|
+
const requestUrl = '/projects/{project_id}/tokens' + (queryString ? `?${queryString}` : '');
|
|
93
|
+
const response = yield this.get(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))));
|
|
94
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @summary Revoke a specific project api token.
|
|
100
|
+
* @param {number} projectId The ID of the project.
|
|
101
|
+
* @param {string} tokenId The ID of the token.
|
|
102
|
+
*/
|
|
103
|
+
revokeProjectApiToken(projectId, tokenId) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
if (projectId === null || projectId === undefined) {
|
|
106
|
+
throw new Exceptions_1.ArgumentNullException('projectId', 'revokeProjectApiToken');
|
|
107
|
+
}
|
|
108
|
+
if (tokenId === null || tokenId === undefined) {
|
|
109
|
+
throw new Exceptions_1.ArgumentNullException('tokenId', 'revokeProjectApiToken');
|
|
110
|
+
}
|
|
111
|
+
let queryString = '';
|
|
112
|
+
const requestUrl = '/projects/{project_id}/tokens/{token_id}/revoke' + (queryString ? `?${queryString}` : '');
|
|
113
|
+
const response = yield this.delete(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))).replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId))));
|
|
114
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @summary Rotate a specific project api token.
|
|
120
|
+
* @param {number} projectId The ID of the project.
|
|
121
|
+
* @param {string} tokenId The ID of the token.
|
|
122
|
+
* @param {ApiTokenProjectRotate} apiTokenProjectRotate A JSON object containing the resource data
|
|
123
|
+
*/
|
|
124
|
+
rotateProjectApiToken(projectId, tokenId, apiTokenProjectRotate) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
if (projectId === null || projectId === undefined) {
|
|
127
|
+
throw new Exceptions_1.ArgumentNullException('projectId', 'rotateProjectApiToken');
|
|
128
|
+
}
|
|
129
|
+
if (tokenId === null || tokenId === undefined) {
|
|
130
|
+
throw new Exceptions_1.ArgumentNullException('tokenId', 'rotateProjectApiToken');
|
|
131
|
+
}
|
|
132
|
+
if (apiTokenProjectRotate === null || apiTokenProjectRotate === undefined) {
|
|
133
|
+
throw new Exceptions_1.ArgumentNullException('apiTokenProjectRotate', 'rotateProjectApiToken');
|
|
134
|
+
}
|
|
135
|
+
let queryString = '';
|
|
136
|
+
const requestUrl = '/projects/{project_id}/tokens/{token_id}/rotate' + (queryString ? `?${queryString}` : '');
|
|
137
|
+
const response = yield this.post(requestUrl.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))).replace(`{${"token_id"}}`, encodeURIComponent(String(tokenId))), apiTokenProjectRotate);
|
|
138
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.ProjectsApiTokensApiService = ProjectsApiTokensApiService;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { PersonalAccessToken } from '../../generated/models';
|
|
15
|
+
import { PersonalAccessTokenRelation } from '../../generated/models';
|
|
16
|
+
import { PersonalAccessTokenRotateResponse } from '../../generated/models';
|
|
17
|
+
import { PersonalAccessTokenUserCreate } from '../../generated/models';
|
|
18
|
+
import { PersonalAccessTokenUserRotate } from '../../generated/models';
|
|
19
|
+
/**
|
|
20
|
+
* UsersPersonalAccessTokensApiService - Auto-generated
|
|
21
|
+
*/
|
|
22
|
+
export declare class UsersPersonalAccessTokensApiService extends ApiBaseService {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @summary Create a new personal access token for the authenticated user.
|
|
26
|
+
* @param {PersonalAccessTokenUserCreate} personalAccessTokenUserCreate A JSON object containing the resource data
|
|
27
|
+
*/
|
|
28
|
+
addUserPersonalAccessToken(personalAccessTokenUserCreate: PersonalAccessTokenUserCreate): Promise<ApiResponse<PersonalAccessToken>>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @summary Get details of a specific personal access token.
|
|
32
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
33
|
+
*/
|
|
34
|
+
getUserPersonalAccessToken(personalAccessTokenId: string): Promise<ApiResponse<PersonalAccessToken>>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @summary List the personal access tokens of authenticated user.
|
|
38
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
39
|
+
* @param {number} [perPage] Number of items returned per page
|
|
40
|
+
*/
|
|
41
|
+
listUserPersonalAccessTokens(page?: number, perPage?: number): Promise<ApiResponse<Array<PersonalAccessTokenRelation>>>;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @summary Revoke a specific personal access token.
|
|
45
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
46
|
+
*/
|
|
47
|
+
revokeUserPersonalAccessToken(personalAccessTokenId: string): Promise<ApiResponse<void>>;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @summary Rotate a specific personal access token.
|
|
51
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
52
|
+
* @param {PersonalAccessTokenUserRotate} personalAccessTokenUserRotate A JSON object containing the resource data
|
|
53
|
+
*/
|
|
54
|
+
rotateUserPersonalAccessToken(personalAccessTokenId: string, personalAccessTokenUserRotate: PersonalAccessTokenUserRotate): Promise<ApiResponse<PersonalAccessTokenRotateResponse>>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
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.UsersPersonalAccessTokensApiService = 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
|
+
* UsersPersonalAccessTokensApiService - Auto-generated
|
|
30
|
+
*/
|
|
31
|
+
class UsersPersonalAccessTokensApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Create a new personal access token for the authenticated user.
|
|
35
|
+
* @param {PersonalAccessTokenUserCreate} personalAccessTokenUserCreate A JSON object containing the resource data
|
|
36
|
+
*/
|
|
37
|
+
addUserPersonalAccessToken(personalAccessTokenUserCreate) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (personalAccessTokenUserCreate === null || personalAccessTokenUserCreate === undefined) {
|
|
40
|
+
throw new Exceptions_1.ArgumentNullException('personalAccessTokenUserCreate', 'addUserPersonalAccessToken');
|
|
41
|
+
}
|
|
42
|
+
let queryString = '';
|
|
43
|
+
const requestUrl = '/users/personal-access-tokens' + (queryString ? `?${queryString}` : '');
|
|
44
|
+
const response = yield this.post(requestUrl, personalAccessTokenUserCreate);
|
|
45
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @summary Get details of a specific personal access token.
|
|
51
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
52
|
+
*/
|
|
53
|
+
getUserPersonalAccessToken(personalAccessTokenId) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
if (personalAccessTokenId === null || personalAccessTokenId === undefined) {
|
|
56
|
+
throw new Exceptions_1.ArgumentNullException('personalAccessTokenId', 'getUserPersonalAccessToken');
|
|
57
|
+
}
|
|
58
|
+
let queryString = '';
|
|
59
|
+
const requestUrl = '/users/personal-access-tokens/{personal_access_token_id}' + (queryString ? `?${queryString}` : '');
|
|
60
|
+
const response = yield this.get(requestUrl.replace(`{${"personal_access_token_id"}}`, encodeURIComponent(String(personalAccessTokenId))));
|
|
61
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @summary List the personal access tokens of authenticated user.
|
|
67
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
68
|
+
* @param {number} [perPage] Number of items returned per page
|
|
69
|
+
*/
|
|
70
|
+
listUserPersonalAccessTokens(page, perPage) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
let queryString = '';
|
|
73
|
+
const queryParams = { page: page, per_page: perPage, };
|
|
74
|
+
for (const key in queryParams) {
|
|
75
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
79
|
+
}
|
|
80
|
+
const requestUrl = '/users/personal-access-tokens' + (queryString ? `?${queryString}` : '');
|
|
81
|
+
const response = yield this.get(requestUrl);
|
|
82
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @summary Revoke a specific personal access token.
|
|
88
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
89
|
+
*/
|
|
90
|
+
revokeUserPersonalAccessToken(personalAccessTokenId) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (personalAccessTokenId === null || personalAccessTokenId === undefined) {
|
|
93
|
+
throw new Exceptions_1.ArgumentNullException('personalAccessTokenId', 'revokeUserPersonalAccessToken');
|
|
94
|
+
}
|
|
95
|
+
let queryString = '';
|
|
96
|
+
const requestUrl = '/users/personal-access-tokens/{personal_access_token_id}/revoke' + (queryString ? `?${queryString}` : '');
|
|
97
|
+
const response = yield this.delete(requestUrl.replace(`{${"personal_access_token_id"}}`, encodeURIComponent(String(personalAccessTokenId))));
|
|
98
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @summary Rotate a specific personal access token.
|
|
104
|
+
* @param {string} personalAccessTokenId The ID of the personal access token.
|
|
105
|
+
* @param {PersonalAccessTokenUserRotate} personalAccessTokenUserRotate A JSON object containing the resource data
|
|
106
|
+
*/
|
|
107
|
+
rotateUserPersonalAccessToken(personalAccessTokenId, personalAccessTokenUserRotate) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
if (personalAccessTokenId === null || personalAccessTokenId === undefined) {
|
|
110
|
+
throw new Exceptions_1.ArgumentNullException('personalAccessTokenId', 'rotateUserPersonalAccessToken');
|
|
111
|
+
}
|
|
112
|
+
if (personalAccessTokenUserRotate === null || personalAccessTokenUserRotate === undefined) {
|
|
113
|
+
throw new Exceptions_1.ArgumentNullException('personalAccessTokenUserRotate', 'rotateUserPersonalAccessToken');
|
|
114
|
+
}
|
|
115
|
+
let queryString = '';
|
|
116
|
+
const requestUrl = '/users/personal-access-tokens/{personal_access_token_id}/rotate' + (queryString ? `?${queryString}` : '');
|
|
117
|
+
const response = yield this.post(requestUrl.replace(`{${"personal_access_token_id"}}`, encodeURIComponent(String(personalAccessTokenId))), personalAccessTokenUserRotate);
|
|
118
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.UsersPersonalAccessTokensApiService = UsersPersonalAccessTokensApiService;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
* The allowed expiration times for API Tokens.
|
|
14
|
+
* @export
|
|
15
|
+
* @enum {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare enum ApiTokenAllowedExpiration {
|
|
18
|
+
_7Days = "7 days",
|
|
19
|
+
_14Days = "14 days",
|
|
20
|
+
_30Days = "30 days",
|
|
21
|
+
_60Days = "60 days",
|
|
22
|
+
_90Days = "90 days"
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.ApiTokenAllowedExpiration = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* The allowed expiration times for API Tokens.
|
|
18
|
+
* @export
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
var ApiTokenAllowedExpiration;
|
|
22
|
+
(function (ApiTokenAllowedExpiration) {
|
|
23
|
+
ApiTokenAllowedExpiration["_7Days"] = "7 days";
|
|
24
|
+
ApiTokenAllowedExpiration["_14Days"] = "14 days";
|
|
25
|
+
ApiTokenAllowedExpiration["_30Days"] = "30 days";
|
|
26
|
+
ApiTokenAllowedExpiration["_60Days"] = "60 days";
|
|
27
|
+
ApiTokenAllowedExpiration["_90Days"] = "90 days";
|
|
28
|
+
})(ApiTokenAllowedExpiration || (exports.ApiTokenAllowedExpiration = ApiTokenAllowedExpiration = {}));
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { ApiTokenAllowedExpiration } from './api-token-allowed-expiration';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ApiTokenProjectCreate
|
|
17
|
+
*/
|
|
18
|
+
export interface ApiTokenProjectCreate {
|
|
19
|
+
/**
|
|
20
|
+
* Name of the token. Must be at least 3 characters. Must not be greater than 255 characters.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof ApiTokenProjectCreate
|
|
23
|
+
*/
|
|
24
|
+
name: string;
|
|
25
|
+
/**
|
|
26
|
+
* The ID of the role that the token is associated with.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @memberof ApiTokenProjectCreate
|
|
29
|
+
*/
|
|
30
|
+
role_id: number;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {ApiTokenAllowedExpiration}
|
|
34
|
+
* @memberof ApiTokenProjectCreate
|
|
35
|
+
*/
|
|
36
|
+
expires_in: ApiTokenAllowedExpiration;
|
|
37
|
+
}
|
|
@@ -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 });
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { ApiTokenAllowedExpiration } from './api-token-allowed-expiration';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ApiTokenProjectRotate
|
|
17
|
+
*/
|
|
18
|
+
export interface ApiTokenProjectRotate {
|
|
19
|
+
/**
|
|
20
|
+
* The unique identifier of the token.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof ApiTokenProjectRotate
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {ApiTokenAllowedExpiration}
|
|
28
|
+
* @memberof ApiTokenProjectRotate
|
|
29
|
+
*/
|
|
30
|
+
expires_in: ApiTokenAllowedExpiration;
|
|
31
|
+
}
|
|
@@ -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 });
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { ApiTokenStatus } from './api-token-status';
|
|
13
|
+
import { ApiTokenType } from './api-token-type';
|
|
14
|
+
import { RoleRelation } from './role-relation';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @interface ApiTokenRelation
|
|
19
|
+
*/
|
|
20
|
+
export interface ApiTokenRelation {
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier of the Token
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @memberof ApiTokenRelation
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* Name of the Token
|
|
29
|
+
* @type {string}
|
|
30
|
+
* @memberof ApiTokenRelation
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {ApiTokenType}
|
|
36
|
+
* @memberof ApiTokenRelation
|
|
37
|
+
*/
|
|
38
|
+
type: ApiTokenType;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {ApiTokenStatus}
|
|
42
|
+
* @memberof ApiTokenRelation
|
|
43
|
+
*/
|
|
44
|
+
status: ApiTokenStatus;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @type {RoleRelation}
|
|
48
|
+
* @memberof ApiTokenRelation
|
|
49
|
+
*/
|
|
50
|
+
role: RoleRelation | null;
|
|
51
|
+
/**
|
|
52
|
+
* Last time the Token was used
|
|
53
|
+
* @type {string}
|
|
54
|
+
* @memberof ApiTokenRelation
|
|
55
|
+
*/
|
|
56
|
+
last_used_at: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Expiration date of the Token
|
|
59
|
+
* @type {string}
|
|
60
|
+
* @memberof ApiTokenRelation
|
|
61
|
+
*/
|
|
62
|
+
expires_at: string;
|
|
63
|
+
/**
|
|
64
|
+
* Revocation date of the Token
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @memberof ApiTokenRelation
|
|
67
|
+
*/
|
|
68
|
+
revoked_at: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Last time the Token was updated
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @memberof ApiTokenRelation
|
|
73
|
+
*/
|
|
74
|
+
updated_at: string;
|
|
75
|
+
/**
|
|
76
|
+
* Creation date of the Token
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @memberof ApiTokenRelation
|
|
79
|
+
*/
|
|
80
|
+
created_at: string;
|
|
81
|
+
}
|