@sonatype/nexus-repo-api-client 3.95.0 → 3.95.2

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 (32) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/dist/apis/CleanupPoliciesApi.d.ts +4 -4
  3. package/dist/apis/CleanupPoliciesApi.js +6 -4
  4. package/dist/apis/SecurityManagementJWTApi.d.ts +25 -0
  5. package/dist/apis/SecurityManagementJWTApi.js +60 -0
  6. package/dist/apis/SecurityOAuth2OIDCApi.d.ts +45 -0
  7. package/dist/apis/SecurityOAuth2OIDCApi.js +123 -0
  8. package/dist/apis/index.d.ts +2 -0
  9. package/dist/apis/index.js +2 -0
  10. package/dist/esm/apis/CleanupPoliciesApi.d.ts +4 -4
  11. package/dist/esm/apis/CleanupPoliciesApi.js +7 -5
  12. package/dist/esm/apis/SecurityManagementJWTApi.d.ts +25 -0
  13. package/dist/esm/apis/SecurityManagementJWTApi.js +56 -0
  14. package/dist/esm/apis/SecurityOAuth2OIDCApi.d.ts +45 -0
  15. package/dist/esm/apis/SecurityOAuth2OIDCApi.js +119 -0
  16. package/dist/esm/apis/index.d.ts +2 -0
  17. package/dist/esm/apis/index.js +2 -0
  18. package/dist/esm/models/OAuth2OidcConfigurationXO.d.ts +134 -0
  19. package/dist/esm/models/OAuth2OidcConfigurationXO.js +77 -0
  20. package/dist/esm/models/index.d.ts +1 -0
  21. package/dist/esm/models/index.js +1 -0
  22. package/dist/models/OAuth2OidcConfigurationXO.d.ts +134 -0
  23. package/dist/models/OAuth2OidcConfigurationXO.js +84 -0
  24. package/dist/models/index.d.ts +1 -0
  25. package/dist/models/index.js +1 -0
  26. package/package.json +1 -1
  27. package/src/apis/CleanupPoliciesApi.ts +10 -8
  28. package/src/apis/SecurityManagementJWTApi.ts +54 -0
  29. package/src/apis/SecurityOAuth2OIDCApi.ts +138 -0
  30. package/src/apis/index.ts +2 -0
  31. package/src/models/OAuth2OidcConfigurationXO.ts +195 -0
  32. package/src/models/index.ts +1 -0
