@devopness/sdk-js 3.5.3 → 3.5.5

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.
Files changed (43) hide show
  1. package/dist/DevopnessApiClient.d.ts +31 -31
  2. package/dist/api/generated/apis/applications-api.d.ts +11 -2
  3. package/dist/api/generated/apis/applications-api.js +22 -2
  4. package/dist/api/generated/models/application-apply-template-response.d.ts +201 -0
  5. package/dist/api/generated/models/application-apply-template-response.js +14 -0
  6. package/dist/api/generated/models/application-environment-apply-template.d.ts +32 -0
  7. package/dist/api/generated/models/application-environment-apply-template.js +14 -0
  8. package/dist/api/generated/models/application-environment-create.d.ts +1 -1
  9. package/dist/api/generated/models/application-options.d.ts +7 -0
  10. package/dist/api/generated/models/application-update.d.ts +1 -1
  11. package/dist/api/generated/models/application.d.ts +14 -0
  12. package/dist/api/generated/models/index.d.ts +3 -0
  13. package/dist/api/generated/models/index.js +3 -0
  14. package/dist/api/generated/models/template.d.ts +54 -0
  15. package/dist/api/generated/models/template.js +14 -0
  16. package/dist/common/ApiResponse.d.ts +1 -1
  17. package/dist/common/ApiResponse.js +2 -2
  18. package/dist/common/Exceptions.d.ts +1 -1
  19. package/dist/common/Exceptions.js +3 -2
  20. package/dist/common/MergeSiblingClasses.js +3 -3
  21. package/dist/index.d.ts +5 -5
  22. package/dist/services/ApiBaseService.js +9 -8
  23. package/dist/services/ApplicationService.d.ts +4 -4
  24. package/dist/services/EnvironmentService.d.ts +2 -2
  25. package/dist/services/HookRequestService.d.ts +1 -1
  26. package/dist/services/HookService.d.ts +2 -2
  27. package/dist/services/NetworkRuleService.d.ts +1 -1
  28. package/dist/services/ProjectService.d.ts +4 -4
  29. package/dist/services/ResourceEventService.d.ts +1 -1
  30. package/dist/services/ResourceLinkService.d.ts +1 -1
  31. package/dist/services/RoleService.d.ts +1 -1
  32. package/dist/services/ServerService.d.ts +1 -1
  33. package/dist/services/ServerService.js +4 -4
  34. package/dist/services/ServiceService.d.ts +2 -2
  35. package/dist/services/SshKeyService.d.ts +1 -1
  36. package/dist/services/SslCertificateService.d.ts +1 -1
  37. package/dist/services/TeamInvitationService.d.ts +1 -1
  38. package/dist/services/TeamService.d.ts +3 -3
  39. package/dist/services/UserService.d.ts +5 -5
  40. package/dist/services/VariableService.d.ts +1 -1
  41. package/dist/services/VirtualHostService.d.ts +1 -1
  42. package/dist/services/index.d.ts +30 -30
  43. package/package.json +9 -19
@@ -1,34 +1,34 @@
1
- import { ActionService } from './services/ActionService';
2
- import { ConfigurationOptions } from './services/ApiBaseService';
3
- import { ApiTokenService } from './services/ApiTokenService';
4
- import { ApplicationService } from './services/ApplicationService';
5
- import { CredentialService } from './services/CredentialService';
6
- import { CronJobService } from './services/CronJobService';
7
- import { DaemonService } from './services/DaemonService';
8
- import { EnvironmentService } from './services/EnvironmentService';
9
- import { HookRequestService } from './services/HookRequestService';
10
- import { HookService } from './services/HookService';
11
- import { LogService } from './services/LogService';
12
- import { NetworkRuleService } from './services/NetworkRuleService';
13
- import { NetworkService } from './services/NetworkService';
14
- import { OrganizationService } from './services/OrganizationService';
15
- import { PipelineService } from './services/PipelineService';
16
- import { ProjectService } from './services/ProjectService';
17
- import { ResourceEventService } from './services/ResourceEventService';
18
- import { ResourceLinkService } from './services/ResourceLinkService';
19
- import { RoleService } from './services/RoleService';
20
- import { ServerService } from './services/ServerService';
21
- import { ServiceService } from './services/ServiceService';
22
- import { SocialAccountService } from './services/SocialAccountService';
23
- import { SshKeyService } from './services/SshKeyService';
24
- import { SslCertificateService } from './services/SslCertificateService';
25
- import { StaticService } from './services/StaticService';
26
- import { SubnetService } from './services/SubnetService';
27
- import { TeamInvitationService } from './services/TeamInvitationService';
28
- import { TeamService } from './services/TeamService';
29
- import { UserService } from './services/UserService';
30
- import { VariableService } from './services/VariableService';
31
- import { VirtualHostService } from './services/VirtualHostService';
1
+ import { ActionService } from "./services/ActionService";
2
+ import { ConfigurationOptions } from "./services/ApiBaseService";
3
+ import { ApiTokenService } from "./services/ApiTokenService";
4
+ import { ApplicationService } from "./services/ApplicationService";
5
+ import { CredentialService } from "./services/CredentialService";
6
+ import { CronJobService } from "./services/CronJobService";
7
+ import { DaemonService } from "./services/DaemonService";
8
+ import { EnvironmentService } from "./services/EnvironmentService";
9
+ import { HookRequestService } from "./services/HookRequestService";
10
+ import { HookService } from "./services/HookService";
11
+ import { LogService } from "./services/LogService";
12
+ import { NetworkRuleService } from "./services/NetworkRuleService";
13
+ import { NetworkService } from "./services/NetworkService";
14
+ import { OrganizationService } from "./services/OrganizationService";
15
+ import { PipelineService } from "./services/PipelineService";
16
+ import { ProjectService } from "./services/ProjectService";
17
+ import { ResourceEventService } from "./services/ResourceEventService";
18
+ import { ResourceLinkService } from "./services/ResourceLinkService";
19
+ import { RoleService } from "./services/RoleService";
20
+ import { ServerService } from "./services/ServerService";
21
+ import { ServiceService } from "./services/ServiceService";
22
+ import { SocialAccountService } from "./services/SocialAccountService";
23
+ import { SshKeyService } from "./services/SshKeyService";
24
+ import { SslCertificateService } from "./services/SslCertificateService";
25
+ import { StaticService } from "./services/StaticService";
26
+ import { SubnetService } from "./services/SubnetService";
27
+ import { TeamInvitationService } from "./services/TeamInvitationService";
28
+ import { TeamService } from "./services/TeamService";
29
+ import { UserService } from "./services/UserService";
30
+ import { VariableService } from "./services/VariableService";
31
+ import { VirtualHostService } from "./services/VirtualHostService";
32
32
  export declare class DevopnessApiClient {
33
33
  actions: ActionService;
34
34
  apiTokens: ApiTokenService;
@@ -12,6 +12,8 @@
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Application } from '../../generated/models';
15
+ import { ApplicationApplyTemplateResponse } from '../../generated/models';
16
+ import { ApplicationEnvironmentApplyTemplate } from '../../generated/models';
15
17
  import { ApplicationEnvironmentCreate } from '../../generated/models';
