@sonatype/nexus-iq-api-client 0.196.0 → 0.196.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.
@@ -280,6 +280,7 @@ src/models/GetSuggestedRemediationForComponent200Response.ts
280
280
  src/models/GroupingByDTO.ts
281
281
  src/models/ImportSbomRequest.ts
282
282
  src/models/InnerSourceData.ts
283
+ src/models/InsertOrUpdateSamlConfigurationRequest.ts
283
284
  src/models/InstallLicenseRequest.ts
284
285
  src/models/KevData.ts
285
286
  src/models/LabelsByOwner.ts
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ApiSamlConfigurationResponseDTO } from '../models/index';
13
+ import type { ApiSamlConfigurationDTO, ApiSamlConfigurationResponseDTO } from '../models/index';
14
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
15
+ identityProviderXml: Blob;
16
+ samlConfiguration: ApiSamlConfigurationDTO;
17
+ }
14
18
  /**
15
19
  * ConfigSAMLApi - interface
16
20
  *
@@ -51,6 +55,19 @@ export interface ConfigSAMLApiInterface {
51
55
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
52
56
  */
53
57
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
58
+ /**
59
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
60
+ * @param {Blob} identityProviderXml Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
61
+ * @param {ApiSamlConfigurationDTO} samlConfiguration
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof ConfigSAMLApiInterface
65
+ */
66
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+ /**
68
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
69
+ */
70
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
54
71
  }
55
72
  /**
56
73
  *
@@ -80,4 +97,12 @@ export declare class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAML
80
97
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
81
98
  */
82
99
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
100
+ /**
101
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
102
+ */
103
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
104
+ /**
105
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
106
+ */
107
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
83
108
  }
@@ -120,5 +120,61 @@ class ConfigSAMLApi extends runtime.BaseAPI {
120
120
  return yield response.value();
121
121
  });
122
122
  }
123
+ /**
124
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
125
+ */
126
+ insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ if (requestParameters['identityProviderXml'] == null) {
129
+ throw new runtime.RequiredError('identityProviderXml', 'Required parameter "identityProviderXml" was null or undefined when calling insertOrUpdateSamlConfiguration().');
130
+ }
131
+ if (requestParameters['samlConfiguration'] == null) {
132
+ throw new runtime.RequiredError('samlConfiguration', 'Required parameter "samlConfiguration" was null or undefined when calling insertOrUpdateSamlConfiguration().');
133
+ }
134
+ const queryParameters = {};
135
+ const headerParameters = {};
136
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
137
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
138
+ }
139
+ const consumes = [
140
+ { contentType: 'multipart/form-data' },
141
+ ];
142
+ // @ts-ignore: canConsumeForm may be unused
143
+ const canConsumeForm = runtime.canConsumeForm(consumes);
144
+ let formParams;
145
+ let useForm = false;
146
+ // use FormData to transmit files using content-type "multipart/form-data"
147
+ useForm = canConsumeForm;
148
+ if (useForm) {
149
+ formParams = new FormData();
150
+ }
151
+ else {
152
+ formParams = new URLSearchParams();
153
+ }
154
+ if (requestParameters['identityProviderXml'] != null) {
155
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml']);
156
+ }
157
+ if (requestParameters['samlConfiguration'] != null) {
158
+ formParams.append('samlConfiguration', new Blob([JSON.stringify((0, index_1.ApiSamlConfigurationDTOToJSON)(requestParameters['samlConfiguration']))], { type: "application/json", }));
159
+ }
160
+ let urlPath = `/api/v2/config/saml`;
161
+ const response = yield this.request({
162
+ path: urlPath,
163
+ method: 'PUT',
164
+ headers: headerParameters,
165
+ query: queryParameters,
166
+ body: formParams,
167
+ }, initOverrides);
168
+ return new runtime.VoidApiResponse(response);
169
+ });
170
+ }
171
+ /**
172
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
173
+ */
174
+ insertOrUpdateSamlConfiguration(requestParameters, initOverrides) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ yield this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
177
+ });
178
+ }
123
179
  }
