@devopness/sdk-js 3.3.3 → 3.4.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.
@@ -12,7 +12,7 @@
12
12
  import { ApiBaseService } from "../../../services/ApiBaseService";
13
13
  import { ApiResponse } from "../../../common/ApiResponse";
14
14
  import { Credential } from '../../generated/models';
15
- import { CredentialEnvironmentCreate } from '../../generated/models';
15
+ import { CredentialOrganizationCreate } from '../../generated/models';
16
16
  import { CredentialRelation } from '../../generated/models';
17
17
  import { CredentialSetting } from '../../generated/models';
18
18
  import { CredentialUpdate } from '../../generated/models';
@@ -22,11 +22,11 @@ import { CredentialUpdate } from '../../generated/models';
22
22
  export declare class CredentialsApiService extends ApiBaseService {
23
23
  /**
24
24
  *
25
- * @summary Add a Credential to the given environment
26
- * @param {number} environmentId The ID of the environment.
27
- * @param {CredentialEnvironmentCreate} credentialEnvironmentCreate A JSON object containing the resource data
25
+ * @summary Add a Credential to the given organization
26
+ * @param {string} organizationId The numeric ID or URL Slug of an organization.
27
+ * @param {CredentialOrganizationCreate} credentialOrganizationCreate A JSON object containing the resource data
28
28
  */
29
- addEnvironmentCredential(environmentId: number, credentialEnvironmentCreate: CredentialEnvironmentCreate): Promise<ApiResponse<Credential>>;
29
+ addOrganizationCredential(organizationId: string, credentialOrganizationCreate: CredentialOrganizationCreate): Promise<ApiResponse<Credential>>;
30
30
  /**
31
31
  *
32
32
  * @summary Delete a given credential
@@ -46,6 +46,13 @@ export declare class CredentialsApiService extends ApiBaseService {
46
46
  * @param {string} providerCode The code of the provider.
47
47
  */
48
48
  getEnvironmentCredentialSettings(environmentId: number, providerCode: string): Promise<ApiResponse<CredentialSetting>>;
49
+ /**
50
+ *
51
+ * @summary Return provider settings
52
+ * @param {string} organizationId The ID or slug of the organization.
53
+ * @param {string} providerCode The code of the provider.
54
+ */
55
+ getOrganizationCredentialSettings(organizationId: string, providerCode: string): Promise<ApiResponse<CredentialSetting>>;
49
56
  /**
50
57
  *
51
58
  * @summary Get current status of a credential on its provider
@@ -54,7 +61,14 @@ export declare class CredentialsApiService extends ApiBaseService {
54
61
  getStatusCredential(credentialId: number): Promise<ApiResponse<void>>;
55
62
  /**
56
63
  *
57
- * @summary Return a list of all Credentials belonging to an environment
64
+ * @summary Link a credential to an environment
65
+ * @param {number} credentialId The credential ID.
66
+ * @param {number} environmentId The environment ID.
67
+ */
68
+ linkCredentialToEnvironment(credentialId: number, environmentId: number): Promise<ApiResponse<void>>;
69
+ /**
70
+ *
71
+ * @summary Return a list of all Credentials linked to an environment
58
72
  * @param {number} environmentId The ID of the environment.
59
73
  * @param {number} [page] Number of the page to be retrieved
60
74
  * @param {number} [perPage] Number of items returned per page
@@ -62,6 +76,23 @@ export declare class CredentialsApiService extends ApiBaseService {
62
76
  * @param {string} [providerType] Filter credentials by provider type.
63
77
  */
64
78
  listEnvironmentCredentials(environmentId: number, page?: number, perPage?: number, providerCode?: string, providerType?: string): Promise<ApiResponse<Array<CredentialRelation>>>;
79
+ /**
80
+ *
81
+ * @summary Return a list of all Credentials belonging to an organization
82
+ * @param {string} organizationId The numeric ID or URL Slug of an organization.
83
+ * @param {number} [page] Number of the page to be retrieved
84
+ * @param {number} [perPage] Number of items returned per page
85
+ * @param {string} [providerCode] Filter credentials by provider code.
86
+ * @param {string} [providerType] Filter credentials by provider type.
87
+ */
88
+ listOrganizationCredentials(organizationId: string, page?: number, perPage?: number, providerCode?: string, providerType?: string): Promise<ApiResponse<Array<CredentialRelation>>>;
89
+ /**
90
+ *
91
+ * @summary Unlink a credential from an environment
92
+ * @param {number} credentialId The credential ID.
93
+ * @param {number} environmentId The environment ID.
94
+ */
95
+ unlinkCredentialFromEnvironment(credentialId: number, environmentId: number): Promise<ApiResponse<void>>;
65
96
  /**
66
97
  *
67
98
  * @summary Update an existing Credential
@@ -31,21 +31,21 @@ const Exceptions_1 = require("../../../common/Exceptions");
31
31
  class CredentialsApiService extends ApiBaseService_1.ApiBaseService {
32
32
  /**
33
33
  *
34
- * @summary Add a Credential to the given environment
35
- * @param {number} environmentId The ID of the environment.
36
- * @param {CredentialEnvironmentCreate} credentialEnvironmentCreate A JSON object containing the resource data
34
+ * @summary Add a Credential to the given organization
35
+ * @param {string} organizationId The numeric ID or URL Slug of an organization.
36
+ * @param {CredentialOrganizationCreate} credentialOrganizationCreate A JSON object containing the resource data
37
37
  */
38
- addEnvironmentCredential(environmentId, credentialEnvironmentCreate) {
38
+ addOrganizationCredential(organizationId, credentialOrganizationCreate) {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
- if (environmentId === null || environmentId === undefined) {
41
- throw new Exceptions_1.ArgumentNullException('environmentId', 'addEnvironmentCredential');
40
+ if (organizationId === null || organizationId === undefined) {
41
+ throw new Exceptions_1.ArgumentNullException('organizationId', 'addOrganizationCredential');
42
42
  }
43
- if (credentialEnvironmentCreate === null || credentialEnvironmentCreate === undefined) {
44
- throw new Exceptions_1.ArgumentNullException('credentialEnvironmentCreate', 'addEnvironmentCredential');
43
+ if (credentialOrganizationCreate === null || credentialOrganizationCreate === undefined) {
44
+ throw new Exceptions_1.ArgumentNullException('credentialOrganizationCreate', 'addOrganizationCredential');
45
45
  }
46
46
  let queryString = '';
47
- const requestUrl = '/environments/{environment_id}/credentials' + (queryString ? `?${queryString}` : '');
48
- const response = yield this.post(requestUrl.replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))), credentialEnvironmentCreate);
47
+ const requestUrl = '/organizations/{organization_id}/credentials' + (queryString ? `?${queryString}` : '');
48
+ const response = yield this.post(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))), credentialOrganizationCreate);
49
49
  return new ApiResponse_1.ApiResponse(response);