16
18
  import { ApplicationRelation } from '../../generated/models';
17
19
  import { ApplicationUpdate } from '../../generated/models';
@@ -29,11 +31,18 @@ export declare class ApplicationsApiService extends ApiBaseService {
29
31
  addApplicationDeployment(applicationId: number, deploymentApplicationCreate: DeploymentApplicationCreate): Promise<ApiResponse<void>>;
30
32
  /**
31
33
  *
32
- * @summary Create a new application
34
+ * @summary Create an application
33
35
  * @param {number} environmentId The ID of the environment.
34
36
  * @param {ApplicationEnvironmentCreate} applicationEnvironmentCreate A JSON object containing the resource data
35
37
  */
36
38
  addEnvironmentApplication(environmentId: number, applicationEnvironmentCreate: ApplicationEnvironmentCreate): Promise<ApiResponse<Application>>;
39
+ /**
40
+ *
41
+ * @summary Create applications from a template
42
+ * @param {number} environmentId The ID of the environment.
43
+ * @param {ApplicationEnvironmentApplyTemplate} applicationEnvironmentApplyTemplate A JSON object containing the resource data
44
+ */
45
+ applyTemplateEnvironmentApplication(environmentId: number, applicationEnvironmentApplyTemplate: ApplicationEnvironmentApplyTemplate): Promise<ApiResponse<ApplicationApplyTemplateResponse>>;
37
46
  /**
38
47
  *
39
48
  * @summary Delete a given application
@@ -48,7 +57,7 @@ export declare class ApplicationsApiService extends ApiBaseService {
48
57
  getApplication(applicationId: number): Promise<ApiResponse<Application>>;
49
58
  /**
50
59
  *
51
- * @summary Return a list of all Applications belonging to an environment
60
+ * @summary List applications in an environment
52
61
  * @param {number} environmentId The ID of the environment.
53
62
  * @param {number} [page] Number of the page to be retrieved
54
63
  * @param {number} [perPage] Number of items returned per page
@@ -51,7 +51,7 @@ class ApplicationsApiService extends ApiBaseService_1.ApiBaseService {
51
51
  }
52
52
  /**
53
53
  *
54
- * @summary Create a new application
54
+ * @summary Create an application
55
55
  * @param {number} environmentId The ID of the environment.
56
56
  * @param {ApplicationEnvironmentCreate} applicationEnvironmentCreate A JSON object containing the resource data
57
57
  */
@@ -69,6 +69,26 @@ class ApplicationsApiService extends ApiBaseService_1.ApiBaseService {
69
69
  return new ApiResponse_1.ApiResponse(response);
70
70
  });
71
71
  }