124
180
  exports.ConfigSAMLApi = ConfigSAMLApi;
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ApiSamlConfigurationResponseDTO } from '../models/index';
13
+ import type { ApiSamlConfigurationDTO, ApiSamlConfigurationResponseDTO } from '../models/index';
14
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
15
+ identityProviderXml: Blob;
16
+ samlConfiguration: ApiSamlConfigurationDTO;
17
+ }
14
18
  /**
15
19
  * ConfigSAMLApi - interface
16
20
  *
@@ -51,6 +55,19 @@ export interface ConfigSAMLApiInterface {
51
55
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
52
56
  */
53
57
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
58
+ /**
59
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
60
+ * @param {Blob} identityProviderXml Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
61
+ * @param {ApiSamlConfigurationDTO} samlConfiguration
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof ConfigSAMLApiInterface
65
+ */
66
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+ /**
68
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
69
+ */
70
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
54
71
  }
55
72
  /**
56
73
  *
@@ -80,4 +97,12 @@ export declare class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAML
80
97
  * Use this method to inspect the SAML configuration. Permissions required: Edit System Configuration and Users
81
98
  */
82
99
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
100
+ /**
101
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
102
+ */
103
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
104
+ /**
105
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
106
+ */
107
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
83
108
  }
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { ApiSamlConfigurationResponseDTOFromJSON, } from '../models/index';
24
+ import { ApiSamlConfigurationDTOToJSON, ApiSamlConfigurationResponseDTOFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -117,4 +117,60 @@ export class ConfigSAMLApi extends runtime.BaseAPI {
117
117
  return yield response.value();
118
118
  });
119
119
  }
120
+ /**
121
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
122
+ */
123
+ insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides) {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ if (requestParameters['identityProviderXml'] == null) {
126
+ throw new runtime.RequiredError('identityProviderXml', 'Required parameter "identityProviderXml" was null or undefined when calling insertOrUpdateSamlConfiguration().');
127
+ }
128
+ if (requestParameters['samlConfiguration'] == null) {
129
+ throw new runtime.RequiredError('samlConfiguration', 'Required parameter "samlConfiguration" was null or undefined when calling insertOrUpdateSamlConfiguration().');
130
+ }
131
+ const queryParameters = {};
132
+ const headerParameters = {};
133
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
134
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
135
+ }
136
+ const consumes = [
137
+ { contentType: 'multipart/form-data' },
138
+ ];
139
+ // @ts-ignore: canConsumeForm may be unused
140
+ const canConsumeForm = runtime.canConsumeForm(consumes);
141
+ let formParams;
142
+ let useForm = false;
143
+ // use FormData to transmit files using content-type "multipart/form-data"
144
+ useForm = canConsumeForm;
145
+ if (useForm) {
146
+ formParams = new FormData();
147
+ }
148
+ else {
149
+ formParams = new URLSearchParams();
150
+ }
151
+ if (requestParameters['identityProviderXml'] != null) {
152
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml']);
153
+ }
154
+ if (requestParameters['samlConfiguration'] != null) {
155
+ formParams.append('samlConfiguration', new Blob([JSON.stringify(ApiSamlConfigurationDTOToJSON(requestParameters['samlConfiguration']))], { type: "application/json", }));
156
+ }
157
+ let urlPath = `/api/v2/config/saml`;
158
+ const response = yield this.request({
159
+ path: urlPath,
160
+ method: 'PUT',
161
+ headers: headerParameters,
162
+ query: queryParameters,
163
+ body: formParams,
164
+ }, initOverrides);
165
+ return new runtime.VoidApiResponse(response);
166
+ });
167
+ }
168
+ /**
169
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
170
+ */
171
+ insertOrUpdateSamlConfiguration(requestParameters, initOverrides) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ yield this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
174
+ });
175
+ }
120
176
  }
