@devopness/sdk-js 1.104.0 → 1.104.1
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
CHANGED
|
@@ -20,7 +20,7 @@ yarn add @devopness/sdk-js
|
|
|
20
20
|
|
|
21
21
|
### Initializing
|
|
22
22
|
|
|
23
|
-
To initialize the usage of Devopness SDK just import it and create a new instance of `DevopnessApiClient` class.
|
|
23
|
+
To initialize the usage of Devopness SDK, just import it and create a new instance of `DevopnessApiClient` class.
|
|
24
24
|
|
|
25
25
|
Here is a generic simple example that can be used from `Node.js`, `TypeScript` or `Javascript` applications:
|
|
26
26
|
|
|
@@ -30,8 +30,8 @@ const devopnessApi = new DevopnessApiClient();
|
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
The instance of `DevopnessApiClient` has properties to all services provided by the API.
|
|
33
|
-
The name of the methods at services is the same as operation name in the documentation of the
|
|
34
|
-
Devopness API. You can consult the URL of
|
|
33
|
+
The name of the methods at services is the same as the operation name in the documentation of the
|
|
34
|
+
Devopness API. You can consult the URL of an endpoint to see the operation name. For instance,
|
|
35
35
|
the URL to endpoint `POST /users/login` in the documentation is: `/#operation/login`
|
|
36
36
|
|
|
37
37
|
### Authenticating
|
|
@@ -49,7 +49,7 @@ async function authenticate(email, pass) {
|
|
|
49
49
|
authenticate('user@email.com', 'secret-password');
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
In the example above, `userTokens` is
|
|
52
|
+
In the example above, `userTokens` is an instance of `ApiResponse` and the `data` property has the data requested from the API. See [ApiResponse.ts](https://github.com/devopness/devopness/blob/master/src/common/ApiResponse.ts) for reference.
|
|
53
53
|
|
|
54
54
|
### Invoking authentication protected endpoints
|
|
55
55
|
Once an authentication token is set, any protected endpoint can be invoked.
|
|
@@ -74,7 +74,7 @@ getUserProfile();
|
|
|
74
74
|
This package includes TypeScript declarations for every method.
|
|
75
75
|
TypeScript versions `>= 3.8` are supported.
|
|
76
76
|
|
|
77
|
-
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.
|
|
77
|
+
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.
|
|
78
78
|
|
|
79
79
|
## Building and testing
|
|
80
80
|
To build and test the SDK locally, follow these steps:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EnvironmentsApiService } from '../api/generated/apis/environments-api';
|
|
2
|
+
import { EnvironmentsActionsApiService } from '../api/generated/apis/environments-actions-api';
|
|
2
3
|
import { EnvironmentsApplicationsApiService } from '../api/generated/apis/environments-applications-api';
|
|
3
4
|
import { EnvironmentsCronJobsApiService } from '../api/generated/apis/environments-cron-jobs-api';
|
|
4
5
|
import { EnvironmentsDaemonsApiService } from '../api/generated/apis/environments-daemons-api';
|
|
@@ -9,6 +10,7 @@ import { EnvironmentsServicesApiService } from '../api/generated/apis/environmen
|
|
|
9
10
|
import { EnvironmentsSSHKeysApiService } from '../api/generated/apis/environments-sshkeys-api';
|
|
10
11
|
import { EnvironmentsTeamsApiService } from '../api/generated/apis/environments-teams-api';
|
|
11
12
|
export declare class EnvironmentService extends EnvironmentsApiService {
|
|
13
|
+
actions: EnvironmentsActionsApiService;
|
|
12
14
|
applications: EnvironmentsApplicationsApiService;
|
|
13
15
|
cronjobs: EnvironmentsCronJobsApiService;
|
|
14
16
|
daemons: EnvironmentsDaemonsApiService;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EnvironmentService = void 0;
|
|
4
4
|
const environments_api_1 = require("../api/generated/apis/environments-api");
|
|
5
|
+
const environments_actions_api_1 = require("../api/generated/apis/environments-actions-api");
|
|
5
6
|
const environments_applications_api_1 = require("../api/generated/apis/environments-applications-api");
|
|
6
7
|
const environments_cron_jobs_api_1 = require("../api/generated/apis/environments-cron-jobs-api");
|
|
7
8
|
const environments_daemons_api_1 = require("../api/generated/apis/environments-daemons-api");
|
|
@@ -14,6 +15,7 @@ const environments_teams_api_1 = require("../api/generated/apis/environments-tea
|
|
|
14
15
|
class EnvironmentService extends environments_api_1.EnvironmentsApiService {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
18
|
+
this.actions = new environments_actions_api_1.EnvironmentsActionsApiService();
|
|
17
19
|
this.applications = new environments_applications_api_1.EnvironmentsApplicationsApiService();
|
|
18
20
|
this.cronjobs = new environments_cron_jobs_api_1.EnvironmentsCronJobsApiService();
|
|
19
21
|
this.daemons = new environments_daemons_api_1.EnvironmentsDaemonsApiService();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ProjectsApiService } from '../api/generated/apis/projects-api';
|
|
2
|
+
import { ProjectsActionsApiService } from '../api/generated/apis/projects-actions-api';
|
|
2
3
|
import { ProjectsApplicationsApiService } from '../api/generated/apis/projects-applications-api';
|
|
3
4
|
import { ProjectsCronJobsApiService } from '../api/generated/apis/projects-cron-jobs-api';
|
|
4
5
|
import { ProjectsEnvironmentsApiService } from '../api/generated/apis/projects-environments-api';
|
|
@@ -8,6 +9,7 @@ import { ProjectsServicesApiService } from '../api/generated/apis/projects-servi
|
|
|
8
9
|
import { ProjectsSSHKeysApiService } from '../api/generated/apis/projects-sshkeys-api';
|
|
9
10
|
import { ProjectsDaemonsApiService } from '../api/generated/apis/projects-daemons-api';
|
|
10
11
|
export declare class ProjectService extends ProjectsApiService {
|
|
12
|
+
actions: ProjectsActionsApiService;
|
|
11
13
|
applications: ProjectsApplicationsApiService;
|
|
12
14
|
cronjobs: ProjectsCronJobsApiService;
|
|
13
15
|
daemons: ProjectsDaemonsApiService;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProjectService = void 0;
|
|
4
4
|
const projects_api_1 = require("../api/generated/apis/projects-api");
|
|
5
|
+
const projects_actions_api_1 = require("../api/generated/apis/projects-actions-api");
|
|
5
6
|
const projects_applications_api_1 = require("../api/generated/apis/projects-applications-api");
|
|
6
7
|
const projects_cron_jobs_api_1 = require("../api/generated/apis/projects-cron-jobs-api");
|
|
7
8
|
const projects_environments_api_1 = require("../api/generated/apis/projects-environments-api");
|
|
@@ -13,6 +14,7 @@ const projects_daemons_api_1 = require("../api/generated/apis/projects-daemons-a
|
|
|
13
14
|
class ProjectService extends projects_api_1.ProjectsApiService {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
17
|
+
this.actions = new projects_actions_api_1.ProjectsActionsApiService();
|
|
16
18
|
this.applications = new projects_applications_api_1.ProjectsApplicationsApiService();
|
|
17
19
|
this.cronjobs = new projects_cron_jobs_api_1.ProjectsCronJobsApiService();
|
|
18
20
|
this.daemons = new projects_daemons_api_1.ProjectsDaemonsApiService();
|