@devopness/sdk-js 2.109.0 → 2.110.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/dist/api/generated/apis/variables-api.d.ts +19 -0
- package/dist/api/generated/apis/variables-api.js +53 -0
- package/dist/api/generated/models/index.d.ts +1 -0
- package/dist/api/generated/models/index.js +1 -0
- package/dist/api/generated/models/variable-create.d.ts +56 -0
- package/dist/api/generated/models/variable-create.js +14 -0
- package/dist/api/generated/models/variable-target.d.ts +2 -1
- package/dist/api/generated/models/variable-target.js +1 -0
- package/dist/api/generated/models/variable-targets.d.ts +2 -1
- package/dist/api/generated/models/variable-targets.js +1 -0
- package/package.json +1 -1
|
@@ -12,11 +12,21 @@
|
|
|
12
12
|
import { ApiBaseService } from "../../../services/ApiBaseService";
|
|
13
13
|
import { ApiResponse } from "../../../common/ApiResponse";
|
|
14
14
|
import { Variable } from '../../generated/models';
|
|
15
|
+
import { VariableCreate } from '../../generated/models';
|
|
16
|
+
import { VariableRelation } from '../../generated/models';
|
|
15
17
|
import { VariableUpdate } from '../../generated/models';
|
|
16
18
|
/**
|
|
17
19
|
* VariablesApiService - Auto-generated
|
|
18
20
|
*/
|
|
19
21
|
export declare class VariablesApiService extends ApiBaseService {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @summary Create a new variable linked to a resource
|
|
25
|
+
* @param {number} resourceId The resource ID.
|
|
26
|
+
* @param {string} resourceType The resource type to get variables from.
|
|
27
|
+
* @param {VariableCreate} variableCreate A JSON object containing the resource data
|
|
28
|
+
*/
|
|
29
|
+
addVariable(resourceId: number, resourceType: string, variableCreate: VariableCreate): Promise<ApiResponse<Variable>>;
|
|
20
30
|
/**
|
|
21
31
|
*
|
|
22
32
|
* @summary Delete a variable by ID
|
|
@@ -29,6 +39,15 @@ export declare class VariablesApiService extends ApiBaseService {
|
|
|
29
39
|
* @param {number} variableId The ID of the variable.
|
|
30
40
|
*/
|
|
31
41
|
getVariable(variableId: number): Promise<ApiResponse<Variable>>;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @summary Return a list of variables belonging to a resource
|
|
45
|
+
* @param {number} resourceId The resource ID.
|
|
46
|
+
* @param {string} resourceType The resource type to get variables from.
|
|
47
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
48
|
+
* @param {number} [perPage] Number of items returned per page
|
|
49
|
+
*/
|
|
50
|
+
listVariablesByResourceType(resourceId: number, resourceType: string, page?: number, perPage?: number): Promise<ApiResponse<Array<VariableRelation>>>;
|
|
32
51
|
/**
|
|
33
52
|
*
|
|
34
53
|
* @summary Update an existing variable
|
|
@@ -29,6 +29,30 @@ const Exceptions_1 = require("../../../common/Exceptions");
|
|
|
29
29
|
* VariablesApiService - Auto-generated
|
|
30
30
|
*/
|
|
31
31
|
class VariablesApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Create a new variable linked to a resource
|
|
35
|
+
* @param {number} resourceId The resource ID.
|
|
36
|
+
* @param {string} resourceType The resource type to get variables from.
|
|
37
|
+
* @param {VariableCreate} variableCreate A JSON object containing the resource data
|
|
38
|
+
*/
|
|
39
|
+
addVariable(resourceId, resourceType, variableCreate) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
if (resourceId === null || resourceId === undefined) {
|
|
42
|
+
throw new Exceptions_1.ArgumentNullException('resourceId', 'addVariable');
|
|
43
|
+
}
|
|
44
|
+
if (resourceType === null || resourceType === undefined) {
|
|
45
|
+
throw new Exceptions_1.ArgumentNullException('resourceType', 'addVariable');
|
|
46
|
+
}
|
|
47
|
+
if (variableCreate === null || variableCreate === undefined) {
|
|
48
|
+
throw new Exceptions_1.ArgumentNullException('variableCreate', 'addVariable');
|
|
49
|
+
}
|
|
50
|
+
let queryString = '';
|
|
51
|
+
const requestUrl = '/variables/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
|
|
52
|
+
const response = yield this.post(requestUrl.replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))), variableCreate);
|
|
53
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
32
56
|
/**
|
|
33
57
|
*
|
|
34
58
|
* @summary Delete a variable by ID
|
|
@@ -61,6 +85,35 @@ class VariablesApiService extends ApiBaseService_1.ApiBaseService {
|
|
|
61
85
|
return new ApiResponse_1.ApiResponse(response);
|
|
62
86
|
});
|
|
63
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @summary Return a list of variables belonging to a resource
|
|
91
|
+
* @param {number} resourceId The resource ID.
|
|
92
|
+
* @param {string} resourceType The resource type to get variables from.
|
|
93
|
+
* @param {number} [page] Number of the page to be retrieved
|
|
94
|
+
* @param {number} [perPage] Number of items returned per page
|
|
95
|
+
*/
|
|
96
|
+
listVariablesByResourceType(resourceId, resourceType, page, perPage) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (resourceId === null || resourceId === undefined) {
|
|
99
|
+
throw new Exceptions_1.ArgumentNullException('resourceId', 'listVariablesByResourceType');
|
|
100
|
+
}
|
|
101
|
+
if (resourceType === null || resourceType === undefined) {
|
|
102
|
+
throw new Exceptions_1.ArgumentNullException('resourceType', 'listVariablesByResourceType');
|
|
103
|
+
}
|
|
104
|
+
let queryString = '';
|
|
105
|
+
const queryParams = { page: page, per_page: perPage, };
|
|
106
|
+
for (const key in queryParams) {
|
|
107
|
+
if (queryParams[key] === undefined || queryParams[key] === null) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
|
|
111
|
+
}
|
|
112
|
+
const requestUrl = '/variables/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
|
|
113
|
+
const response = yield this.get(requestUrl.replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))));
|
|
114
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
64
117
|
/**
|
|
65
118
|
*
|
|
66
119
|
* @summary Update an existing variable
|
|
@@ -267,6 +267,7 @@ export * from './user-url';
|
|
|
267
267
|
export * from './user-verify';
|
|
268
268
|
export * from './variable';
|
|
269
269
|
export * from './variable-application-create';
|
|
270
|
+
export * from './variable-create';
|
|
270
271
|
export * from './variable-relation';
|
|
271
272
|
export * from './variable-service-create';
|
|
272
273
|
export * from './variable-target';
|
|
@@ -283,6 +283,7 @@ __exportStar(require("./user-url"), exports);
|
|
|
283
283
|
__exportStar(require("./user-verify"), exports);
|
|
284
284
|
__exportStar(require("./variable"), exports);
|
|
285
285
|
__exportStar(require("./variable-application-create"), exports);
|
|
286
|
+
__exportStar(require("./variable-create"), exports);
|
|
286
287
|
__exportStar(require("./variable-relation"), exports);
|
|
287
288
|
__exportStar(require("./variable-service-create"), exports);
|
|
288
289
|
__exportStar(require("./variable-target"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { VariableTarget } from './variable-target';
|
|
13
|
+
import { VariableType } from './variable-type';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface VariableCreate
|
|
18
|
+
*/
|
|
19
|
+
export interface VariableCreate {
|
|
20
|
+
/**
|
|
21
|
+
* The unique key used to identify the variable on the target. Must not be greater than 100 characters.
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof VariableCreate
|
|
24
|
+
*/
|
|
25
|
+
key: string;
|
|
26
|
+
/**
|
|
27
|
+
* The value to be assigned to this variable when deployed to its target. When variable is of type `file`, this is the file content. Must not be greater than 21504 characters.
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof VariableCreate
|
|
30
|
+
*/
|
|
31
|
+
value: string;
|
|
32
|
+
/**
|
|
33
|
+
* A text describing the variable, provided by the end user.
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof VariableCreate
|
|
36
|
+
*/
|
|
37
|
+
description?: string;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {VariableTarget}
|
|
41
|
+
* @memberof VariableCreate
|
|
42
|
+
*/
|
|
43
|
+
target: VariableTarget;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {VariableType}
|
|
47
|
+
* @memberof VariableCreate
|
|
48
|
+
*/
|
|
49
|
+
type: VariableType;
|
|
50
|
+
/**
|
|
51
|
+
* Indicates if the variable value should be visible or not in the deployment logs.
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
* @memberof VariableCreate
|
|
54
|
+
*/
|
|
55
|
+
hidden: boolean;
|
|
56
|
+
}
|
|
@@ -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 });
|
|
@@ -28,5 +28,6 @@ export declare enum VariableTarget {
|
|
|
28
28
|
PhpFpmPhpIni = "php-fpm_php-ini",
|
|
29
29
|
PhpFpmPoolDWwwConf = "php-fpm_pool-d-www-conf",
|
|
30
30
|
RedisConf = "redis-conf",
|
|
31
|
-
SupervisordConf = "supervisord-conf"
|
|
31
|
+
SupervisordConf = "supervisord-conf",
|
|
32
|
+
SysctlConf = "sysctl-conf"
|
|
32
33
|
}
|
|
@@ -34,4 +34,5 @@ var VariableTarget;
|
|
|
34
34
|
VariableTarget["PhpFpmPoolDWwwConf"] = "php-fpm_pool-d-www-conf";
|
|
35
35
|
VariableTarget["RedisConf"] = "redis-conf";
|
|
36
36
|
VariableTarget["SupervisordConf"] = "supervisord-conf";
|
|
37
|
+
VariableTarget["SysctlConf"] = "sysctl-conf";
|
|
37
38
|
})(VariableTarget = exports.VariableTarget || (exports.VariableTarget = {}));
|
|
@@ -52,5 +52,6 @@ export declare enum VariableTargetsNameEnum {
|
|
|
52
52
|
PhpFpmPhpIni = "php-fpm_php-ini",
|
|
53
53
|
PhpFpmPoolDWwwConf = "php-fpm_pool-d-www-conf",
|
|
54
54
|
RedisConf = "redis-conf",
|
|
55
|
-
SupervisordConf = "supervisord-conf"
|
|
55
|
+
SupervisordConf = "supervisord-conf",
|
|
56
|
+
SysctlConf = "sysctl-conf"
|
|
56
57
|
}
|
|
@@ -33,4 +33,5 @@ var VariableTargetsNameEnum;
|
|
|
33
33
|
VariableTargetsNameEnum["PhpFpmPoolDWwwConf"] = "php-fpm_pool-d-www-conf";
|
|
34
34
|
VariableTargetsNameEnum["RedisConf"] = "redis-conf";
|
|
35
35
|
VariableTargetsNameEnum["SupervisordConf"] = "supervisord-conf";
|
|
36
|
+
VariableTargetsNameEnum["SysctlConf"] = "sysctl-conf";
|
|
36
37
|
})(VariableTargetsNameEnum = exports.VariableTargetsNameEnum || (exports.VariableTargetsNameEnum = {}));
|