@@ -127,7 +127,7 @@ export class CleanupPoliciesApi extends runtime.BaseAPI {
127
127
  /**
128
128
  * Get a policy by name
129
129
  */
130
- async getCleanupPoliciesRaw(requestParameters: CleanupPoliciesApiGetCleanupPoliciesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
130
+ async getCleanupPoliciesRaw(requestParameters: CleanupPoliciesApiGetCleanupPoliciesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CleanupPolicyResourceXO>> {
131
131
  if (requestParameters['name'] == null) {
132
132
  throw new runtime.RequiredError(
133
133
  'name',
@@ -153,20 +153,21 @@ export class CleanupPoliciesApi extends runtime.BaseAPI {
153
153
  query: queryParameters,
154
154
  }, initOverrides);
155
155
 
156
- return new runtime.VoidApiResponse(response);
156
+ return new runtime.JSONApiResponse(response, (jsonValue) => CleanupPolicyResourceXOFromJSON(jsonValue));
157
157
  }
158
158
 
159
159
  /**
160
160
  * Get a policy by name
161
161
  */
162
- async getCleanupPolicies(requestParameters: CleanupPoliciesApiGetCleanupPoliciesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
163
- await this.getCleanupPoliciesRaw(requestParameters, initOverrides);
162
+ async getCleanupPolicies(requestParameters: CleanupPoliciesApiGetCleanupPoliciesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CleanupPolicyResourceXO> {
163
+ const response = await this.getCleanupPoliciesRaw(requestParameters, initOverrides);
164
+ return await response.value();
164
165
  }
165
166
 
166
167
  /**
167
168
  * Get a list of existing policies
168
169
  */
169
- async listCleanupPoliciesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
170
+ async listCleanupPoliciesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CleanupPolicyResourceXO>>> {
170
171
  const queryParameters: any = {};
171
172
 
172
173
  const headerParameters: runtime.HTTPHeaders = {};
@@ -184,14 +185,15 @@ export class CleanupPoliciesApi extends runtime.BaseAPI {
184
185
  query: queryParameters,
185
186
  }, initOverrides);
186
187
 
187
- return new runtime.VoidApiResponse(response);
188
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CleanupPolicyResourceXOFromJSON));
188
189
  }
189
190
 
190
191
  /**
191
192
  * Get a list of existing policies
192
193
  */
193
- async listCleanupPolicies(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
194
- await this.listCleanupPoliciesRaw(initOverrides);
194
+ async listCleanupPolicies(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CleanupPolicyResourceXO>> {
195
+ const response = await this.listCleanupPoliciesRaw(initOverrides);
196
+ return await response.value();
195
197
  }
196
198
 
197
199
  /**
@@ -0,0 +1,54 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Nexus Repository Manager
5
+ * This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.95.0-07.
6
+ *
7
+ * The version of the OpenAPI document: 3.95.0-07
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
+
15
+
16
+ import * as runtime from '../runtime';
17
+
18
+ /**
19
+ *
20
+ */
21
+ export class SecurityManagementJWTApi extends runtime.BaseAPI {
22
+
23
+ /**
24
+ * Reset JWT secret (note that session will be expired for the all logged-in users)
25
+ */
26
+ async updateSecurityJwtRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
27
+ const queryParameters: any = {};
28
+
29
+ const headerParameters: runtime.HTTPHeaders = {};
30
+
31
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
32
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
33
+ }
34
+
35
+ let urlPath = `/v1/security/jwt`;
36
+
37
+ const response = await this.request({
38
+ path: urlPath,
39
+ method: 'PUT',
40
+ headers: headerParameters,
41
+ query: queryParameters,
42
+ }, initOverrides);
43
+
44
+ return new runtime.VoidApiResponse(response);
45
+ }
46
+
47
+ /**
48
+ * Reset JWT secret (note that session will be expired for the all logged-in users)
49
+ */
50
+ async updateSecurityJwt(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
51
+ await this.updateSecurityJwtRaw(initOverrides);
52
+ }
53
+
54
+ }
@@ -0,0 +1,138 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Nexus Repository Manager
5
+ * This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.95.0-07.
6
+ *
7
+ * The version of the OpenAPI document: 3.95.0-07
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
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ OAuth2OidcConfigurationXO,
19
+ } from '../models/index';
20
+ import {
21
+ OAuth2OidcConfigurationXOFromJSON,
22
+ OAuth2OidcConfigurationXOToJSON,
23
+ } from '../models/index';
24
+
25
+ export interface SecurityOAuth2OIDCApiUpdateSecurityOauth2Request {
26
+ oAuth2OidcConfigurationXO: OAuth2OidcConfigurationXO;
27
+ }
28
+
29
+ /**
30
+ *
31
+ */
32
+ export class SecurityOAuth2OIDCApi extends runtime.BaseAPI {
33
+
34
+ /**
35
+ * Remove OAuth2/OIDC configuration
36
+ */
37
+ async deleteSecurityOauth2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
38
+ const queryParameters: any = {};
39
+
40
+ const headerParameters: runtime.HTTPHeaders = {};
41
+
42
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
43
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
44
+ }
45
+
46
+ let urlPath = `/v1/security/oauth2`;
47
+
48
+ const response = await this.request({
49
+ path: urlPath,
50
+ method: 'DELETE',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ }, initOverrides);
54
+
55
+ return new runtime.VoidApiResponse(response);
56
+ }
57
+
58
+ /**
59
+ * Remove OAuth2/OIDC configuration
60
+ */
61
+ async deleteSecurityOauth2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
62
+ await this.deleteSecurityOauth2Raw(initOverrides);
63
+ }
64
+
65
+ /**
66
+ * Retrieve the current OAuth2/OIDC configuration
67
+ */
68
+ async listSecurityOauth2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuth2OidcConfigurationXO>> {
69
+ const queryParameters: any = {};
70
+
71
+ const headerParameters: runtime.HTTPHeaders = {};
72
+
73
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
74
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
75
+ }
76
+
77
+ let urlPath = `/v1/security/oauth2`;
78
+
79
+ const response = await this.request({
80
+ path: urlPath,
81
+ method: 'GET',
82
+ headers: headerParameters,
83
+ query: queryParameters,
84
+ }, initOverrides);
85
+
86
+ return new runtime.JSONApiResponse(response, (jsonValue) => OAuth2OidcConfigurationXOFromJSON(jsonValue));
87
+ }
88
+
89
+ /**
90
+ * Retrieve the current OAuth2/OIDC configuration
91
+ */
92
+ async listSecurityOauth2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuth2OidcConfigurationXO> {
93
+ const response = await this.listSecurityOauth2Raw(initOverrides);
94
+ return await response.value();
95
+ }
96
+
97
+ /**
98
+ * Create or update OAuth2/OIDC configuration
99
+ */
100
+ async updateSecurityOauth2Raw(requestParameters: SecurityOAuth2OIDCApiUpdateSecurityOauth2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
101
+ if (requestParameters['oAuth2OidcConfigurationXO'] == null) {
102
+ throw new runtime.RequiredError(
103
+ 'oAuth2OidcConfigurationXO',
104
+ 'Required parameter "oAuth2OidcConfigurationXO" was null or undefined when calling updateSecurityOauth2().'
105
+ );
106
+ }
107
+
108
+ const queryParameters: any = {};
109
+
110
+ const headerParameters: runtime.HTTPHeaders = {};
111
+
112
+ headerParameters['Content-Type'] = 'application/json';
113
+
114
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
115
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
116
+ }
117
+
118
+ let urlPath = `/v1/security/oauth2`;
119
+
120
+ const response = await this.request({
121
+ path: urlPath,
122
+ method: 'PUT',
123
+ headers: headerParameters,
124
+ query: queryParameters,
125
+ body: OAuth2OidcConfigurationXOToJSON(requestParameters['oAuth2OidcConfigurationXO']),
126
+ }, initOverrides);
127
+
128
+ return new runtime.VoidApiResponse(response);
129
+ }
130
+
131
+ /**
132
+ * Create or update OAuth2/OIDC configuration
133
+ */
134
+ async updateSecurityOauth2(requestParameters: SecurityOAuth2OIDCApiUpdateSecurityOauth2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
135
+ await this.updateSecurityOauth2Raw(requestParameters, initOverrides);
136
+ }
137
+
138
+ }
package/src/apis/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from './SecurityManagementApi';
33
33
  export * from './SecurityManagementAPIAccessApi';