50
50
  });
51
51
  }
@@ -101,6 +101,26 @@ class CredentialsApiService extends ApiBaseService_1.ApiBaseService {
101
101
  return new ApiResponse_1.ApiResponse(response);
102
102
  });
103
103
  }
104
+ /**
105
+ *
106
+ * @summary Return provider settings
107
+ * @param {string} organizationId The ID or slug of the organization.
108
+ * @param {string} providerCode The code of the provider.
109
+ */
110
+ getOrganizationCredentialSettings(organizationId, providerCode) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ if (organizationId === null || organizationId === undefined) {
113
+ throw new Exceptions_1.ArgumentNullException('organizationId', 'getOrganizationCredentialSettings');
114
+ }
115
+ if (providerCode === null || providerCode === undefined) {
116
+ throw new Exceptions_1.ArgumentNullException('providerCode', 'getOrganizationCredentialSettings');
117
+ }
118
+ let queryString = '';
119
+ const requestUrl = '/organizations/{organization_id}/credentials/{provider_code}/settings' + (queryString ? `?${queryString}` : '');
120
+ const response = yield this.get(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))).replace(`{${"provider_code"}}`, encodeURIComponent(String(providerCode))));
121
+ return new ApiResponse_1.ApiResponse(response);
122
+ });
123
+ }
104
124
  /**
105
125
  *
106
126
  * @summary Get current status of a credential on its provider
@@ -119,7 +139,27 @@ class CredentialsApiService extends ApiBaseService_1.ApiBaseService {
119
139
  }
120
140
  /**
121
141
  *
122
- * @summary Return a list of all Credentials belonging to an environment
142
+ * @summary Link a credential to an environment
143
+ * @param {number} credentialId The credential ID.
144
+ * @param {number} environmentId The environment ID.
145
+ */
146
+ linkCredentialToEnvironment(credentialId, environmentId) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ if (credentialId === null || credentialId === undefined) {
149
+ throw new Exceptions_1.ArgumentNullException('credentialId', 'linkCredentialToEnvironment');
150
+ }
151
+ if (environmentId === null || environmentId === undefined) {
152
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'linkCredentialToEnvironment');
153
+ }
154
+ let queryString = '';
155
+ const requestUrl = '/environments/{environment_id}/credentials/{credential_id}/link' + (queryString ? `?${queryString}` : '');
156
+ const response = yield this.post(requestUrl.replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId))).replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
157
+ return new ApiResponse_1.ApiResponse(response);
158
+ });
159
+ }
160
+ /**
161
+ *
162
+ * @summary Return a list of all Credentials linked to an environment
123
163
  * @param {number} environmentId The ID of the environment.
124
164
  * @param {number} [page] Number of the page to be retrieved
125
165
  * @param {number} [perPage] Number of items returned per page
@@ -144,6 +184,53 @@ class CredentialsApiService extends ApiBaseService_1.ApiBaseService {
144
184
  return new ApiResponse_1.ApiResponse(response);
145
185
  });
146
186
  }
187
+ /**
188
+ *
189
+ * @summary Return a list of all Credentials belonging to an organization
190
+ * @param {string} organizationId The numeric ID or URL Slug of an organization.
191
+ * @param {number} [page] Number of the page to be retrieved
192
+ * @param {number} [perPage] Number of items returned per page
193
+ * @param {string} [providerCode] Filter credentials by provider code.
194
+ * @param {string} [providerType] Filter credentials by provider type.
195
+ */
196
+ listOrganizationCredentials(organizationId, page, perPage, providerCode, providerType) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ if (organizationId === null || organizationId === undefined) {
199
+ throw new Exceptions_1.ArgumentNullException('organizationId', 'listOrganizationCredentials');
200
+ }
201
+ let queryString = '';
202
+ const queryParams = { page: page, per_page: perPage, provider_code: providerCode, provider_type: providerType, };
203
+ for (const key in queryParams) {
204
+ if (queryParams[key] === undefined || queryParams[key] === null) {
205
+ continue;
206
+ }
207
+ queryString += (queryString ? '&' : '') + `${key}=${encodeURI(queryParams[key])}`;
208
+ }
209
+ const requestUrl = '/organizations/{organization_id}/credentials' + (queryString ? `?${queryString}` : '');
210
+ const response = yield this.get(requestUrl.replace(`{${"organization_id"}}`, encodeURIComponent(String(organizationId))));
211
+ return new ApiResponse_1.ApiResponse(response);
212
+ });
213
+ }
214
+ /**
215
+ *
216
+ * @summary Unlink a credential from an environment
217
+ * @param {number} credentialId The credential ID.
218
+ * @param {number} environmentId The environment ID.
219
+ */
220
+ unlinkCredentialFromEnvironment(credentialId, environmentId) {
221
+ return __awaiter(this, void 0, void 0, function* () {
222
+ if (credentialId === null || credentialId === undefined) {
223
+ throw new Exceptions_1.ArgumentNullException('credentialId', 'unlinkCredentialFromEnvironment');
224
+ }
225
+ if (environmentId === null || environmentId === undefined) {
226
+ throw new Exceptions_1.ArgumentNullException('environmentId', 'unlinkCredentialFromEnvironment');
227
+ }
228
+ let queryString = '';
229
+ const requestUrl = '/environments/{environment_id}/credentials/{credential_id}/unlink' + (queryString ? `?${queryString}` : '');
230
+ const response = yield this.delete(requestUrl.replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId))).replace(`{${"environment_id"}}`, encodeURIComponent(String(environmentId))));
231
+ return new ApiResponse_1.ApiResponse(response);
232
+ });
233
+ }
147
234
  /**
148
235
  *
149
236
  * @summary Update an existing Credential
@@ -9,7 +9,6 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import { EnvironmentLink } from './environment-link';
13
12
  import { ResourceToBeLinked } from './resource-to-be-linked';
14
13
  /**
15
14
  *
@@ -89,10 +88,4 @@ export interface ApplicationEnvironmentCreate {
89
88
  * @memberof ApplicationEnvironmentCreate
90
89
  */
