@devopness/sdk-js 3.6.5 → 3.6.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/api/generated/apis/hooks-api.d.ts +3 -1
- package/dist/api/generated/apis/hooks-api.js +6 -2
- package/dist/api/generated/models/application-environment-apply-template.d.ts +2 -2
- package/dist/api/generated/models/hook-incoming-settings.d.ts +1 -1
- package/dist/api/generated/models/hook-outgoing-settings.d.ts +2 -2
- package/dist/api/generated/models/hook-pipeline-create.d.ts +12 -0
- package/dist/api/generated/models/hook-request.d.ts +8 -8
- package/dist/api/generated/models/hook-secret-algorithm.d.ts +19 -0
- package/dist/api/generated/models/hook-secret-algorithm.js +24 -0
- package/dist/api/generated/models/hook-trigger-payload.d.ts +19 -0
- package/dist/api/generated/models/hook-trigger-payload.js +14 -0
- package/dist/api/generated/models/hook-trigger-response.d.ts +2 -2
- package/dist/api/generated/models/hook-update.d.ts +12 -0
- package/dist/api/generated/models/hook-variable.d.ts +5 -5
- package/dist/api/generated/models/hook.d.ts +7 -1
- package/dist/api/generated/models/index.d.ts +2 -0
- package/dist/api/generated/models/index.js +2 -0
- package/dist/api/generated/models/project-relation.d.ts +2 -2
- package/dist/api/generated/models/project.d.ts +2 -2
- package/dist/api/generated/models/template.d.ts +2 -2
- package/package.json +5 -7
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { ApiBaseService } from "../../../services/ApiBaseService";
|
|
13
13
|
import { ApiResponse } from "../../../common/ApiResponse";
|
|
14
14
|
import { Hook } from '../../generated/models';
|
|
15
|
+
import { HookTriggerPayload } from '../../generated/models';
|
|
15
16
|
import { HookTriggerResponse } from '../../generated/models';
|
|
16
17
|
import { HookTypeParam } from '../../generated/models';
|
|
17
18
|
import { HookUpdate } from '../../generated/models';
|
|
@@ -37,8 +38,9 @@ export declare class HooksApiService extends ApiBaseService {
|
|
|
37
38
|
*
|
|
38
39
|
* @summary Trigger an incoming hook associated action
|
|
39
40
|
* @param {string} hookId The ID of the hook.
|
|
41
|
+
* @param {HookTriggerPayload} hookTriggerPayload A free-form JSON object.
|
|
40
42
|
*/
|
|
41
|
-
triggerHook(hookId: string): Promise<ApiResponse<HookTriggerResponse>>;
|
|
43
|
+
triggerHook(hookId: string, hookTriggerPayload: HookTriggerPayload): Promise<ApiResponse<HookTriggerResponse>>;
|
|
42
44
|
/**
|
|
43
45
|
*
|
|
44
46
|
* @summary Update an existing hook
|
|
@@ -71,14 +71,18 @@ class HooksApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
71
71
|
*
|
|
72
72
|
* @summary Trigger an incoming hook associated action
|
|
73
73
|
* @param {string} hookId The ID of the hook.
|
|
74
|
+
* @param {HookTriggerPayload} hookTriggerPayload A free-form JSON object.
|
|
74
75
|
*/
|
|
75
|
-
triggerHook(hookId) {
|
|
76
|
+
triggerHook(hookId, hookTriggerPayload) {
|
|
76
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
78
|
if (hookId === null || hookId === undefined) {
|
|
78
79
|
throw new Exceptions_1.ArgumentNullException('hookId', 'triggerHook');
|
|
79
80
|
}
|
|
81
|
+
if (hookTriggerPayload === null || hookTriggerPayload === undefined) {
|
|
82
|
+
throw new Exceptions_1.ArgumentNullException('hookTriggerPayload', 'triggerHook');
|
|
83
|
+
}
|
|
80
84
|
const requestUrl = '/hooks/{hook_id}/trigger';
|
|
81
|
-
const response = yield this.post(requestUrl.replace(`{${"hook_id"}}`, encodeURIComponent(String(hookId))));
|
|
85
|
+
const response = yield this.post(requestUrl.replace(`{${"hook_id"}}`, encodeURIComponent(String(hookId))), hookTriggerPayload);
|
|
82
86
|
return new ApiResponse_1.ApiResponse(response);
|
|
83
87
|
});
|
|
84
88
|
}
|
|
@@ -23,11 +23,11 @@ export interface ApplicationEnvironmentApplyTemplate {
|
|
|
23
23
|
template_id?: string;
|
|
24
24
|
/**
|
|
25
25
|
* Key/value pairs used to fill template placeholders before an application is created. Each template decides which inputs it accepts.
|
|
26
|
-
* @type {{ [key: string]:
|
|
26
|
+
* @type {{ [key: string]: any; }}
|
|
27
27
|
* @memberof ApplicationEnvironmentApplyTemplate
|
|
28
28
|
*/
|
|
29
29
|
template_inputs: {
|
|
30
|
-
[key: string]:
|
|
30
|
+
[key: string]: any;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Raw YAML for a custom template manifest. Must not be greater than 21504 characters.
|
|
@@ -17,7 +17,7 @@ import { HookVariable } from './hook-variable';
|
|
|
17
17
|
*/
|
|
18
18
|
export interface HookIncomingSettings {
|
|
19
19
|
/**
|
|
20
|
-
* List of variables to incoming hook
|
|
20
|
+
* List of variables to incoming hook. During application deploy, Devopness exposes them as application environment variables. If a hook variable has the same name as an application variable, the hook value overrides it. Pipeline steps can read the value with shell syntax such as `$NAME` or `${NAME}`.
|
|
21
21
|
* @type {Array<HookVariable>}
|
|
22
22
|
* @memberof HookIncomingSettings
|
|
23
23
|
*/
|
|
@@ -24,8 +24,8 @@ export interface HookOutgoingSettings {
|
|
|
24
24
|
request_headers?: Array<HookOutgoingRequestHeader>;
|
|
25
25
|
/**
|
|
26
26
|
* The request body that should be send to target URL
|
|
27
|
-
* @type {string |
|
|
27
|
+
* @type {string | any | Array<any>}
|
|
28
28
|
* @memberof HookOutgoingSettings
|
|
29
29
|
*/
|
|
30
|
-
request_body?: string |
|
|
30
|
+
request_body?: string | any | Array<any>;
|
|
31
31
|
}
|
|
@@ -48,6 +48,18 @@ export interface HookPipelineCreate {
|
|
|
48
48
|
* @memberof HookPipelineCreate
|
|
49
49
|
*/
|
|
50
50
|
secret_header_name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The signing secret used to validate incoming hooks. Either omit this field and let Devopness generate one, or provide the signing secret created by your external provider so Devopness can validate its deliveries. Must not be greater than 255 characters.
|
|
53
|
+
* @type {string}
|
|
54
|
+
* @memberof HookPipelineCreate
|
|
55
|
+
*/
|
|
56
|
+
secret?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the signature header value includes the algorithm prefix, for example `sha256=<hex>`. When false, the header must contain only the raw hex HMAC. This field is required when <code>requires_secret</code> is <code>true</code>.
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
* @memberof HookPipelineCreate
|
|
61
|
+
*/
|
|
62
|
+
secret_signature_has_algorithm_prefix?: boolean;
|
|
51
63
|
/**
|
|
52
64
|
*
|
|
53
65
|
* @type {HookTriggerWhen}
|
|
@@ -54,16 +54,16 @@ export interface HookRequest {
|
|
|
54
54
|
url: string;
|
|
55
55
|
/**
|
|
56
56
|
* The headers of the request
|
|
57
|
-
* @type {
|
|
57
|
+
* @type {any}
|
|
58
58
|
* @memberof HookRequest
|
|
59
59
|
*/
|
|
60
|
-
request_headers:
|
|
60
|
+
request_headers: any;
|
|
61
61
|
/**
|
|
62
62
|
* The body of the request
|
|
63
|
-
* @type {
|
|
63
|
+
* @type {any}
|
|
64
64
|
* @memberof HookRequest
|
|
65
65
|
*/
|
|
66
|
-
request_body:
|
|
66
|
+
request_body: any;
|
|
67
67
|
/**
|
|
68
68
|
* The response status code
|
|
69
69
|
* @type {number}
|
|
@@ -72,16 +72,16 @@ export interface HookRequest {
|
|
|
72
72
|
response_status_code: number;
|
|
73
73
|
/**
|
|
74
74
|
* The headers of the response
|
|
75
|
-
* @type {
|
|
75
|
+
* @type {any}
|
|
76
76
|
* @memberof HookRequest
|
|
77
77
|
*/
|
|
78
|
-
response_headers:
|
|
78
|
+
response_headers: any;
|
|
79
79
|
/**
|
|
80
80
|
* The body of the response
|
|
81
|
-
* @type {
|
|
81
|
+
* @type {any}
|
|
82
82
|
* @memberof HookRequest
|
|
83
83
|
*/
|
|
84
|
-
response_body:
|
|
84
|
+
response_body: any;
|
|
85
85
|
/**
|
|
86
86
|
*
|
|
87
87
|
* @type {HookRelation}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* Supported algorithms for validating incoming hook signatures.
|
|
14
|
+
* @export
|
|
15
|
+
* @enum {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare enum HookSecretAlgorithm {
|
|
18
|
+
Sha256 = "sha256"
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.HookSecretAlgorithm = void 0;
|
|
16
|
+
/**
|
|
17
|
+
* Supported algorithms for validating incoming hook signatures.
|
|
18
|
+
* @export
|
|
19
|
+
* @enum {string}
|
|
20
|
+
*/
|
|
21
|
+
var HookSecretAlgorithm;
|
|
22
|
+
(function (HookSecretAlgorithm) {
|
|
23
|
+
HookSecretAlgorithm["Sha256"] = "sha256";
|
|
24
|
+
})(HookSecretAlgorithm || (exports.HookSecretAlgorithm = HookSecretAlgorithm = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
* @type HookTriggerPayload
|
|
14
|
+
* Free-form JSON payload sent to trigger an incoming hook.
|
|
15
|
+
* @export
|
|
16
|
+
*/
|
|
17
|
+
export type HookTriggerPayload = {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
@@ -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 });
|
|
@@ -23,8 +23,8 @@ export interface HookTriggerResponse {
|
|
|
23
23
|
message: string;
|
|
24
24
|
/**
|
|
25
25
|
* Optional error object containing details of the server error
|
|
26
|
-
* @type {
|
|
26
|
+
* @type {any}
|
|
27
27
|
* @memberof HookTriggerResponse
|
|
28
28
|
*/
|
|
29
|
-
errors:
|
|
29
|
+
errors: any | null;
|
|
30
30
|
}
|
|
@@ -54,6 +54,18 @@ export interface HookUpdate {
|
|
|
54
54
|
* @memberof HookUpdate
|
|
55
55
|
*/
|
|
56
56
|
secret_header_name?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The signing secret used by incoming hooks. Provide a value here to replace the existing secret without changing the hook identity. Must not be greater than 255 characters.
|
|
59
|
+
* @type {string}
|
|
60
|
+
* @memberof HookUpdate
|
|
61
|
+
*/
|
|
62
|
+
secret?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the signature header value includes the algorithm prefix, for example `sha256=<hex>`. When false, the header must contain only the raw hex HMAC. This field is required when <code>requires_secret</code> is <code>true</code>.
|
|
65
|
+
* @type {boolean}
|
|
66
|
+
* @memberof HookUpdate
|
|
67
|
+
*/
|
|
68
|
+
secret_signature_has_algorithm_prefix?: boolean;
|
|
57
69
|
/**
|
|
58
70
|
*
|
|
59
71
|
* @type {HookTriggerWhen}
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { HookVariableType } from './hook-variable-type';
|
|
13
13
|
/**
|
|
14
|
-
* Variable that can be defined on
|
|
14
|
+
* Variable that can be defined on an incoming hook and exposed as an application environment variable during deploy.
|
|
15
15
|
* @export
|
|
16
16
|
* @interface HookVariable
|
|
17
17
|
*/
|
|
18
18
|
export interface HookVariable {
|
|
19
19
|
/**
|
|
20
|
-
* The name
|
|
20
|
+
* The application environment variable name that will be available during deploy.
|
|
21
21
|
* @type {string}
|
|
22
22
|
* @memberof HookVariable
|
|
23
23
|
*/
|
|
@@ -41,9 +41,9 @@ export interface HookVariable {
|
|
|
41
41
|
*/
|
|
42
42
|
required?: boolean;
|
|
43
43
|
/**
|
|
44
|
-
* Optional variable assumes the default value if it\'s not given on the request to trigger the hook
|
|
45
|
-
* @type {string | number | boolean | Array<string | number | boolean |
|
|
44
|
+
* Optional variable assumes the default value if it\'s not given on the request to trigger the hook. If an application variable already exists with the same name, the hook value still overrides it.
|
|
45
|
+
* @type {string | number | boolean | Array<string | number | boolean | any>}
|
|
46
46
|
* @memberof HookVariable
|
|
47
47
|
*/
|
|
48
|
-
default_value?: string | number | boolean | Array<string | number | boolean |
|
|
48
|
+
default_value?: string | number | boolean | Array<string | number | boolean | any> | null;
|
|
49
49
|
}
|
|
@@ -125,7 +125,7 @@ export interface Hook {
|
|
|
125
125
|
*/
|
|
126
126
|
trigger_when: HookTriggerWhen;
|
|
127
127
|
/**
|
|
128
|
-
* The secret
|
|
128
|
+
* The signing secret for incoming hooks. Devopness generates one when the caller omits it; a caller-supplied secret is returned as-is. The clear value is returned only once, in the create response, and cannot be retrieved again after that.
|
|
129
129
|
* @type {string}
|
|
130
130
|
* @memberof Hook
|
|
131
131
|
*/
|
|
@@ -142,6 +142,12 @@ export interface Hook {
|
|
|
142
142
|
* @memberof Hook
|
|
143
143
|
*/
|
|
144
144
|
secret_header_name: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the signature header value includes the algorithm prefix, for example `sha256=<hex>`. When false, the header contains only the raw hex HMAC.
|
|
147
|
+
* @type {boolean}
|
|
148
|
+
* @memberof Hook
|
|
149
|
+
*/
|
|
150
|
+
secret_signature_has_algorithm_prefix: boolean | null;
|
|
145
151
|
/**
|
|
146
152
|
*
|
|
147
153
|
* @type {UserRelation}
|
|
@@ -122,6 +122,8 @@ export * from './hook-pipeline-create';
|
|
|
122
122
|
export * from './hook-relation';
|
|
123
123
|
export * from './hook-request';
|
|
124
124
|
export * from './hook-request-relation';
|
|
125
|
+
export * from './hook-secret-algorithm';
|
|
126
|
+
export * from './hook-trigger-payload';
|
|
125
127
|
export * from './hook-trigger-response';
|
|
126
128
|
export * from './hook-trigger-when';
|
|
127
129
|
export * from './hook-type';
|
|
@@ -138,6 +138,8 @@ __exportStar(require("./hook-pipeline-create"), exports);
|
|
|
138
138
|
__exportStar(require("./hook-relation"), exports);
|
|
139
139
|
__exportStar(require("./hook-request"), exports);
|
|
140
140
|
__exportStar(require("./hook-request-relation"), exports);
|
|
141
|
+
__exportStar(require("./hook-secret-algorithm"), exports);
|
|
142
|
+
__exportStar(require("./hook-trigger-payload"), exports);
|
|
141
143
|
__exportStar(require("./hook-trigger-response"), exports);
|
|
142
144
|
__exportStar(require("./hook-trigger-when"), exports);
|
|
143
145
|
__exportStar(require("./hook-type"), exports);
|
|
@@ -50,10 +50,10 @@ export interface ProjectRelation {
|
|
|
50
50
|
resource_summary?: Array<ResourceSummaryItem>;
|
|
51
51
|
/**
|
|
52
52
|
* The list of the operating system users found in all the servers linked to a project
|
|
53
|
-
* @type {Array<
|
|
53
|
+
* @type {Array<any>}
|
|
54
54
|
* @memberof ProjectRelation
|
|
55
55
|
*/
|
|
56
|
-
os_users: Array<
|
|
56
|
+
os_users: Array<any>;
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
59
59
|
* @type {OrganizationRelation}
|
|
@@ -50,10 +50,10 @@ export interface Project {
|
|
|
50
50
|
resource_summary?: Array<ResourceSummaryItem>;
|
|
51
51
|
/**
|
|
52
52
|
* The list of the operating system users found in all the servers linked to a project
|
|
53
|
-
* @type {Array<
|
|
53
|
+
* @type {Array<any>}
|
|
54
54
|
* @memberof Project
|
|
55
55
|
*/
|
|
56
|
-
os_users: Array<
|
|
56
|
+
os_users: Array<any>;
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
59
59
|
* @type {OrganizationRelation}
|
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.6.
|
|
4
|
+
"version": "3.6.7",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"docs-remove-service-index": "rm -f src/services/index.ts",
|
|
24
24
|
"docs-export-service-index": "find src/services/ ! -name 'index.ts' -name '*.ts' -type f | sort -k3 -t'/' | xargs -I'{}' bash -c 'echo \"export * from $(echo -e \"\\x27\")./$(basename $0 .ts)$(echo -e \"\\x27\")\" >> src/services/index.ts' {} \\;",
|
|
25
25
|
"docs-update-service-index": "npm run docs-remove-service-index && npm run docs-export-service-index",
|
|
26
|
-
"docs": "npm run docs-update-service-index && typedoc",
|
|
27
26
|
"lint": "vp check",
|
|
28
27
|
"lint:fix": "vp check --fix",
|
|
29
28
|
"prepublishOnly": "npm run lint && npm test && npm run build",
|
|
@@ -61,16 +60,15 @@
|
|
|
61
60
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
|
-
"@openapitools/openapi-generator-cli": "^2.
|
|
63
|
+
"@openapitools/openapi-generator-cli": "^2.44.0",
|
|
65
64
|
"axios-mock-adapter": "^2.1.0",
|
|
66
65
|
"husky": "9.1.7",
|
|
67
|
-
"vite-plus": "
|
|
68
|
-
"typescript": "^7.0.2"
|
|
69
|
-
"typedoc": "^0.28.20"
|
|
66
|
+
"vite-plus": "1.8.0",
|
|
67
|
+
"typescript": "^7.0.2"
|
|
70
68
|
},
|
|
71
69
|
"dependencies": {
|
|
72
70
|
"@types/parse-link-header": "^2.0.3",
|
|
73
|
-
"axios": "^1.
|
|
71
|
+
"axios": "^1.21.1",
|
|
74
72
|
"parse-link-header": "^2.0.0"
|
|
75
73
|
}
|
|
76
74
|
}
|