@@ -22,10 +22,10 @@ import type { ApiSecurityDataDTO } from './ApiSecurityDataDTO';
22
22
  export interface ApiComponentDetailsDTOV2 {
23
23
  /**
24
24
  *
25
- * @type {Date}
25
+ * @type {string}
26
26
  * @memberof ApiComponentDetailsDTOV2
27
27
  */
28
- catalogDate?: Date;
28
+ catalogDate?: string;
29
29
  /**
30
30
  *
31
31
  * @type {ApiComponentDTOV2}
@@ -30,7 +30,7 @@ export function ApiComponentDetailsDTOV2FromJSONTyped(json, ignoreDiscriminator)
30
30
  return json;
31
31
  }
32
32
  return {
33
- 'catalogDate': json['catalogDate'] == null ? undefined : (new Date(json['catalogDate'])),
33
+ 'catalogDate': json['catalogDate'] == null ? undefined : json['catalogDate'],
34
34
  'component': json['component'] == null ? undefined : ApiComponentDTOV2FromJSON(json['component']),
35
35
  'hygieneRating': json['hygieneRating'] == null ? undefined : json['hygieneRating'],
36
36
  'integrityRating': json['integrityRating'] == null ? undefined : json['integrityRating'],
@@ -50,7 +50,7 @@ export function ApiComponentDetailsDTOV2ToJSONTyped(value, ignoreDiscriminator =
50
50
  return value;
51
51
  }
52
52
  return {
53
- 'catalogDate': value['catalogDate'] == null ? value['catalogDate'] : value['catalogDate'].toISOString(),
53
+ 'catalogDate': value['catalogDate'],
54
54
  'component': ApiComponentDTOV2ToJSON(value['component']),
55
55
  'hygieneRating': value['hygieneRating'],
56
56
  'integrityRating': value['integrityRating'],
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sonatype Lifecycle Public REST API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.196.0-01
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 type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface InsertOrUpdateSamlConfigurationRequest
17
+ */
18
+ export interface InsertOrUpdateSamlConfigurationRequest {
19
+ /**
20
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
21
+ * @type {Blob}
22
+ * @memberof InsertOrUpdateSamlConfigurationRequest
23
+ */
24
+ identityProviderXml: Blob;
25
+ /**
26
+ *
27
+ * @type {ApiSamlConfigurationDTO}
28
+ * @memberof InsertOrUpdateSamlConfigurationRequest
29
+ */
30
+ samlConfiguration: ApiSamlConfigurationDTO;
31
+ }
32
+ /**
33
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
34
+ */
35
+ export declare function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest;
36
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
37
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest;
38
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
39
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Lifecycle Public REST API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.196.0-01
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
+ import { ApiSamlConfigurationDTOFromJSON, ApiSamlConfigurationDTOToJSON, } from './ApiSamlConfigurationDTO';
15
+ /**
16
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
17
+ */
18
+ export function instanceOfInsertOrUpdateSamlConfigurationRequest(value) {
19
+ if (!('identityProviderXml' in value) || value['identityProviderXml'] === undefined)
20
+ return false;
21
+ if (!('samlConfiguration' in value) || value['samlConfiguration'] === undefined)
22
+ return false;
23
+ return true;
24
+ }
25
+ export function InsertOrUpdateSamlConfigurationRequestFromJSON(json) {
26
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
27
+ }
28
+ export function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, ignoreDiscriminator) {
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'identityProviderXml': json['identityProviderXml'],
34
+ 'samlConfiguration': ApiSamlConfigurationDTOFromJSON(json['samlConfiguration']),
35
+ };
36
+ }
37
+ export function InsertOrUpdateSamlConfigurationRequestToJSON(json) {
38
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
39
+ }
40
+ export function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value, ignoreDiscriminator = false) {
41
+ if (value == null) {
42
+ return value;
43
+ }
44
+ return {
45
+ 'identityProviderXml': value['identityProviderXml'],
46
+ 'samlConfiguration': ApiSamlConfigurationDTOToJSON(value['samlConfiguration']),
47
+ };
48
+ }
@@ -218,6 +218,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
218
218
  export * from './GroupingByDTO';
219
219
  export * from './ImportSbomRequest';
220
220
  export * from './InnerSourceData';