91
90
  install_dependencies_command?: string;
92
- /**
93
- *
94
- * @type {Array<EnvironmentLink>}
95
- * @memberof ApplicationEnvironmentCreate
96
- */
97
- environments?: Array<EnvironmentLink>;
98
91
  }
@@ -15,37 +15,37 @@ import { ProviderType } from './provider-type';
15
15
  /**
16
16
  *
17
17
  * @export
18
- * @interface CredentialEnvironmentCreate
18
+ * @interface CredentialOrganizationCreate
19
19
  */
20
- export interface CredentialEnvironmentCreate {
20
+ export interface CredentialOrganizationCreate {
21
21
  /**
22
22
  * The name of the credential. Must not be greater than 60 characters.
23
23
  * @type {string}
24
- * @memberof CredentialEnvironmentCreate
24
+ * @memberof CredentialOrganizationCreate
25
25
  */
26
26
  name: string;
27
27
  /**
28
28
  *
29
29
  * @type {ProviderCode}
30
- * @memberof CredentialEnvironmentCreate
30
+ * @memberof CredentialOrganizationCreate
31
31
  */
32
32
  provider_code: ProviderCode;
33
33
  /**
34
34
  *
35
35
  * @type {ProviderType}
36
- * @memberof CredentialEnvironmentCreate
36
+ * @memberof CredentialOrganizationCreate
37
37
  */
38
38
  provider_type: ProviderType;
39
39
  /**
40
40
  * If this credential is active or not.
41
41
  * @type {boolean}
42
- * @memberof CredentialEnvironmentCreate
42
+ * @memberof CredentialOrganizationCreate
43
43
  */
44
44
  active: boolean;
45
45
  /**
46
46
  *
47
47
  * @type {CredentialInputSettings}
48
- * @memberof CredentialEnvironmentCreate
48
+ * @memberof CredentialOrganizationCreate
49
49
  */
50
50
  settings: CredentialInputSettings;
51
51
  }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { ActionRelationShallow } from './action-relation-shallow';
12
13
  import { ProviderRelation } from './provider-relation';
13
14
  import { ProviderType } from './provider-type';
14
15
  import { UserRelation } from './user-relation';
@@ -60,6 +61,12 @@ export interface CredentialRelation {
60
61
  * @memberof CredentialRelation
61
62
  */
62
63
  created_by_user: UserRelation | null;
64
+ /**
65
+ *
66
+ * @type {ActionRelationShallow}
67
+ * @memberof CredentialRelation
68
+ */
69
+ last_action?: ActionRelationShallow | null;
63
70
  /**
64
71
  * The date and time when the record was created
65
72
  * @type {string}
@@ -24,11 +24,11 @@ export interface CredentialSetting {
24
24
  */
25
25
  provider: CredentialProviderType;
26
26
  /**
27
- * Numeric ID of the environment to which the network belongs to
27
+ * Numeric ID of the organization to which the credential belongs to
28
28
  * @type {number}
29
29
  * @memberof CredentialSetting
30
30
  */
31
- environment_id: number;
31
+ organization_id: number;
32
32
  /**
33
33
  *
34
34
  * @type {ProviderSettings}
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import { ActionRelationShallow } from './action-relation-shallow';
13
+ import { OrganizationRelation } from './organization-relation';
12
14
  import { ProviderRelation } from './provider-relation';
13
15
  import { UserRelation } from './user-relation';
14
16
  /**
@@ -53,12 +55,24 @@ export interface Credential {
53
55
  * @memberof Credential
54
56
  */
55
57
  active: boolean;
58
+ /**
59
+ *
60
+ * @type {OrganizationRelation}
61
+ * @memberof Credential
62
+ */
63
+ organization?: OrganizationRelation | null;
56
64
  /**
57
65
  *
58
66
  * @type {UserRelation}
59
67
  * @memberof Credential
60
68
  */
61
69
  created_by_user: UserRelation | null;
70
+ /**
71
+ *
72
+ * @type {ActionRelationShallow}
73
+ * @memberof Credential
74
+ */
75
+ last_action?: ActionRelationShallow | null;
62
76
  /**
63
77
  * The date and time when the record was created
64
78
  * @type {string}
@@ -71,11 +71,11 @@ export * from './credential';
71
71
  export * from './credential-aws';
72
72
  export * from './credential-azure';
73
73
  export * from './credential-digital-ocean';
74
- export * from './credential-environment-create';
75
74
  export * from './credential-google-cloud';
76
75
  export * from './credential-hetzner';
77
76
  export * from './credential-input-settings';
78
77
  export * from './credential-options';
78
+ export * from './credential-organization-create';
79
79
  export * from './credential-provider';
80
80
  export * from './credential-provider-type';
81
81
  export * from './credential-relation';
@@ -87,11 +87,11 @@ __exportStar(require("./credential"), exports);
87
87
  __exportStar(require("./credential-aws"), exports);
88
88
  __exportStar(require("./credential-azure"), exports);
89
89
  __exportStar(require("./credential-digital-ocean"), exports);
90
- __exportStar(require("./credential-environment-create"), exports);
91
90
  __exportStar(require("./credential-google-cloud"), exports);
92
91
  __exportStar(require("./credential-hetzner"), exports);
93
92
  __exportStar(require("./credential-input-settings"), exports);
94
93
  __exportStar(require("./credential-options"), exports);
94
+ __exportStar(require("./credential-organization-create"), exports);
95
95
  __exportStar(require("./credential-provider"), exports);
96
96
  __exportStar(require("./credential-provider-type"), exports);
97
97
  __exportStar(require("./credential-relation"), exports);
@@ -34,6 +34,30 @@ export interface LinkedResourceData {
34
34
  * @memberof LinkedResourceData
35
35
  */
36
36
  summary_fields?: Array<LinkedResourceSummaryField>;
37
+ /**
38
+ * The ID of the environment this resource belongs to
39
+ * @type {number}
40
+ * @memberof LinkedResourceData
41
+ */
42
+ environment_id?: number | null;
43
+ /**
44
+ * The name of the environment this resource belongs to
45
+ * @type {string}
46
+ * @memberof LinkedResourceData
47
+ */
48
+ environment_name?: string | null;
49
+ /**
50
+ * The ID of the project this resource belongs to
51
+ * @type {number}
52
+ * @memberof LinkedResourceData
53
+ */
54
+ project_id?: number | null;
55
+ /**
56
+ * The name of the project this resource belongs to
57
+ * @type {string}
58
+ * @memberof LinkedResourceData
59
+ */
60
+ project_name?: string | null;
37
61
  /**
38
62
  * The date and time when the record was created
39
63
  * @type {string}
@@ -52,4 +52,16 @@ export interface ResourceLinkChild {
52
52
  * @memberof ResourceLinkChild
53
53
  */
54
54
  linked_resource_data: LinkedResourceData;
55
+ /**
56
+ * The date and time when the resource link was created
57
+ * @type {string}
58
+ * @memberof ResourceLinkChild
59
+ */
60
+ created_at: string;
61
+ /**
62
+ * The date and time when the resource link was last updated
63
+ * @type {string}
64
+ * @memberof ResourceLinkChild
65
+ */
66
+ updated_at: string;
55
67
  }
@@ -59,4 +59,16 @@ export interface ResourceLinkRelation {
59
59
  * @memberof ResourceLinkRelation
60
60
  */
61
61
  children?: Array<ResourceLinkChild>;
62
+ /**
63
+ * The date and time when the resource link was created
64
+ * @type {string}
65
+ * @memberof ResourceLinkRelation
66
+ */
67
+ created_at: string;
68
+ /**
69
+ * The date and time when the resource link was last updated
70
+ * @type {string}
71
+ * @memberof ResourceLinkRelation
72
+ */
73
+ updated_at: string;
62
74
  }
@@ -40,7 +40,7 @@ export interface TeamRelation {
40
40
  * @type {OrganizationRelation}
41
41
  * @memberof TeamRelation
42
42
  */
43
- organization: OrganizationRelation | null;
43
+ organization?: OrganizationRelation | null;
44
44
  /**
45
45
  *
46
46
  * @type {UserRelation}
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.3.3",
4
+ "version": "3.4.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -62,15 +62,15 @@
62
62
  "eslint-plugin-n": "^18.0.1",
63
63
  "eslint-plugin-promise": "^7.3.0",
64
64
  "husky": "9.1.7",
65
- "jest": "^30.4.1",
65
+ "jest": "^30.4.2",
66
66
  "ts-jest": "^29.4.9",
67
67
  "typedoc": "^0.28.19",
68
68
  "typescript": "^5.9.3",
69
- "typescript-eslint": "^8.59.2"
69
+ "typescript-eslint": "^8.59.3"
70
70
  },
71
71
  "dependencies": {
72
72
  "@types/parse-link-header": "^2.0.3",
73
- "axios": "^1.16.0",
73
+ "axios": "^1.16.1",
74
74
  "parse-link-header": "^2.0.0"
75
75
  }
76
76
  }