@devopness/sdk-js 1.97.0 → 1.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/README.md +21 -1
- package/dist/api/generated/apis/hooks-incoming-api.d.ts +10 -10
- package/dist/api/generated/apis/hooks-incoming-api.js +24 -24
- package/dist/api/generated/apis/hooks-outgoing-api.d.ts +9 -9
- package/dist/api/generated/apis/hooks-outgoing-api.js +19 -19
- package/dist/api/generated/apis/hooks-requests-api.d.ts +4 -4
- package/dist/api/generated/apis/hooks-requests-api.js +12 -12
- package/dist/api/generated/models/cloud-service.d.ts +10 -1
- package/dist/api/generated/models/cloud-service.js +11 -0
- package/dist/api/generated/models/deployment-origin.d.ts +20 -0
- package/dist/api/generated/models/deployment-origin.js +25 -0
- package/dist/api/generated/models/deployment-source.d.ts +34 -6
- package/dist/api/generated/models/deployment-source.js +0 -12
- package/dist/api/generated/models/hook-incoming-create.d.ts +10 -3
- package/dist/api/generated/models/hook-incoming-params.d.ts +38 -0
- package/dist/api/generated/models/{hook-setting.js → hook-incoming-params.js} +0 -0
- package/dist/api/generated/models/{hook-setting.d.ts → hook-incoming-setting.d.ts} +4 -4
- package/dist/api/generated/models/hook-incoming-setting.js +14 -0
- package/dist/api/generated/models/hook-incoming-trigger-when-condition-type.d.ts +19 -0
- package/dist/api/generated/models/hook-incoming-trigger-when-condition-type.js +24 -0
- package/dist/api/generated/models/hook-incoming-trigger-when-condition.d.ts +43 -0
- package/dist/api/generated/models/hook-incoming-trigger-when-condition.js +14 -0
- package/dist/api/generated/models/hook-incoming-update.d.ts +14 -0
- package/dist/api/generated/models/hook-incoming.d.ts +18 -0
- package/dist/api/generated/models/hook-incoming.js +14 -0
- package/dist/api/generated/models/hook-outgoing-create.d.ts +11 -3
- package/dist/api/generated/models/hook-outgoing-params.d.ts +38 -0
- package/dist/api/generated/models/hook-outgoing-params.js +14 -0
- package/dist/api/generated/models/hook-outgoing-request-header.d.ts +30 -0
- package/dist/api/generated/models/hook-outgoing-request-header.js +14 -0
- package/dist/api/generated/models/hook-outgoing-setting.d.ts +31 -0
- package/dist/api/generated/models/hook-outgoing-setting.js +14 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-action-status.d.ts +21 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-action-status.js +26 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-condition-type.d.ts +19 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-condition-type.js +24 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-condition.d.ts +32 -0
- package/dist/api/generated/models/hook-outgoing-trigger-when-condition.js +14 -0
- package/dist/api/generated/models/hook-outgoing-update.d.ts +11 -3
- package/dist/api/generated/models/hook-outgoing.d.ts +18 -0
- package/dist/api/generated/models/hook-outgoing.js +14 -0
- package/dist/api/generated/models/hook-relation.d.ts +9 -6
- package/dist/api/generated/models/hook-variable.d.ts +6 -0
- package/dist/api/generated/models/hook.d.ts +1 -26
- package/dist/api/generated/models/index.d.ts +13 -1
- package/dist/api/generated/models/index.js +13 -1
- package/dist/api/generated/models/server-cloud-service-name.d.ts +2 -1
- package/dist/api/generated/models/server-cloud-service-name.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,9 +78,29 @@ async function getUserProfile() {
|
|
|
78
78
|
getUserProfile();
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
|
|
82
81
|
### TypeScript support
|
|
83
82
|
This package includes TypeScript declarations for every method.
|
|
84
83
|
TypeScript versions `>= 3.8` are supported.
|
|
85
84
|
|
|
86
85
|
Some methods in `Devopness SDK JavaScript` accept and return objects from the Devopness API. The type declarations for these objects will always track the latest version of the API. Therefore, if you'e using the latest version of this package you can rely on the Devopness API documentation for checking the input and return types of each API endpoint.
|
|
86
|
+
|
|
87
|
+
## Building and testing
|
|
88
|
+
To build and test the SDK locally, follow these steps:
|
|
89
|
+
1. Clone de repository
|
|
90
|
+
```
|
|
91
|
+
git clone https://github.com/devopness/devopness-sdk-js.git
|
|
92
|
+
```
|
|
93
|
+
2. Install missing dependencies
|
|
94
|
+
|
|
95
|
+
This command will install all modules listed as dependencies in [package.json](package.json). A working Java Runtime Environment is also required. Please, check out the installation instructions for your operating system.
|
|
96
|
+
```
|
|
97
|
+
npm install
|
|
98
|
+
```
|
|
99
|
+
3. Build
|
|
100
|
+
```
|
|
101
|
+
npm run build-api-models
|
|
102
|
+
```
|
|
103
|
+
4. Run tests
|
|
104
|
+
```
|
|
105
|
+
npm run test
|
|
106
|
+
```
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { ApiBaseService } from "../../../services/ApiBaseService";
|
|
13
13
|
import { ApiResponse } from "../../../common/ApiResponse";
|
|
14
|
-
import {
|
|
14
|
+
import { HookIncoming } from '../../generated/models';
|
|
15
15
|
import { HookIncomingCreate } from '../../generated/models';
|
|
16
16
|
import { HookIncomingUpdate } from '../../generated/models';
|
|
17
17
|
/**
|
|
@@ -23,31 +23,31 @@ export declare class HooksIncomingApiService extends ApiBaseService {
|
|
|
23
23
|
* @summary Create an incoming hook to a specific resource
|
|
24
24
|
* @param {HookIncomingCreate} hookIncomingCreate A JSON object containing incoming hook data
|
|
25
25
|
*/
|
|
26
|
-
addIncomingHook(hookIncomingCreate: HookIncomingCreate): Promise<ApiResponse<
|
|
26
|
+
addIncomingHook(hookIncomingCreate: HookIncomingCreate): Promise<ApiResponse<HookIncoming>>;
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
* @summary Delete a given incoming hook
|
|
30
|
-
* @param {string}
|
|
30
|
+
* @param {string} hookIncomingId Unique ID of the incoming hook to be deleted
|
|
31
31
|
*/
|
|
32
|
-
deleteIncomingHook(
|
|
32
|
+
deleteIncomingHook(hookIncomingId: string): Promise<ApiResponse<void>>;
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
35
|
* @summary Get an incoming hook by Id
|
|
36
|
-
* @param {string}
|
|
36
|
+
* @param {string} hookIncomingId Unique ID of the hook to be retrieved
|
|
37
37
|
*/
|
|
38
|
-
getIncomingHook(
|
|
38
|
+
getIncomingHook(hookIncomingId: string): Promise<ApiResponse<HookIncoming>>;
|
|
39
39
|
/**
|
|
40
40
|
*
|
|
41
41
|
* @summary Trigger an incoming hook associated action
|
|
42
|
-
* @param {string}
|
|
42
|
+
* @param {string} hookIncomingId Unique ID of the hook to be triggered
|
|
43
43
|
* @param {object} [body] A JSON object containg hook variables
|
|
44
44
|
*/
|
|
45
|
-
triggerHook(
|
|
45
|
+
triggerHook(hookIncomingId: string, body?: object): Promise<ApiResponse<void>>;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @summary Update an existing incoming hook
|
|
49
|
-
* @param {string}
|
|
49
|
+
* @param {string} hookIncomingId Unique ID of the hook to be updated
|
|
50
50
|
* @param {HookIncomingUpdate} hookIncomingUpdate A JSON object containing incoming hook data
|
|
51
51
|
*/
|
|
52
|
-
updateIncomingHook(
|
|
52
|
+
updateIncomingHook(hookIncomingId: string, hookIncomingUpdate: HookIncomingUpdate): Promise<ApiResponse<void>>;
|
|
53
53
|
}
|
|
@@ -48,69 +48,69 @@ class HooksIncomingApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
50
|
* @summary Delete a given incoming hook
|
|
51
|
-
* @param {string}
|
|
51
|
+
* @param {string} hookIncomingId Unique ID of the incoming hook to be deleted
|
|
52
52
|
*/
|
|
53
|
-
deleteIncomingHook(
|
|
53
|
+
deleteIncomingHook(hookIncomingId) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (
|
|
56
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
55
|
+
if (hookIncomingId === null || hookIncomingId === undefined) {
|
|
56
|
+
throw new Exceptions_1.ArgumentNullException('hookIncomingId', 'deleteIncomingHook');
|
|
57
57
|
}
|
|
58
58
|
let queryString = '';
|
|
59
|
-
const requestUrl = '/hooks/incoming/{
|
|
60
|
-
const response = yield this.delete(requestUrl.replace(`{${"
|
|
59
|
+
const requestUrl = '/hooks/incoming/{hook_incoming_id}' + (queryString ? `?${queryString}` : '');
|
|
60
|
+
const response = yield this.delete(requestUrl.replace(`{${"hook_incoming_id"}}`, encodeURIComponent(String(hookIncomingId))));
|
|
61
61
|
return new ApiResponse_1.ApiResponse(response);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @summary Get an incoming hook by Id
|
|
67
|
-
* @param {string}
|
|
67
|
+
* @param {string} hookIncomingId Unique ID of the hook to be retrieved
|
|
68
68
|
*/
|
|
69
|
-
getIncomingHook(
|
|
69
|
+
getIncomingHook(hookIncomingId) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (
|
|
72
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
71
|
+
if (hookIncomingId === null || hookIncomingId === undefined) {
|
|
72
|
+
throw new Exceptions_1.ArgumentNullException('hookIncomingId', 'getIncomingHook');
|
|
73
73
|
}
|
|
74
74
|
let queryString = '';
|
|
75
|
-
const requestUrl = '/hooks/incoming/{
|
|
76
|
-
const response = yield this.get(requestUrl.replace(`{${"
|
|
75
|
+
const requestUrl = '/hooks/incoming/{hook_incoming_id}' + (queryString ? `?${queryString}` : '');
|
|
76
|
+
const response = yield this.get(requestUrl.replace(`{${"hook_incoming_id"}}`, encodeURIComponent(String(hookIncomingId))));
|
|
77
77
|
return new ApiResponse_1.ApiResponse(response);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
*
|
|
82
82
|
* @summary Trigger an incoming hook associated action
|
|
83
|
-
* @param {string}
|
|
83
|
+
* @param {string} hookIncomingId Unique ID of the hook to be triggered
|
|
84
84
|
* @param {object} [body] A JSON object containg hook variables
|
|
85
85
|
*/
|
|
86
|
-
triggerHook(
|
|
86
|
+
triggerHook(hookIncomingId, body) {
|
|
87
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
if (
|
|
89
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
88
|
+
if (hookIncomingId === null || hookIncomingId === undefined) {
|
|
89
|
+
throw new Exceptions_1.ArgumentNullException('hookIncomingId', 'triggerHook');
|
|
90
90
|
}
|
|
91
91
|
let queryString = '';
|
|
92
|
-
const requestUrl = '/hooks/incoming/{
|
|
93
|
-
const response = yield this.post(requestUrl.replace(`{${"
|
|
92
|
+
const requestUrl = '/hooks/incoming/{hook_incoming_id}' + (queryString ? `?${queryString}` : '');
|
|
93
|
+
const response = yield this.post(requestUrl.replace(`{${"hook_incoming_id"}}`, encodeURIComponent(String(hookIncomingId))));
|
|
94
94
|
return new ApiResponse_1.ApiResponse(response);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
*
|
|
99
99
|
* @summary Update an existing incoming hook
|
|
100
|
-
* @param {string}
|
|
100
|
+
* @param {string} hookIncomingId Unique ID of the hook to be updated
|
|
101
101
|
* @param {HookIncomingUpdate} hookIncomingUpdate A JSON object containing incoming hook data
|
|
102
102
|
*/
|
|
103
|
-
updateIncomingHook(
|
|
103
|
+
updateIncomingHook(hookIncomingId, hookIncomingUpdate) {
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
if (
|
|
106
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
105
|
+
if (hookIncomingId === null || hookIncomingId === undefined) {
|
|
106
|
+
throw new Exceptions_1.ArgumentNullException('hookIncomingId', 'updateIncomingHook');
|
|
107
107
|
}
|
|
108
108
|
if (hookIncomingUpdate === null || hookIncomingUpdate === undefined) {
|
|
109
109
|
throw new Exceptions_1.ArgumentNullException('hookIncomingUpdate', 'updateIncomingHook');
|
|
110
110
|
}
|
|
111
111
|
let queryString = '';
|
|
112
|
-
const requestUrl = '/hooks/incoming/{
|
|
113
|
-
const response = yield this.put(requestUrl.replace(`{${"
|
|
112
|
+
const requestUrl = '/hooks/incoming/{hook_incoming_id}' + (queryString ? `?${queryString}` : '');
|
|
113
|
+
const response = yield this.put(requestUrl.replace(`{${"hook_incoming_id"}}`, encodeURIComponent(String(hookIncomingId))), hookIncomingUpdate);
|
|
114
114
|
return new ApiResponse_1.ApiResponse(response);
|
|
115
115
|
});
|
|
116
116
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { ApiBaseService } from "../../../services/ApiBaseService";
|
|
13
13
|
import { ApiResponse } from "../../../common/ApiResponse";
|
|
14
|
-
import {
|
|
14
|
+
import { HookOutgoing } from '../../generated/models';
|
|
15
15
|
import { HookOutgoingCreate } from '../../generated/models';
|
|
16
16
|
import { HookOutgoingUpdate } from '../../generated/models';
|
|
17
17
|
/**
|
|
@@ -19,28 +19,28 @@ import { HookOutgoingUpdate } from '../../generated/models';
|
|
|
19
19
|
*/
|
|
20
20
|
export declare class HooksOutgoingApiService extends ApiBaseService {
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* The fields `target_url`, `settings.request_body` and `settings.request_headers` accept variables that will be expanded when the hook is triggered. The syntax to use variables are using dot-notation inside `{{` and `}}` tags, for example: ```json { \"settings\": { \"request_headers\": [ { \"name\": \"Authorization\", \"value\": \"Bearer {{ application.source_provider.access_token }}\" } ] } } ``` Where `{{ application.source_provider.access_token }}` will be expanded to access token of the application related to outgoing hook by `resource_type` and `resource_id` fields. The valid resources that can be accesed by variables are: * `action` - The action that have triggered the hook. The fields are the same returned by the [GET /actions/{id}](#operation/getAction) endpoint, e.g.: `{{ action.status }}` * `hook` - The outgoing hook itself. The fields are the same returned by the [GET /hooks/outgoing/{id}](#operation/getOutgoingHook) endpoint, e.g.: `{{ hook.secret }}` * `user` - The user that triggered the hook. The fields are the same returned by the [GET /users/{id}](#operation/getUser) endpoint, e.g.: `{{ user.name }}` And the resource related to outgoing hook is also accessible by variables using it\'s resource name. For instance an outgoing hook related to a daemon can get the daemon\'s command using: `{{ daemon.command }}` If the resource is an application, the deployment resource is also accessible by variables. For instance `{{ deployment.source.pull_request_id }}` to get the pull request source information of the deployment. **Note**: usually sub-resources relations of a resource are not accessible on outgoing hooks variables. For instance the `{{ daemon.project.name }}` is **not** a valid variable. An exception to this rule is the `application` resource that has the `source_provider` sub-resource that exposes the additional `access_token` field, which is not public by default.
|
|
23
23
|
* @summary Create an outgoing hook to a specific resource
|
|
24
24
|
* @param {HookOutgoingCreate} hookOutgoingCreate A JSON object containing outgoing hook data
|
|
25
25
|
*/
|
|
26
|
-
addOutgoinHook(hookOutgoingCreate: HookOutgoingCreate): Promise<ApiResponse<
|
|
26
|
+
addOutgoinHook(hookOutgoingCreate: HookOutgoingCreate): Promise<ApiResponse<HookOutgoing>>;
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
* @summary Delete a given outgoing hook
|
|
30
|
-
* @param {string}
|
|
30
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be deleted
|
|
31
31
|
*/
|
|
32
|
-
deleteOutgoingHook(
|
|
32
|
+
deleteOutgoingHook(hookOutgoingId: string): Promise<ApiResponse<void>>;
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
35
|
* @summary Get an outgoing hook by Id
|
|
36
|
-
* @param {string}
|
|
36
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be retrieved
|
|
37
37
|
*/
|
|
38
|
-
getOutgoingHook(
|
|
38
|
+
getOutgoingHook(hookOutgoingId: string): Promise<ApiResponse<HookOutgoing>>;
|
|
39
39
|
/**
|
|
40
40
|
*
|
|
41
41
|
* @summary Update an existing outgoing hook
|
|
42
|
-
* @param {string}
|
|
42
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be updated
|
|
43
43
|
* @param {HookOutgoingUpdate} hookOutgoingUpdate A JSON object containing outgoing hook data
|
|
44
44
|
*/
|
|
45
|
-
updateOutgoingHook(
|
|
45
|
+
updateOutgoingHook(hookOutgoingId: string, hookOutgoingUpdate: HookOutgoingUpdate): Promise<ApiResponse<void>>;
|
|
46
46
|
}
|
|
@@ -30,7 +30,7 @@ const Exceptions_1 = require("../../../common/Exceptions");
|
|
|
30
30
|
*/
|
|
31
31
|
class HooksOutgoingApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* The fields `target_url`, `settings.request_body` and `settings.request_headers` accept variables that will be expanded when the hook is triggered. The syntax to use variables are using dot-notation inside `{{` and `}}` tags, for example: ```json { \"settings\": { \"request_headers\": [ { \"name\": \"Authorization\", \"value\": \"Bearer {{ application.source_provider.access_token }}\" } ] } } ``` Where `{{ application.source_provider.access_token }}` will be expanded to access token of the application related to outgoing hook by `resource_type` and `resource_id` fields. The valid resources that can be accesed by variables are: * `action` - The action that have triggered the hook. The fields are the same returned by the [GET /actions/{id}](#operation/getAction) endpoint, e.g.: `{{ action.status }}` * `hook` - The outgoing hook itself. The fields are the same returned by the [GET /hooks/outgoing/{id}](#operation/getOutgoingHook) endpoint, e.g.: `{{ hook.secret }}` * `user` - The user that triggered the hook. The fields are the same returned by the [GET /users/{id}](#operation/getUser) endpoint, e.g.: `{{ user.name }}` And the resource related to outgoing hook is also accessible by variables using it\'s resource name. For instance an outgoing hook related to a daemon can get the daemon\'s command using: `{{ daemon.command }}` If the resource is an application, the deployment resource is also accessible by variables. For instance `{{ deployment.source.pull_request_id }}` to get the pull request source information of the deployment. **Note**: usually sub-resources relations of a resource are not accessible on outgoing hooks variables. For instance the `{{ daemon.project.name }}` is **not** a valid variable. An exception to this rule is the `application` resource that has the `source_provider` sub-resource that exposes the additional `access_token` field, which is not public by default.
|
|
34
34
|
* @summary Create an outgoing hook to a specific resource
|
|
35
35
|
* @param {HookOutgoingCreate} hookOutgoingCreate A JSON object containing outgoing hook data
|
|
36
36
|
*/
|
|
@@ -48,52 +48,52 @@ class HooksOutgoingApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
50
|
* @summary Delete a given outgoing hook
|
|
51
|
-
* @param {string}
|
|
51
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be deleted
|
|
52
52
|
*/
|
|
53
|
-
deleteOutgoingHook(
|
|
53
|
+
deleteOutgoingHook(hookOutgoingId) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (
|
|
56
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
55
|
+
if (hookOutgoingId === null || hookOutgoingId === undefined) {
|
|
56
|
+
throw new Exceptions_1.ArgumentNullException('hookOutgoingId', 'deleteOutgoingHook');
|
|
57
57
|
}
|
|
58
58
|
let queryString = '';
|
|
59
|
-
const requestUrl = '/hooks/outgoing/{
|
|
60
|
-
const response = yield this.delete(requestUrl.replace(`{${"
|
|
59
|
+
const requestUrl = '/hooks/outgoing/{hook_outgoing_id}' + (queryString ? `?${queryString}` : '');
|
|
60
|
+
const response = yield this.delete(requestUrl.replace(`{${"hook_outgoing_id"}}`, encodeURIComponent(String(hookOutgoingId))));
|
|
61
61
|
return new ApiResponse_1.ApiResponse(response);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @summary Get an outgoing hook by Id
|
|
67
|
-
* @param {string}
|
|
67
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be retrieved
|
|
68
68
|
*/
|
|
69
|
-
getOutgoingHook(
|
|
69
|
+
getOutgoingHook(hookOutgoingId) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (
|
|
72
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
71
|
+
if (hookOutgoingId === null || hookOutgoingId === undefined) {
|
|
72
|
+
throw new Exceptions_1.ArgumentNullException('hookOutgoingId', 'getOutgoingHook');
|
|
73
73
|
}
|
|
74
74
|
let queryString = '';
|
|
75
|
-
const requestUrl = '/hooks/outgoing/{
|
|
76
|
-
const response = yield this.get(requestUrl.replace(`{${"
|
|
75
|
+
const requestUrl = '/hooks/outgoing/{hook_outgoing_id}' + (queryString ? `?${queryString}` : '');
|
|
76
|
+
const response = yield this.get(requestUrl.replace(`{${"hook_outgoing_id"}}`, encodeURIComponent(String(hookOutgoingId))));
|
|
77
77
|
return new ApiResponse_1.ApiResponse(response);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
*
|
|
82
82
|
* @summary Update an existing outgoing hook
|
|
83
|
-
* @param {string}
|
|
83
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to be updated
|
|
84
84
|
* @param {HookOutgoingUpdate} hookOutgoingUpdate A JSON object containing outgoing hook data
|
|
85
85
|
*/
|
|
86
|
-
updateOutgoingHook(
|
|
86
|
+
updateOutgoingHook(hookOutgoingId, hookOutgoingUpdate) {
|
|
87
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
if (
|
|
89
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
88
|
+
if (hookOutgoingId === null || hookOutgoingId === undefined) {
|
|
89
|
+
throw new Exceptions_1.ArgumentNullException('hookOutgoingId', 'updateOutgoingHook');
|
|
90
90
|
}
|
|
91
91
|
if (hookOutgoingUpdate === null || hookOutgoingUpdate === undefined) {
|
|
92
92
|
throw new Exceptions_1.ArgumentNullException('hookOutgoingUpdate', 'updateOutgoingHook');
|
|
93
93
|
}
|
|
94
94
|
let queryString = '';
|
|
95
|
-
const requestUrl = '/hooks/outgoing/{
|
|
96
|
-
const response = yield this.put(requestUrl.replace(`{${"
|
|
95
|
+
const requestUrl = '/hooks/outgoing/{hook_outgoing_id}' + (queryString ? `?${queryString}` : '');
|
|
96
|
+
const response = yield this.put(requestUrl.replace(`{${"hook_outgoing_id"}}`, encodeURIComponent(String(hookOutgoingId))), hookOutgoingUpdate);
|
|
97
97
|
return new ApiResponse_1.ApiResponse(response);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -26,13 +26,13 @@ export declare class HooksRequestsApiService extends ApiBaseService {
|
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
28
28
|
* @summary Returns a list of all hook requests belonging to an incoming hook
|
|
29
|
-
* @param {string}
|
|
29
|
+
* @param {string} hookIncomingId Unique ID of the incoming hook to retrieve request list
|
|
30
30
|
*/
|
|
31
|
-
listIncomingHookRequests(
|
|
31
|
+
listIncomingHookRequests(hookIncomingId: string): Promise<ApiResponse<Array<HookRequestRelation>>>;
|
|
32
32
|
/**
|
|
33
33
|
*
|
|
34
34
|
* @summary Returns a list of all hook requests belonging to an outgoing hook
|
|
35
|
-
* @param {string}
|
|
35
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to retrieve request list
|
|
36
36
|
*/
|
|
37
|
-
listOutgoingHookRequests(
|
|
37
|
+
listOutgoingHookRequests(hookOutgoingId: string): Promise<ApiResponse<Array<HookRequestRelation>>>;
|
|
38
38
|
}
|
|
@@ -48,32 +48,32 @@ class HooksRequestsApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
50
|
* @summary Returns a list of all hook requests belonging to an incoming hook
|
|
51
|
-
* @param {string}
|
|
51
|
+
* @param {string} hookIncomingId Unique ID of the incoming hook to retrieve request list
|
|
52
52
|
*/
|
|
53
|
-
listIncomingHookRequests(
|
|
53
|
+
listIncomingHookRequests(hookIncomingId) {
|
|
54
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (
|
|
56
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
55
|
+
if (hookIncomingId === null || hookIncomingId === undefined) {
|
|
56
|
+
throw new Exceptions_1.ArgumentNullException('hookIncomingId', 'listIncomingHookRequests');
|
|
57
57
|
}
|
|
58
58
|
let queryString = '';
|
|
59
|
-
const requestUrl = '/hooks/incoming/{
|
|
60
|
-
const response = yield this.get(requestUrl.replace(`{${"
|
|
59
|
+
const requestUrl = '/hooks/incoming/{hook_incoming_id}/requests' + (queryString ? `?${queryString}` : '');
|
|
60
|
+
const response = yield this.get(requestUrl.replace(`{${"hook_incoming_id"}}`, encodeURIComponent(String(hookIncomingId))));
|
|
61
61
|
return new ApiResponse_1.ApiResponse(response);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @summary Returns a list of all hook requests belonging to an outgoing hook
|
|
67
|
-
* @param {string}
|
|
67
|
+
* @param {string} hookOutgoingId Unique ID of the outgoing hook to retrieve request list
|
|
68
68
|
*/
|
|
69
|
-
listOutgoingHookRequests(
|
|
69
|
+
listOutgoingHookRequests(hookOutgoingId) {
|
|
70
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (
|
|
72
|
-
throw new Exceptions_1.ArgumentNullException('
|
|
71
|
+
if (hookOutgoingId === null || hookOutgoingId === undefined) {
|
|
72
|
+
throw new Exceptions_1.ArgumentNullException('hookOutgoingId', 'listOutgoingHookRequests');
|
|
73
73
|
}
|
|
74
74
|
let queryString = '';
|
|
75
|
-
const requestUrl = '/hooks/outgoing/{
|
|
76
|
-
const response = yield this.get(requestUrl.replace(`{${"
|
|
75
|
+
const requestUrl = '/hooks/outgoing/{hook_outgoing_id}/requests' + (queryString ? `?${queryString}` : '');
|
|
76
|
+
const response = yield this.get(requestUrl.replace(`{${"hook_outgoing_id"}}`, encodeURIComponent(String(hookOutgoingId))));
|
|
77
77
|
return new ApiResponse_1.ApiResponse(response);
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -22,7 +22,7 @@ export interface CloudService {
|
|
|
22
22
|
* @type {string}
|
|
23
23
|
* @memberof CloudService
|
|
24
24
|
*/
|
|
25
|
-
code:
|
|
25
|
+
code: CloudServiceCodeEnum;
|
|
26
26
|
/**
|
|
27
27
|
* The full name of the cloud service
|
|
28
28
|
* @type {string}
|
|
@@ -42,3 +42,12 @@ export interface CloudService {
|
|
|
42
42
|
*/
|
|
43
43
|
os: Array<OperatingSystem>;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* @export
|
|
47
|
+
* @enum {string}
|
|
48
|
+
*/
|
|
49
|
+
export declare enum CloudServiceCodeEnum {
|
|
50
|
+
Ec2 = "ec2",
|
|
51
|
+
Droplet = "droplet",
|
|
52
|
+
GcpGce = "gcp-gce"
|
|
53
|
+
}
|
|
@@ -12,3 +12,14 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CloudServiceCodeEnum = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* @export
|
|
18
|
+
* @enum {string}
|
|
19
|
+
*/
|
|
20
|
+
var CloudServiceCodeEnum;
|
|
21
|
+
(function (CloudServiceCodeEnum) {
|
|
22
|
+
CloudServiceCodeEnum["Ec2"] = "ec2";
|
|
23
|
+
CloudServiceCodeEnum["Droplet"] = "droplet";
|
|
24
|
+
CloudServiceCodeEnum["GcpGce"] = "gcp-gce";
|
|
25
|
+
})(CloudServiceCodeEnum = exports.CloudServiceCodeEnum || (exports.CloudServiceCodeEnum = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* Source/channel from which the deployment has been triggered
|
|
14
|
+
* @export
|
|
15
|
+
* @enum {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare enum DeploymentOrigin {
|
|
18
|
+
Hook = "hook",
|
|
19
|
+
Manual = "manual"
|
|
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.DeploymentOrigin = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* Source/channel from which the deployment has been triggered
|
|
18
|
+
* @export
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
var DeploymentOrigin;
|
|
22
|
+
(function (DeploymentOrigin) {
|
|
23
|
+
DeploymentOrigin["Hook"] = "hook";
|
|
24
|
+
DeploymentOrigin["Manual"] = "manual";
|
|
25
|
+
})(DeploymentOrigin = exports.DeploymentOrigin || (exports.DeploymentOrigin = {}));
|
|
@@ -9,13 +9,41 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
import { DeploymentOrigin } from './deployment-origin';
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Deployment source information
|
|
14
15
|
* @export
|
|
15
|
-
* @
|
|
16
|
+
* @interface DeploymentSource
|
|
16
17
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export interface DeploymentSource {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {DeploymentOrigin}
|
|
22
|
+
* @memberof DeploymentSource
|
|
23
|
+
*/
|
|
24
|
+
origin: DeploymentOrigin;
|
|
25
|
+
/**
|
|
26
|
+
* The IP address from the deployment has been triggered
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof DeploymentSource
|
|
29
|
+
*/
|
|
30
|
+
ip_address: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* The hook that has been triggered the deployment
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof DeploymentSource
|
|
35
|
+
*/
|
|
36
|
+
hook_id: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* The hook request\'s ID that have triggered the deployment
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof DeploymentSource
|
|
41
|
+
*/
|
|
42
|
+
hook_request_id: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* The pull request that have triggered the deployment
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof DeploymentSource
|
|
47
|
+
*/
|
|
48
|
+
pull_request_id: number | null;
|
|
21
49
|
}
|
|
@@ -12,15 +12,3 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DeploymentSource = void 0;
|
|
16
|
-
/**
|
|
17
|
-
* Source/channel from which the deployment has been triggered
|
|
18
|
-
* @export
|
|
19
|
-
* @enum {string}
|
|
20
|
-
*/
|
|
21
|
-
var DeploymentSource;
|
|
22
|
-
(function (DeploymentSource) {
|
|
23
|
-
DeploymentSource["Manual"] = "manual";
|
|
24
|
-
DeploymentSource["GitPush"] = "git-push";
|
|
25
|
-
DeploymentSource["Scheduled"] = "scheduled";
|
|
26
|
-
})(DeploymentSource = exports.DeploymentSource || (exports.DeploymentSource = {}));
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import { ActionType } from './action-type';
|
|
13
|
-
import {
|
|
13
|
+
import { HookIncomingSetting } from './hook-incoming-setting';
|
|
14
|
+
import { HookIncomingTriggerWhenCondition } from './hook-incoming-trigger-when-condition';
|
|
14
15
|
import { ResourceType } from './resource-type';
|
|
15
16
|
/**
|
|
16
17
|
*
|
|
@@ -66,10 +67,16 @@ export interface HookIncomingCreate {
|
|
|
66
67
|
* @memberof HookIncomingCreate
|
|
67
68
|
*/
|
|
68
69
|
secret_header_name?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Conditions that must be met to trigger the hook.
|
|
72
|
+
* @type {Array<HookIncomingTriggerWhenCondition>}
|
|
73
|
+
* @memberof HookIncomingCreate
|
|
74
|
+
*/
|
|
75
|
+
trigger_when?: Array<HookIncomingTriggerWhenCondition>;
|
|
69
76
|
/**
|
|
70
77
|
*
|
|
71
|
-
* @type {
|
|
78
|
+
* @type {HookIncomingSetting}
|
|
72
79
|
* @memberof HookIncomingCreate
|
|
73
80
|
*/
|
|
74
|
-
settings?:
|
|
81
|
+
settings?: HookIncomingSetting;
|
|
75
82
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { HookIncomingSetting } from './hook-incoming-setting';
|
|
13
|
+
import { HookIncomingTriggerWhenCondition } from './hook-incoming-trigger-when-condition';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface HookIncomingParams
|
|
18
|
+
*/
|
|
19
|
+
export interface HookIncomingParams {
|
|
20
|
+
/**
|
|
21
|
+
* The URL where the incoming hook must be triggered with a POST request
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof HookIncomingParams
|
|
24
|
+
*/
|
|
25
|
+
url: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Conditions that must be met to trigger the hook.
|
|
28
|
+
* @type {Array<HookIncomingTriggerWhenCondition>}
|
|
29
|
+
* @memberof HookIncomingParams
|
|
30
|
+
*/
|
|
31
|
+
trigger_when: Array<HookIncomingTriggerWhenCondition>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {HookIncomingSetting}
|
|
35
|
+
* @memberof HookIncomingParams
|
|
36
|
+
*/
|
|
37
|
+
settings: HookIncomingSetting;
|
|
38
|
+
}
|
|
File without changes
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { HookVariable } from './hook-variable';
|
|
13
13
|
/**
|
|
14
|
-
* Settings to
|
|
14
|
+
* Settings to an incoming hook
|
|
15
15
|
* @export
|
|
16
|
-
* @interface
|
|
16
|
+
* @interface HookIncomingSetting
|
|
17
17
|
*/
|
|
18
|
-
export interface
|
|
18
|
+
export interface HookIncomingSetting {
|
|
19
19
|
/**
|
|
20
20
|
* List of variables to incoming hook
|
|
21
21
|
* @type {Array<HookVariable>}
|
|
22
|
-
* @memberof
|
|
22
|
+
* @memberof HookIncomingSetting
|
|
23
23
|
*/
|
|
24
24
|
variables?: Array<HookVariable>;
|
|
25
25
|
}
|
|
@@ -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 });
|