72
+ /**
73
+ *
74
+ * @summary Create applications from a template
75
+ * @param {number} environmentId The ID of the environment.
76
+ * @param {ApplicationEnvironmentApplyTemplate} applicationEnvironmentApplyTemplate A JSON object containing the resource data
77
+ */
78
+ applyTemplateEnvironmentApplication(environmentId, applicationEnvironmentApplyTemplate) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (environmentId === null || environmentId === undefined) {
81
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'applyTemplateEnvironmentApplication');
82
+ }
83
+ if (applicationEnvironmentApplyTemplate === null || applicationEnvironmentApplyTemplate === undefined) {
84
+ throw new Exceptions_1.ArgumentNullException('applicationEnvironmentApplyTemplate', 'applyTemplateEnvironmentApplication');
85
+ }
86
+ let queryString = '';
87
+ const requestUrl = '/environments/{environment_id}/applications/apply-template' + (queryString ? `?${queryString}` : '');
88
+ const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))), applicationEnvironmentApplyTemplate);
89
+ return new ApiResponse_1.ApiResponse(response);
90
+ });
91
+ }
72
92
  /**
73
93
  *
74
94
  * @summary Delete a given application
@@ -103,7 +123,7 @@ class ApplicationsApiService extends ApiBaseService_1.ApiBaseService {
103
123
  }
104
124
  /**
105
125
  *
106
- * @summary Return a list of all Applications belonging to an environment
126
+ * @summary List applications in an environment
107
127
  * @param {number} environmentId The ID of the environment.
108
128
  * @param {number} [page] Number of the page to be retrieved
109
129
  * @param {number} [perPage] Number of items returned per page
@@ -0,0 +1,201 @@
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 { ApplicationLastDeployments } from './application-last-deployments';
13
+ import { CredentialRelation } from './credential-relation';
14
+ import { CronJobRelation } from './cron-job-relation';
15
+ import { DaemonRelation } from './daemon-relation';
16
+ import { EnvironmentRelation } from './environment-relation';
17
+ import { ServerRelation } from './server-relation';
18
+ import { ServiceRelation } from './service-relation';
19
+ import { UserRelation } from './user-relation';
20
+ import { VirtualHostRelation } from './virtual-host-relation';
21
+ /**
22
+ *
23
+ * @export
24
+ * @interface ApplicationApplyTemplateResponse
25
+ */
26
+ export interface ApplicationApplyTemplateResponse {
27
+ /**
28
+ * Unique ID of the application
29
+ * @type {number}
30
+ * @memberof ApplicationApplyTemplateResponse
31
+ */
32
+ id: number;
33
+ /**
34
+ * Numeric ID of the project to which the application belongs to
35
+ * @type {number}
36
+ * @memberof ApplicationApplyTemplateResponse
37
+ */
38
+ project_id: number;
39
+ /**
40
+ * Numeric ID of the environment to which the application belongs to
41
+ * @type {number}
42
+ * @memberof ApplicationApplyTemplateResponse
43
+ */
44
+ environment_id: number;
45
+ /**
46
+ * The id of the user who created the application and to whom the application belongs
47
+ * @type {number}
48
+ * @memberof ApplicationApplyTemplateResponse
49
+ */
50
+ created_by: number;
51
+ /**
52
+ * The application\'s unique name
53
+ * @type {string}
54
+ * @memberof ApplicationApplyTemplateResponse
55
+ */
56
+ name: string;
57
+ /**
58
+ * The full name of a repository (`repository_owner/repository_name`) containing the application source code.
59
+ * @type {string}
60
+ * @memberof ApplicationApplyTemplateResponse
61
+ */
62
+ repository: string;
63
+ /**
64
+ * The name part of a repository full name (`repository_owner/repository_name`)
65
+ * @type {string}
66
+ * @memberof ApplicationApplyTemplateResponse
67
+ */
68
+ repository_name: string;
69
+ /**
70
+ * The owner part of a repository full name (`repository_owner/repository_name`)
71
+ * @type {string}
72
+ * @memberof ApplicationApplyTemplateResponse
73
+ */
74
+ repository_owner: string;
75
+ /**
76
+ * The version control branch that, by default, will be used when a deployment is triggered and no other branch name is informed.
77
+ * @type {string}
78
+ * @memberof ApplicationApplyTemplateResponse
79
+ */
80
+ default_branch: string;
81
+ /**
82
+ * The programming language runtime environment to be used to serve the application. E.g.: if a front-end web app is developed using Node.js, but should be served statically (a SPA application, for instance) then this field value should be `html`.
83
+ * @type {string}
84
+ * @memberof ApplicationApplyTemplateResponse
85
+ */
86
+ programming_language: string;
87
+ /**
88
+ * The human readable version of the programming language of the application.
89
+ * @type {string}
90
+ * @memberof ApplicationApplyTemplateResponse
91
+ */
92
+ programming_language_human_readable: string;
93
+ /**
94
+ * The language runtime engine version to be used to execute this application on the deployed servers
95
+ * @type {string}
96
+ * @memberof ApplicationApplyTemplateResponse
97
+ */
98
+ engine_version: string;
99
+ /**
100
+ * The base framework on top of which the application has been implemented - it might have impact on the steps to be performed during application deployment
101
+ * @type {string}
102
+ * @memberof ApplicationApplyTemplateResponse
103
+ */
104
+ framework: string;
105
+ /**
106
+ * The human readable version of the framework of the application.
107
+ * @type {string}
108
+ * @memberof ApplicationApplyTemplateResponse
109
+ */
110
+ framework_human_readable: string;
111
+ /**
112
+ * The relative directory where package manager\'s manifest files (`package.json`, `composer.json`, `yarn.lock`, etc) are located. It needs to be set for applications where the actual source code is not located in the top level directory of the repository.
113
+ * @type {string}
114
+ * @memberof ApplicationApplyTemplateResponse
115
+ */
116
+ root_directory: string;
117
+ /**
118
+ * The number of deployment history, logs and artifacts to keep stored in both devopness servers and user\'s servers. OR The number of deployment artifacts to be retained in the user\'s servers, making it easier and faster to rollback to previous versions
119
+ * @type {number}
120
+ * @memberof ApplicationApplyTemplateResponse
121
+ */
122
+ deployments_keep: number;
123
+ /**
124
+ * Indicates command that Devopness must execute to install application dependencies
125
+ * @type {string}
126
+ * @memberof ApplicationApplyTemplateResponse
127
+ */
128
+ install_dependencies_command: string | null;
129
+ /**
130
+ * The optional command that should be executed once during deployment to build the source code and get the application in a ready state
131
+ * @type {string}
132
+ * @memberof ApplicationApplyTemplateResponse
133
+ */
134
+ build_command: string | null;
135
+ /**
136
+ *
137
+ * @type {UserRelation}
138
+ * @memberof ApplicationApplyTemplateResponse
139
+ */
140
+ created_by_user: UserRelation | null;
141
+ /**
142
+ *
143
+ * @type {ApplicationLastDeployments}
144
+ * @memberof ApplicationApplyTemplateResponse
145
+ */
146
+ last_deployments: ApplicationLastDeployments;
147
+ /**
148
+ *
149
+ * @type {EnvironmentRelation}
150
+ * @memberof ApplicationApplyTemplateResponse
151
+ */
152
+ environment: EnvironmentRelation | null;
153
+ /**
154
+ *
155
+ * @type {Array<ServerRelation>}
156
+ * @memberof ApplicationApplyTemplateResponse
157
+ */
158
+ servers: Array<ServerRelation>;
159
+ /**
160
+ *
161
+ * @type {CredentialRelation}
162
+ * @memberof ApplicationApplyTemplateResponse
163
+ */
164
+ credential: CredentialRelation | null;
165
+ /**
166
+ *
167
+ * @type {Array<ServiceRelation>}
168
+ * @memberof ApplicationApplyTemplateResponse
169
+ */
170
+ services: Array<ServiceRelation>;
171
+ /**
172
+ *
173
+ * @type {Array<CronJobRelation>}
174
+ * @memberof ApplicationApplyTemplateResponse
175
+ */
176
+ cronjobs: Array<CronJobRelation>;
177
+ /**
178
+ *
179
+ * @type {Array<VirtualHostRelation>}
180
+ * @memberof ApplicationApplyTemplateResponse
181
+ */
182
+ virtual_hosts: Array<VirtualHostRelation>;
183
+ /**
184
+ *
185
+ * @type {Array<DaemonRelation>}
186
+ * @memberof ApplicationApplyTemplateResponse
187
+ */
188
+ daemons: Array<DaemonRelation>;
189
+ /**
190
+ * The date and time when the record was created
191
+ * @type {string}
192
+ * @memberof ApplicationApplyTemplateResponse
193
+ */
194
+ created_at: string;
195
+ /**
196
+ * The date and time when the record was last updated
197
+ * @type {string}
198
+ * @memberof ApplicationApplyTemplateResponse
199
+ */
200
+ updated_at: string;
201
+ }
@@ -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,32 @@
1
+ /**
2
+ * devopness API
3
+ * Devopness API - Painless essential DevOps to everyone
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ApplicationEnvironmentApplyTemplate
16
+ */
17
+ export interface ApplicationEnvironmentApplyTemplate {
18
+ /**
19
+ * Template to use when creating the application group.
20
+ * @type {string}
21
+ * @memberof ApplicationEnvironmentApplyTemplate
22
+ */
23
+ template: string;
24
+ /**
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]: object; }}
27
+ * @memberof ApplicationEnvironmentApplyTemplate
28
+ */
29
+ template_inputs: {
30
+ [key: string]: object;
31
+ };
32
+ }
@@ -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 });
@@ -65,7 +65,7 @@ export interface ApplicationEnvironmentCreate {
65
65
  */
66
66
  credential_id: number;
67
67
  /**
68
- * The relative directory where package manager\'s manifest files (`package.json`, `composer.json`, `yarn.lock`, etc) are located. It needs to be set for applications where the actual source code is not located in the top level directory of the repository. Must start with one of <code>/</code>.
68
+ * The relative directory where package manager\'s manifest files (`package.json`, `composer.json`, `yarn.lock`, etc) are located. It needs to be set for applications where the actual source code is not located in the top level directory of the repository. Must start with one of <code>/</code> Must not be greater than 255 characters.
69
69
  * @type {string}
70
70
  * @memberof ApplicationEnvironmentCreate
71
71
  */
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { LanguageRuntime } from './language-runtime';
13
13
  import { ScriptRunner } from './script-runner';
14
+ import { Template } from './template';
14
15
  import { VariableTargets } from './variable-targets';
15
16
  /**
16
17
  *
@@ -36,4 +37,10 @@ export interface ApplicationOptions {
36
37
  * @memberof ApplicationOptions
37
38
  */
38
39
  script_runners: Array<ScriptRunner>;
40
+ /**
41
+ * The list of templates users can choose from.
42
+ * @type {Array<Template>}
43
+ * @memberof ApplicationOptions
44
+ */
45
+ templates: Array<Template>;
39
46
  }