221
+ export * from './InsertOrUpdateSamlConfigurationRequest';
221
222
  export * from './InstallLicenseRequest';
222
223
  export * from './KevData';
223
224
  export * from './LabelsByOwner';
@@ -220,6 +220,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
220
220
  export * from './GroupingByDTO';
221
221
  export * from './ImportSbomRequest';
222
222
  export * from './InnerSourceData';
223
+ export * from './InsertOrUpdateSamlConfigurationRequest';
223
224
  export * from './InstallLicenseRequest';
224
225
  export * from './KevData';
225
226
  export * from './LabelsByOwner';
@@ -22,10 +22,10 @@ import type { ApiSecurityDataDTO } from './ApiSecurityDataDTO';
22
22
  export interface ApiComponentDetailsDTOV2 {
23
23
  /**
24
24
  *
25
- * @type {Date}
25
+ * @type {string}
26
26
  * @memberof ApiComponentDetailsDTOV2
27
27
  */
28
- catalogDate?: Date;
28
+ catalogDate?: string;
29
29
  /**
30
30
  *
31
31
  * @type {ApiComponentDTOV2}
@@ -37,7 +37,7 @@ function ApiComponentDetailsDTOV2FromJSONTyped(json, ignoreDiscriminator) {
37
37
  return json;
38
38
  }
39
39
  return {
40
- 'catalogDate': json['catalogDate'] == null ? undefined : (new Date(json['catalogDate'])),
40
+ 'catalogDate': json['catalogDate'] == null ? undefined : json['catalogDate'],
41
41
  'component': json['component'] == null ? undefined : (0, ApiComponentDTOV2_1.ApiComponentDTOV2FromJSON)(json['component']),
42
42
  'hygieneRating': json['hygieneRating'] == null ? undefined : json['hygieneRating'],
43
43
  'integrityRating': json['integrityRating'] == null ? undefined : json['integrityRating'],
@@ -57,7 +57,7 @@ function ApiComponentDetailsDTOV2ToJSONTyped(value, ignoreDiscriminator = false)
57
57
  return value;
58
58
  }
59
59
  return {
60
- 'catalogDate': value['catalogDate'] == null ? value['catalogDate'] : value['catalogDate'].toISOString(),
60
+ 'catalogDate': value['catalogDate'],
61
61
  'component': (0, ApiComponentDTOV2_1.ApiComponentDTOV2ToJSON)(value['component']),
62
62
  'hygieneRating': value['hygieneRating'],
63
63
  'integrityRating': value['integrityRating'],
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sonatype Lifecycle Public REST API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.196.0-01
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 type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface InsertOrUpdateSamlConfigurationRequest
17
+ */
18
+ export interface InsertOrUpdateSamlConfigurationRequest {
19
+ /**
20
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
21
+ * @type {Blob}
22
+ * @memberof InsertOrUpdateSamlConfigurationRequest
23
+ */
24
+ identityProviderXml: Blob;
25
+ /**
26
+ *
27
+ * @type {ApiSamlConfigurationDTO}
28
+ * @memberof InsertOrUpdateSamlConfigurationRequest
29
+ */
30
+ samlConfiguration: ApiSamlConfigurationDTO;
31
+ }
32
+ /**
33
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
34
+ */
35
+ export declare function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest;
36
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
37
+ export declare function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest;
38
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest;
39
+ export declare function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Sonatype Lifecycle Public REST API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 1.196.0-01
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfInsertOrUpdateSamlConfigurationRequest = instanceOfInsertOrUpdateSamlConfigurationRequest;
17
+ exports.InsertOrUpdateSamlConfigurationRequestFromJSON = InsertOrUpdateSamlConfigurationRequestFromJSON;
18
+ exports.InsertOrUpdateSamlConfigurationRequestFromJSONTyped = InsertOrUpdateSamlConfigurationRequestFromJSONTyped;
19
+ exports.InsertOrUpdateSamlConfigurationRequestToJSON = InsertOrUpdateSamlConfigurationRequestToJSON;
20
+ exports.InsertOrUpdateSamlConfigurationRequestToJSONTyped = InsertOrUpdateSamlConfigurationRequestToJSONTyped;
21
+ const ApiSamlConfigurationDTO_1 = require("./ApiSamlConfigurationDTO");
22
+ /**
23
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
24
+ */
25
+ function instanceOfInsertOrUpdateSamlConfigurationRequest(value) {
26
+ if (!('identityProviderXml' in value) || value['identityProviderXml'] === undefined)
27
+ return false;
28
+ if (!('samlConfiguration' in value) || value['samlConfiguration'] === undefined)
29
+ return false;
30
+ return true;
31
+ }
32
+ function InsertOrUpdateSamlConfigurationRequestFromJSON(json) {
33
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
34
+ }
35
+ function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'identityProviderXml': json['identityProviderXml'],
41
+ 'samlConfiguration': (0, ApiSamlConfigurationDTO_1.ApiSamlConfigurationDTOFromJSON)(json['samlConfiguration']),
42
+ };
43
+ }
44
+ function InsertOrUpdateSamlConfigurationRequestToJSON(json) {
45
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
46
+ }
47
+ function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value, ignoreDiscriminator = false) {
48
+ if (value == null) {
49
+ return value;
50
+ }
51
+ return {
52
+ 'identityProviderXml': value['identityProviderXml'],
53
+ 'samlConfiguration': (0, ApiSamlConfigurationDTO_1.ApiSamlConfigurationDTOToJSON)(value['samlConfiguration']),
54
+ };
55
+ }
@@ -218,6 +218,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
218
218
  export * from './GroupingByDTO';