34
34
  export * from './SecurityManagementAnonymousAccessApi';
35
35
  export * from './SecurityManagementApiKeysPrincipalsEncryptionApi';
36
+ export * from './SecurityManagementJWTApi';
36
37
  export * from './SecurityManagementLDAPApi';
37
38
  export * from './SecurityManagementPrivilegesApi';
38
39
  export * from './SecurityManagementRealmsApi';
@@ -43,6 +44,7 @@ export * from './SecurityManagementSSRFProtectionApi';
43
44
  export * from './SecurityManagementSecretsEncryptionApi';
44
45
  export * from './SecurityManagementUserTokensApi';
45
46
  export * from './SecurityManagementUsersApi';
47
+ export * from './SecurityOAuth2OIDCApi';
46
48
  export * from './StagingApi';
47
49
  export * from './StatusApi';
48
50
  export * from './SupportApi';
@@ -0,0 +1,195 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Nexus Repository Manager
5
+ * This documents the available APIs into [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) as of version 3.95.0-07.
6
+ *
7
+ * The version of the OpenAPI document: 3.95.0-07
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
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface OAuth2OidcConfigurationXO
20
+ */
21
+ export interface OAuth2OidcConfigurationXO {
22
+ /**
23
+ *
24
+ * @type {{ [key: string]: string; }}
25
+ * @memberof OAuth2OidcConfigurationXO
26
+ */
27
+ authorizationCustomParams?: { [key: string]: string; };
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof OAuth2OidcConfigurationXO
32
+ */
33
+ clientId?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof OAuth2OidcConfigurationXO
38
+ */
39
+ clientSecret?: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof OAuth2OidcConfigurationXO
44
+ */
45
+ emailClaim?: string;
46
+ /**
47
+ *
48
+ * @type {{ [key: string]: string; }}
49
+ * @memberof OAuth2OidcConfigurationXO
50
+ */
51
+ exactMatchClaims?: { [key: string]: string; };
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof OAuth2OidcConfigurationXO
56
+ */
57
+ firstNameClaim?: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof OAuth2OidcConfigurationXO
62
+ */
63
+ groupsClaim?: string;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof OAuth2OidcConfigurationXO
68
+ */
69
+ idpAuthorizationUrl?: string;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof OAuth2OidcConfigurationXO
74
+ */
75
+ idpJwks?: string;
76
+ /**
77
+ *
78
+ * @type {string}
79
+ * @memberof OAuth2OidcConfigurationXO
80
+ */
81
+ idpJwksUrl?: string;
82
+ /**
83
+ *
84
+ * @type {string}
85
+ * @memberof OAuth2OidcConfigurationXO
86
+ */
87
+ idpJwsAlgorithm: string;
88
+ /**
89
+ *
90
+ * @type {string}
91
+ * @memberof OAuth2OidcConfigurationXO
92
+ */
93
+ idpLogoutUrl?: string;
94
+ /**
95
+ *
96
+ * @type {string}
97
+ * @memberof OAuth2OidcConfigurationXO
98
+ */
99
+ idpTokenUrl?: string;
100
+ /**
101
+ *
102
+ * @type {string}
103
+ * @memberof OAuth2OidcConfigurationXO
104
+ */
105
+ lastNameClaim?: string;
106
+ /**
107
+ *
108
+ * @type {{ [key: string]: string; }}
109
+ * @memberof OAuth2OidcConfigurationXO
110
+ */
111
+ tokenRequestCustomParams?: { [key: string]: string; };
112
+ /**
113
+ *
114
+ * @type {boolean}
115
+ * @memberof OAuth2OidcConfigurationXO
116
+ */
117
+ useTrustStore?: boolean;
118
+ /**
119
+ *
120
+ * @type {string}
121
+ * @memberof OAuth2OidcConfigurationXO
122
+ */
123
+ usernameClaim: string;
124
+ }
125
+
126
+ /**
127
+ * Check if a given object implements the OAuth2OidcConfigurationXO interface.
128
+ */
129
+ export function instanceOfOAuth2OidcConfigurationXO(value: object): value is OAuth2OidcConfigurationXO {
130
+ if (!('idpJwsAlgorithm' in value) || value['idpJwsAlgorithm'] === undefined) return false;
131
+ if (!('usernameClaim' in value) || value['usernameClaim'] === undefined) return false;
132
+ return true;
133
+ }
134
+
135
+ export function OAuth2OidcConfigurationXOFromJSON(json: any): OAuth2OidcConfigurationXO {
136
+ return OAuth2OidcConfigurationXOFromJSONTyped(json, false);
137
+ }
138
+
139
+ export function OAuth2OidcConfigurationXOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuth2OidcConfigurationXO {
140
+ if (json == null) {
141
+ return json;
142
+ }
143
+ return {
144
+
145
+ 'authorizationCustomParams': json['authorizationCustomParams'] == null ? undefined : json['authorizationCustomParams'],
146
+ 'clientId': json['clientId'] == null ? undefined : json['clientId'],
147
+ 'clientSecret': json['clientSecret'] == null ? undefined : json['clientSecret'],
148
+ 'emailClaim': json['emailClaim'] == null ? undefined : json['emailClaim'],
149
+ 'exactMatchClaims': json['exactMatchClaims'] == null ? undefined : json['exactMatchClaims'],
150
+ 'firstNameClaim': json['firstNameClaim'] == null ? undefined : json['firstNameClaim'],
151
+ 'groupsClaim': json['groupsClaim'] == null ? undefined : json['groupsClaim'],
152
+ 'idpAuthorizationUrl': json['idpAuthorizationUrl'] == null ? undefined : json['idpAuthorizationUrl'],
153
+ 'idpJwks': json['idpJwks'] == null ? undefined : json['idpJwks'],
154
+ 'idpJwksUrl': json['idpJwksUrl'] == null ? undefined : json['idpJwksUrl'],
155
+ 'idpJwsAlgorithm': json['idpJwsAlgorithm'],
156
+ 'idpLogoutUrl': json['idpLogoutUrl'] == null ? undefined : json['idpLogoutUrl'],
157
+ 'idpTokenUrl': json['idpTokenUrl'] == null ? undefined : json['idpTokenUrl'],
158
+ 'lastNameClaim': json['lastNameClaim'] == null ? undefined : json['lastNameClaim'],
159
+ 'tokenRequestCustomParams': json['tokenRequestCustomParams'] == null ? undefined : json['tokenRequestCustomParams'],
160
+ 'useTrustStore': json['useTrustStore'] == null ? undefined : json['useTrustStore'],
161
+ 'usernameClaim': json['usernameClaim'],
162
+ };
163
+ }
164
+
165
+ export function OAuth2OidcConfigurationXOToJSON(json: any): OAuth2OidcConfigurationXO {
166
+ return OAuth2OidcConfigurationXOToJSONTyped(json, false);
167
+ }
168
+
169
+ export function OAuth2OidcConfigurationXOToJSONTyped(value?: OAuth2OidcConfigurationXO | null, ignoreDiscriminator: boolean = false): any {
170
+ if (value == null) {
171
+ return value;
172
+ }
173
+
174
+ return {
175
+
176
+ 'authorizationCustomParams': value['authorizationCustomParams'],
177
+ 'clientId': value['clientId'],
178
+ 'clientSecret': value['clientSecret'],
179
+ 'emailClaim': value['emailClaim'],
180
+ 'exactMatchClaims': value['exactMatchClaims'],
181
+ 'firstNameClaim': value['firstNameClaim'],
182
+ 'groupsClaim': value['groupsClaim'],
183
+ 'idpAuthorizationUrl': value['idpAuthorizationUrl'],
184
+ 'idpJwks': value['idpJwks'],
185
+ 'idpJwksUrl': value['idpJwksUrl'],
186
+ 'idpJwsAlgorithm': value['idpJwsAlgorithm'],
187
+ 'idpLogoutUrl': value['idpLogoutUrl'],
188
+ 'idpTokenUrl': value['idpTokenUrl'],
189
+ 'lastNameClaim': value['lastNameClaim'],
190
+ 'tokenRequestCustomParams': value['tokenRequestCustomParams'],
191
+ 'useTrustStore': value['useTrustStore'],
192
+ 'usernameClaim': value['usernameClaim'],
193
+ };
194
+ }
195
+
@@ -197,6 +197,7 @@ export * from './NugetHostedApiRepository';
197
197
  export * from './NugetHostedRepositoryApiRequest';
198
198
  export * from './NugetProxyApiRepository';
199
199
  export * from './NugetProxyRepositoryApiRequest';
200
+ export * from './OAuth2OidcConfigurationXO';
200
201
  export * from './OciAttributes';
201
202
  export * from './OciCosignConfiguration';
202
203
  export * from './OciGroupApiRepository';