@@ -64,7 +64,7 @@ export interface ApplicationUpdate {
64
64
  */
65
65
  credential_id?: number;
66
66
  /**
67
- * The relative directory where package manager\'s manifest files (`package.json`, `composer.json`, `yarn.lock`, etc) are located. It needs to be set for applications where the actual source code is not located in the top level directory of the repository. Must start with one of <code>/</code>.
67
+ * The relative directory where package manager\'s manifest files (`package.json`, `composer.json`, `yarn.lock`, etc) are located. It needs to be set for applications where the actual source code is not located in the top level directory of the repository. Must start with one of <code>/</code> Must not be greater than 255 characters.
68
68
  * @type {string}
69
69
  * @memberof ApplicationUpdate
70
70
  */
@@ -11,9 +11,11 @@
11
11
  */
12
12
  import { ApplicationLastDeployments } from './application-last-deployments';
13
13
  import { CredentialRelation } from './credential-relation';
14
+ import { CronJobRelation } from './cron-job-relation';
14
15
  import { DaemonRelation } from './daemon-relation';
15
16
  import { EnvironmentRelation } from './environment-relation';
16
17
  import { ServerRelation } from './server-relation';
18
+ import { ServiceRelation } from './service-relation';
17
19
  import { UserRelation } from './user-relation';
18
20
  import { VirtualHostRelation } from './virtual-host-relation';
19
21
  /**
@@ -160,6 +162,18 @@ export interface Application {
160
162
  * @memberof Application
161
163
  */
162
164
  credential: CredentialRelation | null;
165
+ /**
166
+ *
167
+ * @type {Array<ServiceRelation>}
168
+ * @memberof Application
169
+ */
170
+ services: Array<ServiceRelation>;
171
+ /**
172
+ *
173
+ * @type {Array<CronJobRelation>}
174
+ * @memberof Application
175
+ */
176
+ cronjobs: Array<CronJobRelation>;
163
177
  /**
164
178
  *
165
179
  * @type {Array<VirtualHostRelation>}
@@ -35,6 +35,8 @@ export * from './api-token-status';
35
35
  export * from './api-token-type';
36
36
  export * from './api-token-type-prefix';
37
37
  export * from './application';
38
+ export * from './application-apply-template-response';
39
+ export * from './application-environment-apply-template';
38
40
  export * from './application-environment-create';
39
41
  export * from './application-last-deployments';
40
42
  export * from './application-options';
@@ -303,6 +305,7 @@ export * from './team-organization-link';
303
305
  export * from './team-project-link';
304
306
  export * from './team-relation';
305
307
  export * from './team-update';
308
+ export * from './template';
306
309
  export * from './trigger-event';
307
310
  export * from './trigger-when-condition';
308
311
  export * from './trigger-when-condition-type';
@@ -51,6 +51,8 @@ __exportStar(require("./api-token-status"), exports);
51
51
  __exportStar(require("./api-token-type"), exports);
52
52
  __exportStar(require("./api-token-type-prefix"), exports);
53
53
  __exportStar(require("./application"), exports);
54
+ __exportStar(require("./application-apply-template-response"), exports);
55
+ __exportStar(require("./application-environment-apply-template"), exports);
54
56
  __exportStar(require("./application-environment-create"), exports);
55
57
  __exportStar(require("./application-last-deployments"), exports);
56
58
  __exportStar(require("./application-options"), exports);
@@ -319,6 +321,7 @@ __exportStar(require("./team-organization-link"), exports);
319
321
  __exportStar(require("./team-project-link"), exports);
320
322
  __exportStar(require("./team-relation"), exports);
321
323
  __exportStar(require("./team-update"), exports);
324
+ __exportStar(require("./template"), exports);
322
325
  __exportStar(require("./trigger-event"), exports);
323
326
  __exportStar(require("./trigger-when-condition"), exports);
324
327
  __exportStar(require("./trigger-when-condition-type"), exports);
@@ -0,0 +1,54 @@
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
+ * One template shown to users when creating an application.
14
+ * @export
15
+ * @interface Template
16
+ */
17
+ export interface Template {
18
+ /**
19
+ * The unique template ID.
20
+ * @type {string}
21
+ * @memberof Template
22
+ */
23
+ id: string;
24
+ /**
25
+ * The internal template name used inside Devopness.
26
+ * @type {string}
27
+ * @memberof Template
28
+ */
29
+ name: string;
30
+ /**
31
+ * The display name users see in the UI.
32
+ * @type {string}
33
+ * @memberof Template
34
+ */
35
+ title: string;
36
+ /**
37
+ * A short summary explaining what the template does.
38
+ * @type {string}
39
+ * @memberof Template
40
+ */
41
+ description?: string | null;
42
+ /**
43
+ * The template version string.
44
+ * @type {string}
45
+ * @memberof Template
46
+ */
47
+ version: string;
48
+ /**
49
+ * The raw template file content used to build the application request.
50
+ * @type {object}
51
+ * @memberof Template
52
+ */
53
+ manifest?: object | null;
54
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /**
4
+ * devopness API
5
+ * Devopness API - Painless essential DevOps to everyone
6
+ *
7
+ * The version of the OpenAPI document: latest
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { AxiosResponse } from 'axios';
1
+ import { AxiosResponse } from "axios";
2
2
  export declare class ApiResponse<T> {
3
3
  actionId?: number;
4
4
  data: T;
@@ -14,9 +14,9 @@ class ApiResponse {
14
14
  if (axiosResp.headers) {
15
15
  const linkHeader = (0, parse_link_header_1.default)(axiosResp.headers.link);
16
16
  this.pageCount = Number((_a = linkHeader === null || linkHeader === void 0 ? void 0 : linkHeader.last) === null || _a === void 0 ? void 0 : _a.page) || 1;
17
- if (axiosResp.headers['x-devopness-action-id']) {
17
+ if (axiosResp.headers["x-devopness-action-id"]) {
18
18
  // axios headers are intentionally lower cased, as per https://github.com/axios/axios/issues/413
19
- this.actionId = Number(axiosResp.headers['x-devopness-action-id']);
19
+ this.actionId = Number(axiosResp.headers["x-devopness-action-id"]);
20
20
  }
21
21
  }
22
22
  }
@@ -1,4 +1,4 @@
1
- import { AxiosError, AxiosResponse } from 'axios';
1
+ import { AxiosError, AxiosResponse } from "axios";
2
2
  export declare class SdkError extends Error {
3
3
  }
4
4
  export declare class ArgumentNullException extends SdkError {
@@ -6,7 +6,8 @@ class SdkError extends Error {
6
6
  exports.SdkError = SdkError;
7
7
  class ArgumentNullException extends SdkError {
8
8
  constructor(param, method, msg) {
9
- super(msg || `Devopness SDK Error - Value cannot be null. Missing required parameter: "${param}" when calling "${method}"`);
9
+ super(msg ||
10
+ `Devopness SDK Error - Value cannot be null. Missing required parameter: "${param}" when calling "${method}"`);
10
11
  this.param = param;
11
12
  }
12
13
  }
@@ -23,7 +24,7 @@ class ApiError extends SdkError {
23
24
  if (!error.response) {
24
25
  throw error;
25
26
  }
26
- super('Devopness API response error');
27
+ super("Devopness API response error");
27
28
  this.setMessage(error.message);
28
29
  this.status = error.response.status;
29
30
  if (error.response.data) {
@@ -10,14 +10,14 @@ Modified from the `applyMixins` method described in https://www.typescriptlang.o
10
10
  function mergeSiblingClasses(target, siblings) {
11
11
  // check if siblings and target share same superclass
12
12
  const targetSuper = Object.getPrototypeOf(target);
13
- siblings.forEach(sibling => {
13
+ siblings.forEach((sibling) => {
14
14
  if (targetSuper !== Object.getPrototypeOf(sibling)) {
15
15
  throw `can't merge siblings: '${target.name}' and '${sibling.name}' must have the same superclass`;
16
16
  }
17
17
  });
18
18
  // patch target
19
- siblings.forEach(sibling => {
20
- Object.getOwnPropertyNames(sibling.prototype).forEach(name => {
19
+ siblings.forEach((sibling) => {
20
+ Object.getOwnPropertyNames(sibling.prototype).forEach((name) => {
21
21
  const descriptor = Object.getOwnPropertyDescriptor(sibling.prototype, name);
22
22
  if (descriptor) {
23
23
  Object.defineProperty(target.prototype, name, descriptor);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './DevopnessApiClient';
2
- export * from './common/ApiResponse';
3
- export * as SdkExceptions from './common/Exceptions';
4
- export * as SdkModels from './api/generated/models';
5
- export * as SdkServices from './services';
1
+ export * from "./DevopnessApiClient";
2
+ export * from "./common/ApiResponse";
3
+ export * as SdkExceptions from "./common/Exceptions";
4
+ export * as SdkModels from "./api/generated/models";
5
+ export * as SdkServices from "./services";
@@ -27,15 +27,15 @@ class ApiBaseService {
27
27
  constructor() {
28
28
  this.defaultAxiosSettings = {
29
29
  timeout: 30000,
30
- responseType: 'json',
30
+ responseType: "json",
31
31
  headers: {
32
32
  Accept: "application/json",
33
- 'Content-Type': "application/json"
33
+ "Content-Type": "application/json",
34
34
  },
35
- withCredentials: false
35
+ withCredentials: false,
36
36
  };
37
37
  if (ApiBaseService.configuration == undefined) {
38
- throw new Exceptions_1.ArgumentNullException('configuration');
38
+ throw new Exceptions_1.ArgumentNullException("configuration");
39
39
  }
40
40
  const settings = this.defaultAxiosSettings;
41
41
  settings.baseURL = ApiBaseService.configuration.baseURL;
@@ -56,11 +56,12 @@ class ApiBaseService {
56
56
  // i.e: node.js cli, node.js server side, web workers, ...
57
57
  // if a window object is defined then we're very likely on a browser
58
58
  // so we don't set a custom User-Agent header
59
- const runningOnBrowserForeground = typeof window !== 'undefined';
59
+ const runningOnBrowserForeground = typeof window !== "undefined";
60
60
  if (!runningOnBrowserForeground) {
61
61
  // Setting the `User-Agent` with SDK version so we can track SDK adoption
62
62
  // through requests sent through it hitting our API servers
63
- this.api.defaults.headers.common['User-Agent'] = `devopness-sdk-js/${ApiBaseService.SDK_VERSION}`;
63
+ this.api.defaults.headers.common["User-Agent"] =
64
+ `devopness-sdk-js/${ApiBaseService.SDK_VERSION}`;
64
65
  }
65
66
  }
66
67
  setupAxiosRequestInterceptors() {
@@ -131,7 +132,7 @@ class ApiBaseService {
131
132
  catch (_a) {
132
133
  return false;
133
134
  }
134
- return (response === null || response === void 0 ? void 0 : response.status) === 401 && decodedToken.exp < (new Date().getTime() / 1000);
135
+ return (response === null || response === void 0 ? void 0 : response.status) === 401 && decodedToken.exp < new Date().getTime() / 1000;
135
136
  }
136
137
  /**
137
138
  * Decode the JWT payload so we can inspect the `exp` claim in both browser and Node runtimes.
@@ -180,4 +181,4 @@ class ApiBaseService {
180
181
  }
181
182
  }
182
183
  exports.ApiBaseService = ApiBaseService;
183
- ApiBaseService.SDK_VERSION = '0.0.0-development';
184
+ ApiBaseService.SDK_VERSION = "0.0.0-development";
@@ -1,7 +1,7 @@
1
- import { ApiBaseService } from './ApiBaseService';
2
- import { ApplicationsApiService } from '../api/generated/apis/applications-api';
3
- import { ApplicationsVariablesApiService } from '../api/generated/apis/applications-variables-api';
4
- import { ApplicationsHooksApiService } from '../api/generated/apis/applications-hooks-api';
1
+ import { ApiBaseService } from "./ApiBaseService";
2
+ import { ApplicationsApiService } from "../api/generated/apis/applications-api";
3
+ import { ApplicationsVariablesApiService } from "../api/generated/apis/applications-variables-api";
4
+ import { ApplicationsHooksApiService } from "../api/generated/apis/applications-hooks-api";
5
5
  export declare class ApplicationService extends ApiBaseService {
6
6
  }
7
7
  export interface ApplicationService extends ApplicationsApiService, ApplicationsVariablesApiService, ApplicationsHooksApiService {
@@ -1,5 +1,5 @@
1
- import { EnvironmentsActionsApiService } from '../api/generated/apis/environments-actions-api';
2
- import { EnvironmentsApiService } from '../api/generated/apis/environments-api';
1
+ import { EnvironmentsActionsApiService } from "../api/generated/apis/environments-actions-api";
2
+ import { EnvironmentsApiService } from "../api/generated/apis/environments-api";
3
3
  export declare class EnvironmentService extends EnvironmentsApiService {
4
4
  actions: EnvironmentsActionsApiService;
5
5
  }
@@ -1,3 +1,3 @@
1
- import { HookRequestsApiService } from '../api/generated/apis/hook-requests-api';
1
+ import { HookRequestsApiService } from "../api/generated/apis/hook-requests-api";
2
2
  export declare class HookRequestService extends HookRequestsApiService {
3
3
  }
@@ -1,5 +1,5 @@
1
- import { HooksApiService } from '../api/generated/apis/hooks-api';
2
- import { HooksRequestsApiService } from '../api/generated/apis/hooks-requests-api';
1
+ import { HooksApiService } from "../api/generated/apis/hooks-api";
2
+ import { HooksRequestsApiService } from "../api/generated/apis/hooks-requests-api";
3
3
  export declare class HookService extends HooksApiService {
4
4
  requests: HooksRequestsApiService;
5
5
  }
@@ -1,3 +1,3 @@
1
- import { NetworkRulesApiService } from '../api/generated/apis/network-rules-api';
1
+ import { NetworkRulesApiService } from "../api/generated/apis/network-rules-api";
2
2
  export declare class NetworkRuleService extends NetworkRulesApiService {
3
3
  }
@@ -1,7 +1,7 @@
1
- import { ProjectsApiService } from '../api/generated/apis/projects-api';
2
- import { ProjectsActionsApiService } from '../api/generated/apis/projects-actions-api';
3
- import { ProjectsEnvironmentsApiService } from '../api/generated/apis/projects-environments-api';
4
- import { ProjectsArchivedEnvironmentsApiService } from '../api/generated/apis/projects-archived-environments-api';
1
+ import { ProjectsApiService } from "../api/generated/apis/projects-api";
2
+ import { ProjectsActionsApiService } from "../api/generated/apis/projects-actions-api";
3
+ import { ProjectsEnvironmentsApiService } from "../api/generated/apis/projects-environments-api";
4
+ import { ProjectsArchivedEnvironmentsApiService } from "../api/generated/apis/projects-archived-environments-api";
5
5
  export declare class ProjectService extends ProjectsApiService {
6
6
  actions: ProjectsActionsApiService;
7
7
  archivedEnvironments: ProjectsArchivedEnvironmentsApiService;
@@ -1,3 +1,3 @@
1
- import { ResourceEventsApiService } from '../api/generated/apis/resource-events-api';
1
+ import { ResourceEventsApiService } from "../api/generated/apis/resource-events-api";
2
2
  export declare class ResourceEventService extends ResourceEventsApiService {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { ResourceLinksApiService } from '../api/generated/apis/resource-links-api';
1
+ import { ResourceLinksApiService } from "../api/generated/apis/resource-links-api";
2
2
  export declare class ResourceLinkService extends ResourceLinksApiService {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { RolesApiService } from '../api/generated/apis/roles-api';
1
+ import { RolesApiService } from "../api/generated/apis/roles-api";
2
2
  export declare class RoleService extends RolesApiService {
3
3
  }
@@ -1,4 +1,4 @@
1
- import { ServersApiService } from '../api/generated/apis/servers-api';
1
+ import { ServersApiService } from "../api/generated/apis/servers-api";
2
2
  export declare class ServerService extends ServersApiService {
3
3
  /**
4
4
  * Converts a string to a valid server's hostname format
@@ -11,10 +11,10 @@ class ServerService extends servers_api_1.ServersApiService {
11
11
  convertToHostname(name) {
12
12
  return name
13
13
  .toLowerCase()
14
- .normalize('NFD')
15
- .replace(/[\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+/g, '-')
16
- .replace(/[^a-z0-9-]+|^[-\s]+|[-\s]+$/g, '')
17
- .replace(/-{2,}/g, '-');
14
+ .normalize("NFD")
15
+ .replace(/[\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+/g, "-")
16
+ .replace(/[^a-z0-9-]+|^[-\s]+|[-\s]+$/g, "")
17
+ .replace(/-{2,}/g, "-");
18
18
  }
19
19
  }
20
20
  exports.ServerService = ServerService;
@@ -1,5 +1,5 @@
1
- import { ServicesApiService } from '../api/generated/apis/services-api';
2
- import { ServicesVariablesApiService } from '../api/generated/apis/services-variables-api';
1
+ import { ServicesApiService } from "../api/generated/apis/services-api";
2
+ import { ServicesVariablesApiService } from "../api/generated/apis/services-variables-api";
3
3
  export declare class ServiceService extends ServicesApiService {
4
4
  variables: ServicesVariablesApiService;
5
5
  }
@@ -1,3 +1,3 @@
1
- import { SSHKeysApiService } from '../api/generated/apis/sshkeys-api';
1
+ import { SSHKeysApiService } from "../api/generated/apis/sshkeys-api";
2
2
  export declare class SshKeyService extends SSHKeysApiService {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { SSLCertificatesApiService } from '../api/generated/apis/sslcertificates-api';
1
+ import { SSLCertificatesApiService } from "../api/generated/apis/sslcertificates-api";
2
2
  export declare class SslCertificateService extends SSLCertificatesApiService {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { TeamInvitationsApiService } from '../api/generated/apis/team-invitations-api';
1
+ import { TeamInvitationsApiService } from "../api/generated/apis/team-invitations-api";
2
2
  export declare class TeamInvitationService extends TeamInvitationsApiService {
3
3
  }
@@ -1,6 +1,6 @@
1
- import { TeamsApiService } from '../api/generated/apis/teams-api';
2
- import { TeamsInvitationsApiService } from '../api/generated/apis/teams-invitations-api';
3
- import { TeamsMembersApiService } from '../api/generated/apis/teams-members-api';
1
+ import { TeamsApiService } from "../api/generated/apis/teams-api";
2
+ import { TeamsInvitationsApiService } from "../api/generated/apis/teams-invitations-api";
3
+ import { TeamsMembersApiService } from "../api/generated/apis/teams-members-api";
4
4
  export declare class TeamService extends TeamsApiService {
5
5
  invitations: TeamsInvitationsApiService;
6
6
  members: TeamsMembersApiService;
@@ -1,8 +1,8 @@
1
- import { UsersApiService } from '../api/generated/apis/users-api';
2
- import { UsersTeamInvitationsApiService } from '../api/generated/apis/users-team-invitations-api';
3
- import { UsersPasswordsApiService } from '../api/generated/apis/users-passwords-api';
4
- import { UsersEnvironmentsApiService } from '../api/generated/apis/users-environments-api';
5
- import { UsersProjectsApiService } from '../api/generated/apis/users-projects-api';
1
+ import { UsersApiService } from "../api/generated/apis/users-api";
2
+ import { UsersTeamInvitationsApiService } from "../api/generated/apis/users-team-invitations-api";
3
+ import { UsersPasswordsApiService } from "../api/generated/apis/users-passwords-api";
4
+ import { UsersEnvironmentsApiService } from "../api/generated/apis/users-environments-api";
5
+ import { UsersProjectsApiService } from "../api/generated/apis/users-projects-api";
6
6
  export declare class UserService extends UsersApiService {
7
7
  environments: UsersEnvironmentsApiService;
8
8
  passwords: UsersPasswordsApiService;
@@ -1,3 +1,3 @@
1
- import { VariablesApiService } from '../api/generated/apis/variables-api';
1
+ import { VariablesApiService } from "../api/generated/apis/variables-api";
2
2
  export declare class VariableService extends VariablesApiService {
3
3
  }
@@ -1,3 +1,3 @@
1
- import { VirtualHostsApiService } from '../api/generated/apis/virtual-hosts-api';
1
+ import { VirtualHostsApiService } from "../api/generated/apis/virtual-hosts-api";
2
2
  export declare class VirtualHostService extends VirtualHostsApiService {
3
3
  }
@@ -1,30 +1,30 @@
1
- export * from './ActionService';
2
- export * from './ApiBaseService';
3
- export * from './ApplicationService';
4
- export * from './CredentialService';
5
- export * from './CronJobService';
6
- export * from './DaemonService';
7
- export * from './EnvironmentService';
8
- export * from './HookRequestService';
9
- export * from './HookService';
10
- export * from './LogService';
11
- export * from './NetworkRuleService';
12
- export * from './NetworkService';
13
- export * from './OrganizationService';
14
- export * from './PipelineService';
15
- export * from './ProjectService';
16
- export * from './ResourceEventService';
17
- export * from './ResourceLinkService';
18
- export * from './RoleService';
19
- export * from './ServerService';
20
- export * from './ServiceService';
21
- export * from './SocialAccountService';
22
- export * from './SshKeyService';
23
- export * from './SslCertificateService';
24
- export * from './StaticService';
25
- export * from './SubnetService';
26
- export * from './TeamInvitationService';
27
- export * from './TeamService';
28
- export * from './UserService';
29
- export * from './VariableService';
30
- export * from './VirtualHostService';
1
+ export * from "./ActionService";
2
+ export * from "./ApiBaseService";
3
+ export * from "./ApplicationService";
4
+ export * from "./CredentialService";
5
+ export * from "./CronJobService";
6
+ export * from "./DaemonService";
7
+ export * from "./EnvironmentService";
8
+ export * from "./HookRequestService";
9
+ export * from "./HookService";
10
+ export * from "./LogService";
11
+ export * from "./NetworkRuleService";
12
+ export * from "./NetworkService";
13
+ export * from "./OrganizationService";
14
+ export * from "./PipelineService";
15
+ export * from "./ProjectService";
16
+ export * from "./ResourceEventService";
17
+ export * from "./ResourceLinkService";
18
+ export * from "./RoleService";
19
+ export * from "./ServerService";
20
+ export * from "./ServiceService";
21
+ export * from "./SocialAccountService";
22
+ export * from "./SshKeyService";
23
+ export * from "./SslCertificateService";
24
+ export * from "./StaticService";
25
+ export * from "./SubnetService";
26
+ export * from "./TeamInvitationService";
27
+ export * from "./TeamService";
28
+ export * from "./UserService";
29
+ export * from "./VariableService";
30
+ export * from "./VirtualHostService";
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.5.3",
4
+ "version": "3.5.5",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -24,10 +24,10 @@
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
26
  "docs": "npm run docs-update-service-index && typedoc",
27
- "lint": "eslint .",
28
- "lint:fix": "eslint . --fix",
27
+ "lint": "vp check",
28
+ "lint:fix": "vp check --fix",
29
29
  "prepublishOnly": "npm run lint && npm test && npm run build",
30
- "test": "jest"
30
+ "test": "vp test"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
@@ -58,25 +58,15 @@
58
58
  },
59
59
  "homepage": "https://github.com/devopness/devopness#readme",
60
60
  "engines": {
61
- "node": ">=16"
61
+ "node": "^20.19.0 || ^22.13.0 || >=24"
62
62
  },
63
63
  "devDependencies": {
64
- "@eslint/js": "^10.0.1",
65
- "@openapitools/openapi-generator-cli": "^2.39.1",
66
- "@types/jest": "^30.0.0",
67
- "@typescript-eslint/parser": "^8.63.0",
64
+ "@openapitools/openapi-generator-cli": "^2.40.1",
68
65
  "axios-mock-adapter": "^2.1.0",
69
- "eslint": "^10.6.0",
70
- "eslint-import-resolver-typescript": "^4.4.5",
71
- "eslint-plugin-import": "^2.32.0",
72
- "eslint-plugin-n": "^18.2.1",
73
- "eslint-plugin-promise": "^7.3.0",
74
66
  "husky": "9.1.7",
75
- "jest": "^30.4.2",
76
- "ts-jest": "^29.4.11",
77
- "typedoc": "^0.28.20",
78
- "typescript": "^6.0.3",
79
- "typescript-eslint": "^8.63.0"
67
+ "vite-plus": "0.2.6",
68
+ "typescript": "^7.0.2",
69
+ "typedoc": "^0.28.20"
80
70
  },
81
71
  "dependencies": {
82
72
  "@types/parse-link-header": "^2.0.3",