@utcp/http 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4249,6 +4249,7 @@ var OpenApiConverter = class {
|
|
|
4249
4249
|
spec_url;
|
|
4250
4250
|
base_url;
|
|
4251
4251
|
auth_tools;
|
|
4252
|
+
headers;
|
|
4252
4253
|
placeholder_counter = 0;
|
|
4253
4254
|
call_template_name;
|
|
4254
4255
|
/**
|
|
@@ -4266,6 +4267,7 @@ var OpenApiConverter = class {
|
|
|
4266
4267
|
this.spec_url = options?.specUrl;
|
|
4267
4268
|
this.base_url = options?.baseUrl;
|
|
4268
4269
|
this.auth_tools = options?.authTools;
|
|
4270
|
+
this.headers = options?.headers;
|
|
4269
4271
|
this.placeholder_counter = 0;
|
|
4270
4272
|
let callTemplateName = options?.callTemplateName;
|
|
4271
4273
|
if (!callTemplateName) {
|
|
@@ -4404,6 +4406,7 @@ var OpenApiConverter = class {
|
|
|
4404
4406
|
url: fullUrl,
|
|
4405
4407
|
body_field: bodyField ?? void 0,
|
|
4406
4408
|
header_fields: headerFields.length > 0 ? headerFields : void 0,
|
|
4409
|
+
headers: this.headers,
|
|
4407
4410
|
auth,
|
|
4408
4411
|
content_type: "application/json",
|
|
4409
4412
|
timeout: 30
|
|
@@ -4538,6 +4541,9 @@ var OpenApiConverter = class {
|
|
|
4538
4541
|
* @returns An Auth object or undefined if no authentication is specified.
|
|
4539
4542
|
*/
|
|
4540
4543
|
_extractAuth(operation) {
|
|
4544
|
+
if (this.auth_tools === null) {
|
|
4545
|
+
return void 0;
|
|
4546
|
+
}
|
|
4541
4547
|
let securityRequirements = operation.security || [];
|
|
4542
4548
|
if (!securityRequirements.length) {
|
|
4543
4549
|
securityRequirements = this.spec.security || [];
|
|
@@ -4751,7 +4757,9 @@ var HttpCommunicationProtocol = class {
|
|
|
4751
4757
|
this._logInfo(`Assuming OpenAPI spec from '${httpCallTemplate.name}'. Converting to UTCP manual.`);
|
|
4752
4758
|
const converter = new OpenApiConverter(responseData, {
|
|
4753
4759
|
specUrl: httpCallTemplate.url,
|
|
4754
|
-
callTemplateName: httpCallTemplate.name
|
|
4760
|
+
callTemplateName: httpCallTemplate.name,
|
|
4761
|
+
authTools: httpCallTemplate.auth_tools,
|
|
4762
|
+
headers: httpCallTemplate.headers
|
|
4755
4763
|
});
|
|
4756
4764
|
utcpManual = converter.convert();
|
|
4757
4765
|
} else {
|