219
219
  export * from './ImportSbomRequest';
220
220
  export * from './InnerSourceData';
221
+ export * from './InsertOrUpdateSamlConfigurationRequest';
221
222
  export * from './InstallLicenseRequest';
222
223
  export * from './KevData';
223
224
  export * from './LabelsByOwner';
@@ -236,6 +236,7 @@ __exportStar(require("./GetSuggestedRemediationForComponent200Response"), export
236
236
  __exportStar(require("./GroupingByDTO"), exports);
237
237
  __exportStar(require("./ImportSbomRequest"), exports);
238
238
  __exportStar(require("./InnerSourceData"), exports);
239
+ __exportStar(require("./InsertOrUpdateSamlConfigurationRequest"), exports);
239
240
  __exportStar(require("./InstallLicenseRequest"), exports);
240
241
  __exportStar(require("./KevData"), exports);
241
242
  __exportStar(require("./LabelsByOwner"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonatype/nexus-iq-api-client",
3
- "version": "0.196.0",
3
+ "version": "0.196.2",
4
4
  "description": "OpenAPI client for @sonatype/nexus-iq-api-client",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -15,13 +15,21 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ ApiSamlConfigurationDTO,
18
19
  ApiSamlConfigurationResponseDTO,
19
20
  } from '../models/index';
20
21
  import {
22
+ ApiSamlConfigurationDTOFromJSON,
23
+ ApiSamlConfigurationDTOToJSON,
21
24
  ApiSamlConfigurationResponseDTOFromJSON,
22
25
  ApiSamlConfigurationResponseDTOToJSON,
23
26
  } from '../models/index';
24
27
 
28
+ export interface ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest {
29
+ identityProviderXml: Blob;
30
+ samlConfiguration: ApiSamlConfigurationDTO;
31
+ }
32
+
25
33
  /**
26
34
  * ConfigSAMLApi - interface
27
35
  *
@@ -68,6 +76,21 @@ export interface ConfigSAMLApiInterface {
68
76
  */
69
77
  getSamlConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiSamlConfigurationResponseDTO>;
70
78
 
79
+ /**
80
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
81
+ * @param {Blob} identityProviderXml Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
82
+ * @param {ApiSamlConfigurationDTO} samlConfiguration
83
+ * @param {*} [options] Override http request option.
84
+ * @throws {RequiredError}
85
+ * @memberof ConfigSAMLApiInterface
86
+ */
87
+ insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
88
+
89
+ /**
90
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
91
+ */
92
+ insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
93
+
71
94
  }
72
95
 
73
96
  /**
@@ -174,4 +197,74 @@ export class ConfigSAMLApi extends runtime.BaseAPI implements ConfigSAMLApiInter
174
197
  return await response.value();
175
198
  }
176
199
 
200
+ /**
201
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
202
+ */
203
+ async insertOrUpdateSamlConfigurationRaw(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
204
+ if (requestParameters['identityProviderXml'] == null) {
205
+ throw new runtime.RequiredError(
206
+ 'identityProviderXml',
207
+ 'Required parameter "identityProviderXml" was null or undefined when calling insertOrUpdateSamlConfiguration().'
208
+ );
209
+ }
210
+
211
+ if (requestParameters['samlConfiguration'] == null) {
212
+ throw new runtime.RequiredError(
213
+ 'samlConfiguration',
214
+ 'Required parameter "samlConfiguration" was null or undefined when calling insertOrUpdateSamlConfiguration().'
215
+ );
216
+ }
217
+
218
+ const queryParameters: any = {};
219
+
220
+ const headerParameters: runtime.HTTPHeaders = {};
221
+
222
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
223
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
224
+ }
225
+ const consumes: runtime.Consume[] = [
226
+ { contentType: 'multipart/form-data' },
227
+ ];
228
+ // @ts-ignore: canConsumeForm may be unused
229
+ const canConsumeForm = runtime.canConsumeForm(consumes);
230
+
231
+ let formParams: { append(param: string, value: any): any };
232
+ let useForm = false;
233
+ // use FormData to transmit files using content-type "multipart/form-data"
234
+ useForm = canConsumeForm;
235
+ if (useForm) {
236
+ formParams = new FormData();
237
+ } else {
238
+ formParams = new URLSearchParams();
239
+ }
240
+
241
+ if (requestParameters['identityProviderXml'] != null) {
242
+ formParams.append('identityProviderXml', requestParameters['identityProviderXml'] as any);
243
+ }
244
+
245
+ if (requestParameters['samlConfiguration'] != null) {
246
+ formParams.append('samlConfiguration', new Blob([JSON.stringify(ApiSamlConfigurationDTOToJSON(requestParameters['samlConfiguration']))], { type: "application/json", }));
247
+ }
248
+
249
+
250
+ let urlPath = `/api/v2/config/saml`;
251
+
252
+ const response = await this.request({
253
+ path: urlPath,
254
+ method: 'PUT',
255
+ headers: headerParameters,
256
+ query: queryParameters,
257
+ body: formParams,
258
+ }, initOverrides);
259
+
260
+ return new runtime.VoidApiResponse(response);
261
+ }
262
+
263
+ /**
264
+ * Use this method to enable SSO using SAML. This request uses the content type multipart/form-data to transmit the configuration to IQ Server. Permissions required: Edit System Configuration and Users
265
+ */
266
+ async insertOrUpdateSamlConfiguration(requestParameters: ConfigSAMLApiInsertOrUpdateSamlConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
267
+ await this.insertOrUpdateSamlConfigurationRaw(requestParameters, initOverrides);
268
+ }
269
+
177
270
  }
