@utcp/http 1.0.6 → 1.0.8

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.d.cts CHANGED
@@ -312,6 +312,9 @@ declare class SseCommunicationProtocol implements CommunicationProtocol {
312
312
  close(): Promise<void>;
313
313
  }
314
314
 
315
+ /**
316
+ * Options for the OpenAPI converter.
317
+ */
315
318
  interface OpenApiConverterOptions {
316
319
  specUrl?: string;
317
320
  callTemplateName?: string;
@@ -421,11 +424,6 @@ declare class OpenApiConverter {
421
424
  */
422
425
  private _createAuthFromScheme;
423
426
  }
424
- declare global {
425
- interface String {
426
- lstrip(chars: string): string;
427
- }
428
- }
429
427
 
430
428
  /**
431
429
  * Registers all HTTP-based protocol CallTemplate serializers
@@ -434,4 +432,4 @@ declare global {
434
432
  */
435
433
  declare function register(override?: boolean): void;
436
434
 
437
- export { type HttpCallTemplate, HttpCallTemplateSchema, HttpCallTemplateSerializer, HttpCommunicationProtocol, OpenApiConverter, type SseCallTemplate, SseCallTemplateSchema, SseCallTemplateSerializer, SseCommunicationProtocol, type StreamableHttpCallTemplate, StreamableHttpCallTemplateSchema, StreamableHttpCallTemplateSerializer, StreamableHttpCommunicationProtocol, register };
435
+ export { type HttpCallTemplate, HttpCallTemplateSchema, HttpCallTemplateSerializer, HttpCommunicationProtocol, OpenApiConverter, type OpenApiConverterOptions, type SseCallTemplate, SseCallTemplateSchema, SseCallTemplateSerializer, SseCommunicationProtocol, type StreamableHttpCallTemplate, StreamableHttpCallTemplateSchema, StreamableHttpCallTemplateSerializer, StreamableHttpCommunicationProtocol, register };
package/dist/index.d.ts CHANGED
@@ -312,6 +312,9 @@ declare class SseCommunicationProtocol implements CommunicationProtocol {
312
312
  close(): Promise<void>;
313
313
  }
314
314
 
315
+ /**
316
+ * Options for the OpenAPI converter.
317
+ */
315
318
  interface OpenApiConverterOptions {
316
319
  specUrl?: string;
317
320
  callTemplateName?: string;
@@ -421,11 +424,6 @@ declare class OpenApiConverter {
421
424
  */
422
425
  private _createAuthFromScheme;
423
426
  }
424
- declare global {
425
- interface String {
426
- lstrip(chars: string): string;
427
- }
428
- }
429
427
 
430
428
  /**
431
429
  * Registers all HTTP-based protocol CallTemplate serializers
@@ -434,4 +432,4 @@ declare global {
434
432
  */
435
433
  declare function register(override?: boolean): void;
436
434
 
437
- export { type HttpCallTemplate, HttpCallTemplateSchema, HttpCallTemplateSerializer, HttpCommunicationProtocol, OpenApiConverter, type SseCallTemplate, SseCallTemplateSchema, SseCallTemplateSerializer, SseCommunicationProtocol, type StreamableHttpCallTemplate, StreamableHttpCallTemplateSchema, StreamableHttpCallTemplateSerializer, StreamableHttpCommunicationProtocol, register };
435
+ export { type HttpCallTemplate, HttpCallTemplateSchema, HttpCallTemplateSerializer, HttpCommunicationProtocol, OpenApiConverter, type OpenApiConverterOptions, type SseCallTemplate, SseCallTemplateSchema, SseCallTemplateSerializer, SseCommunicationProtocol, type StreamableHttpCallTemplate, StreamableHttpCallTemplateSchema, StreamableHttpCallTemplateSerializer, StreamableHttpCommunicationProtocol, register };
package/dist/index.js CHANGED
@@ -4345,7 +4345,7 @@ var OpenApiConverter = class {
4345
4345
  const { inputs, headerFields, bodyField } = this._extractInputs(path, operation);
4346
4346
  const outputs = this._extractOutputs(operation);
4347
4347
  const auth = this._extractAuth(operation);
4348
- const fullUrl = `${baseUrl.replace(/\/$/, "")}/${path.lstrip("/")}`;
4348
+ const fullUrl = `${baseUrl.replace(/\/$/, "")}/${path.replace(/^\/+/, "")}`;
4349
4349
  const callTemplate = {
4350
4350
  name: this.call_template_name,
4351
4351
  call_template_type: "http",
@@ -4640,15 +4640,6 @@ var OpenApiConverter = class {
4640
4640
  return void 0;
4641
4641
  }
4642
4642
  };
4643
- if (!String.prototype.lstrip) {
4644
- String.prototype.lstrip = function(chars) {
4645
- let result = this;
4646
- while (result.startsWith(chars)) {
4647
- result = result.substring(chars.length);
4648
- }
4649
- return result;
4650
- };
4651
- }
4652
4643
 
4653
4644
  // src/http_communication_protocol.ts
4654
4645
  var HttpCommunicationProtocol = class {