@devopness/sdk-js 2.44.0 → 2.45.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 +12 -5
- package/dist/api/generated/apis/resource-events-api.d.ts +7 -0
- package/dist/api/generated/apis/resource-events-api.js +20 -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/server-blueprint.d.ts +0 -6
- package/dist/api/generated/models/server-environment-create.d.ts +1 -1
- package/dist/api/generated/models/server-update.d.ts +1 -1
- package/dist/api/generated/models/subscription.d.ts +96 -0
- package/dist/api/generated/models/subscription.js +14 -0
- package/dist/api/generated/models/user-me.d.ts +4 -10
- package/dist/api/generated/models/user-update.d.ts +0 -6
- package/dist/api/generated/models/user.d.ts +4 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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 an instance of `ApiResponse` and the `data` property has the data requested from the API. See [ApiResponse.ts](https://github.com/devopness/devopness/blob/
|
|
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/main/packages/sdks/javascript/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.
|
|
@@ -106,19 +106,26 @@ make test
|
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
### Without Docker
|
|
109
|
+
Installing on ``Linux`` or ``macOS`` systems.
|
|
109
110
|
|
|
110
|
-
#### 1.
|
|
111
|
-
|
|
111
|
+
#### 1. Navigate to the project directory!
|
|
112
|
+
```shell
|
|
113
|
+
cd packages/sdks/javascript/
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### 2. Install missing dependencies
|
|
117
|
+
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
|
|
118
|
+
for your operating system.
|
|
112
119
|
```
|
|
113
120
|
npm install
|
|
114
121
|
```
|
|
115
122
|
|
|
116
|
-
####
|
|
123
|
+
#### 3. Build SDK
|
|
117
124
|
```
|
|
118
125
|
npm run build
|
|
119
126
|
```
|
|
120
127
|
|
|
121
|
-
####
|
|
128
|
+
#### 4. Run tests
|
|
122
129
|
```
|
|
123
130
|
npm run test
|
|
124
131
|
```
|
|
@@ -16,6 +16,13 @@ import { ResourceEventRelation } from '../../generated/models';
|
|
|
16
16
|
* ResourceEventsApiService - Auto-generated
|
|
17
17
|
*/
|
|
18
18
|
export declare class ResourceEventsApiService extends ApiBaseService {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @summary Process event for a resource
|
|
22
|
+
* @param {string} resourceId The resource ID.
|
|
23
|
+
* @param {string} resourceType The resource type to create events for.
|
|
24
|
+
*/
|
|
25
|
+
addResourceEvent(resourceId: string, resourceType: string): Promise<ApiResponse<void>>;
|
|
19
26
|
/**
|
|
20
27
|
*
|
|
21
28
|
* @summary List events of a resource type
|
|
@@ -29,6 +29,26 @@ const Exceptions_1 = require("../../../common/Exceptions");
|
|
|
29
29
|
* ResourceEventsApiService - Auto-generated
|
|
30
30
|
*/
|
|
31
31
|
class ResourceEventsApiService extends ApiBaseService_1.ApiBaseService {
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @summary Process event for a resource
|
|
35
|
+
* @param {string} resourceId The resource ID.
|
|
36
|
+
* @param {string} resourceType The resource type to create events for.
|
|
37
|
+
*/
|
|
38
|
+
addResourceEvent(resourceId, resourceType) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (resourceId === null || resourceId === undefined) {
|
|
41
|
+
throw new Exceptions_1.ArgumentNullException('resourceId', 'addResourceEvent');
|
|
42
|
+
}
|
|
43
|
+
if (resourceType === null || resourceType === undefined) {
|
|
44
|
+
throw new Exceptions_1.ArgumentNullException('resourceType', 'addResourceEvent');
|
|
45
|
+
}
|
|
46
|
+
let queryString = '';
|
|
47
|
+
const requestUrl = '/events/{resource_type}/{resource_id}' + (queryString ? `?${queryString}` : '');
|
|
48
|
+
const response = yield this.post(requestUrl.replace(`{${"resource_id"}}`, encodeURIComponent(String(resourceId))).replace(`{${"resource_type"}}`, encodeURIComponent(String(resourceType))));
|
|
49
|
+
return new ApiResponse_1.ApiResponse(response);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
32
52
|
/**
|
|
33
53
|
*
|
|
34
54
|
* @summary List events of a resource type
|
|
@@ -185,6 +185,7 @@ export * from './static-service-type-supported-versions';
|
|
|
185
185
|
export * from './step';
|
|
186
186
|
export * from './step-pipeline-create';
|
|
187
187
|
export * from './step-pipeline-update';
|
|
188
|
+
export * from './subscription';
|
|
188
189
|
export * from './subscription-plan';
|
|
189
190
|
export * from './team';
|
|
190
191
|
export * from './team-environment-link';
|
|
@@ -201,6 +201,7 @@ __exportStar(require("./static-service-type-supported-versions"), exports);
|
|
|
201
201
|
__exportStar(require("./step"), exports);
|
|
202
202
|
__exportStar(require("./step-pipeline-create"), exports);
|
|
203
203
|
__exportStar(require("./step-pipeline-update"), exports);
|
|
204
|
+
__exportStar(require("./subscription"), exports);
|
|
204
205
|
__exportStar(require("./subscription-plan"), exports);
|
|
205
206
|
__exportStar(require("./team"), exports);
|
|
206
207
|
__exportStar(require("./team-environment-link"), exports);
|
|
@@ -22,10 +22,4 @@ export interface ServerBlueprint {
|
|
|
22
22
|
* @memberof ServerBlueprint
|
|
23
23
|
*/
|
|
24
24
|
services?: Array<BlueprintService> | null;
|
|
25
|
-
/**
|
|
26
|
-
* If `true`, create a landing page on the server to validate if has public access
|
|
27
|
-
* @type {boolean}
|
|
28
|
-
* @memberof ServerBlueprint
|
|
29
|
-
*/
|
|
30
|
-
validate_web_public_access: boolean;
|
|
31
25
|
}
|
|
@@ -30,7 +30,7 @@ export interface ServerEnvironmentCreate {
|
|
|
30
30
|
*/
|
|
31
31
|
ip_address?: string;
|
|
32
32
|
/**
|
|
33
|
-
* The network port to which the SSH daemon is listening to SSH connections on the server. This field is required when <code>provision_settings.self_hosted</code> is <code>true</code>.
|
|
33
|
+
* The network port to which the SSH daemon is listening to SSH connections on the server. This field is required when <code>provision_settings.self_hosted</code> is <code>true</code>. Must be between 22 and 65535.
|
|
34
34
|
* @type {number}
|
|
35
35
|
* @memberof ServerEnvironmentCreate
|
|
36
36
|
*/
|
|
@@ -28,7 +28,7 @@ export interface ServerUpdate {
|
|
|
28
28
|
*/
|
|
29
29
|
ip_address?: string;
|
|
30
30
|
/**
|
|
31
|
-
* The network port to which the SSH daemon is listening to SSH connections on the server. This field is required when <code>provision_settings.self_hosted</code> is <code>true</code>.
|
|
31
|
+
* The network port to which the SSH daemon is listening to SSH connections on the server. This field is required when <code>provision_settings.self_hosted</code> is <code>true</code>. Must be between 22 and 65535.
|
|
32
32
|
* @type {number}
|
|
33
33
|
* @memberof ServerUpdate
|
|
34
34
|
*/
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
* The user\'s active subscription
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Subscription
|
|
16
|
+
*/
|
|
17
|
+
export interface Subscription {
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the subscription
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof Subscription
|
|
22
|
+
*/
|
|
23
|
+
id?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The ID of the user this subscription belongs to
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof Subscription
|
|
28
|
+
*/
|
|
29
|
+
user_id?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The plan name of this subscription
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof Subscription
|
|
34
|
+
*/
|
|
35
|
+
plan_name?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Status of this subscription
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Subscription
|
|
40
|
+
*/
|
|
41
|
+
status?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Amount of plans purchased in this subscription
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof Subscription
|
|
46
|
+
*/
|
|
47
|
+
quantity?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Unitary price of the subscribed plan
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof Subscription
|
|
52
|
+
*/
|
|
53
|
+
price_unit?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Total price of this subscription (quantity x price_unit)
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof Subscription
|
|
58
|
+
*/
|
|
59
|
+
price_total?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Currency of the prices
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof Subscription
|
|
64
|
+
*/
|
|
65
|
+
price_currency?: string;
|
|
66
|
+
/**
|
|
67
|
+
* If this subscription is a trial, this field indicates when it will end
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof Subscription
|
|
70
|
+
*/
|
|
71
|
+
trial_ends_at?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* If not null, indicates the date when this subscription was cancelled
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof Subscription
|
|
76
|
+
*/
|
|
77
|
+
cancelled_at?: string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Indicates the date and time when this subscription ends
|
|
80
|
+
* @type {string}
|
|
81
|
+
* @memberof Subscription
|
|
82
|
+
*/
|
|
83
|
+
ends_at?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The date and time when the record was created
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @memberof Subscription
|
|
88
|
+
*/
|
|
89
|
+
created_at?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The date and time when the record was last updated
|
|
92
|
+
* @type {string}
|
|
93
|
+
* @memberof Subscription
|
|
94
|
+
*/
|
|
95
|
+
updated_at?: string;
|
|
96
|
+
}
|
|
@@ -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 });
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { Language } from './language';
|
|
13
13
|
import { SocialAccountRelation } from './social-account-relation';
|
|
14
|
-
import {
|
|
14
|
+
import { Subscription } from './subscription';
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* @export
|
|
@@ -55,17 +55,11 @@ export interface UserMe {
|
|
|
55
55
|
*/
|
|
56
56
|
social_accounts: Array<SocialAccountRelation>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @type {
|
|
60
|
-
* @memberof UserMe
|
|
61
|
-
*/
|
|
62
|
-
current_billing_plan: string;
|
|
63
|
-
/**
|
|
64
|
-
* The list of subscription plans
|
|
65
|
-
* @type {Array<SubscriptionPlan>}
|
|
58
|
+
*
|
|
59
|
+
* @type {Subscription}
|
|
66
60
|
* @memberof UserMe
|
|
67
61
|
*/
|
|
68
|
-
|
|
62
|
+
active_subscription: Subscription | null;
|
|
69
63
|
/**
|
|
70
64
|
* The date and time when the record was created
|
|
71
65
|
* @type {string}
|
|
@@ -39,10 +39,4 @@ export interface UserUpdate {
|
|
|
39
39
|
* @memberof UserUpdate
|
|
40
40
|
*/
|
|
41
41
|
language?: string;
|
|
42
|
-
/**
|
|
43
|
-
* The user subscription plan. Must be one of <code>FREE</code> or <code>PAID</code>.
|
|
44
|
-
* @type {string}
|
|
45
|
-
* @memberof UserUpdate
|
|
46
|
-
*/
|
|
47
|
-
current_billing_plan?: string;
|
|
48
42
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { Language } from './language';
|
|
13
13
|
import { SocialAccountRelation } from './social-account-relation';
|
|
14
|
-
import {
|
|
14
|
+
import { Subscription } from './subscription';
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
17
|
* @export
|
|
@@ -55,17 +55,11 @@ export interface User {
|
|
|
55
55
|
*/
|
|
56
56
|
social_accounts: Array<SocialAccountRelation>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @type {
|
|
60
|
-
* @memberof User
|
|
61
|
-
*/
|
|
62
|
-
current_billing_plan: string;
|
|
63
|
-
/**
|
|
64
|
-
* The list of subscription plans
|
|
65
|
-
* @type {Array<SubscriptionPlan>}
|
|
58
|
+
*
|
|
59
|
+
* @type {Subscription}
|
|
66
60
|
* @memberof User
|
|
67
61
|
*/
|
|
68
|
-
|
|
62
|
+
active_subscription: Subscription | null;
|
|
69
63
|
/**
|
|
70
64
|
* The date and time when the record was created
|
|
71
65
|
* @type {string}
|