@@ -57,10 +57,10 @@ import {
57
57
  export interface ApiComponentDetailsDTOV2 {
58
58
  /**
59
59
  *
60
- * @type {Date}
60
+ * @type {string}
61
61
  * @memberof ApiComponentDetailsDTOV2
62
62
  */
63
- catalogDate?: Date;
63
+ catalogDate?: string;
64
64
  /**
65
65
  *
66
66
  * @type {ApiComponentDTOV2}
@@ -134,7 +134,7 @@ export function ApiComponentDetailsDTOV2FromJSONTyped(json: any, ignoreDiscrimin
134
134
  }
135
135
  return {
136
136
 
137
- 'catalogDate': json['catalogDate'] == null ? undefined : (new Date(json['catalogDate'])),
137
+ 'catalogDate': json['catalogDate'] == null ? undefined : json['catalogDate'],
138
138
  'component': json['component'] == null ? undefined : ApiComponentDTOV2FromJSON(json['component']),
139
139
  'hygieneRating': json['hygieneRating'] == null ? undefined : json['hygieneRating'],
140
140
  'integrityRating': json['integrityRating'] == null ? undefined : json['integrityRating'],
@@ -158,7 +158,7 @@ export function ApiComponentDetailsDTOV2ToJSONTyped(value?: ApiComponentDetailsD
158
158
 
159
159
  return {
160
160
 
161
- 'catalogDate': value['catalogDate'] == null ? value['catalogDate'] : value['catalogDate'].toISOString(),
161
+ 'catalogDate': value['catalogDate'],
162
162
  'component': ApiComponentDTOV2ToJSON(value['component']),
163
163
  'hygieneRating': value['hygieneRating'],
164
164
  'integrityRating': value['integrityRating'],
@@ -0,0 +1,83 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Sonatype Lifecycle Public REST API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 1.196.0-01
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
+ import type { ApiSamlConfigurationDTO } from './ApiSamlConfigurationDTO';
17
+ import {
18
+ ApiSamlConfigurationDTOFromJSON,
19
+ ApiSamlConfigurationDTOFromJSONTyped,
20
+ ApiSamlConfigurationDTOToJSON,
21
+ ApiSamlConfigurationDTOToJSONTyped,
22
+ } from './ApiSamlConfigurationDTO';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface InsertOrUpdateSamlConfigurationRequest
28
+ */
29
+ export interface InsertOrUpdateSamlConfigurationRequest {
30
+ /**
31
+ * Enter the SAML metadata XML of your IdP. Refer to the IdP documentation to obtain this metadata.
32
+ * @type {Blob}
33
+ * @memberof InsertOrUpdateSamlConfigurationRequest
34
+ */
35
+ identityProviderXml: Blob;
36
+ /**
37
+ *
38
+ * @type {ApiSamlConfigurationDTO}
39
+ * @memberof InsertOrUpdateSamlConfigurationRequest
40
+ */
41
+ samlConfiguration: ApiSamlConfigurationDTO;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the InsertOrUpdateSamlConfigurationRequest interface.
46
+ */
47
+ export function instanceOfInsertOrUpdateSamlConfigurationRequest(value: object): value is InsertOrUpdateSamlConfigurationRequest {
48
+ if (!('identityProviderXml' in value) || value['identityProviderXml'] === undefined) return false;
49
+ if (!('samlConfiguration' in value) || value['samlConfiguration'] === undefined) return false;
50
+ return true;
51
+ }
52
+
53
+ export function InsertOrUpdateSamlConfigurationRequestFromJSON(json: any): InsertOrUpdateSamlConfigurationRequest {
54
+ return InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function InsertOrUpdateSamlConfigurationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InsertOrUpdateSamlConfigurationRequest {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'identityProviderXml': json['identityProviderXml'],
64
+ 'samlConfiguration': ApiSamlConfigurationDTOFromJSON(json['samlConfiguration']),
65
+ };
66
+ }
67
+
68
+ export function InsertOrUpdateSamlConfigurationRequestToJSON(json: any): InsertOrUpdateSamlConfigurationRequest {
69
+ return InsertOrUpdateSamlConfigurationRequestToJSONTyped(json, false);
70
+ }
71
+
72
+ export function InsertOrUpdateSamlConfigurationRequestToJSONTyped(value?: InsertOrUpdateSamlConfigurationRequest | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'identityProviderXml': value['identityProviderXml'],
80
+ 'samlConfiguration': ApiSamlConfigurationDTOToJSON(value['samlConfiguration']),
81
+ };
82
+ }
83
+
@@ -220,6 +220,7 @@ export * from './GetSuggestedRemediationForComponent200Response';
220
220
  export * from './GroupingByDTO';
221
221
  export * from './ImportSbomRequest';
222
222
  export * from './InnerSourceData';
223
+ export * from './InsertOrUpdateSamlConfigurationRequest';
223
224
  export * from './InstallLicenseRequest';
224
225
  export * from './KevData';
225
226
  export * from './LabelsByOwner';