📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP →

@samchon/openapi

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samchon/openapi - npm Package Compare versions

Comparing version

to
2.0.0-dev.20241201-2

@@ -37,4 +37,13 @@ import { OpenApi } from "./OpenApi";

interface IApplicationProps<Model extends ILlmSchema.Model> {
/**
* Target LLM model.
*/
model: Model;
/**
* OpenAPI document to convert.
*/
document: OpenApi.IDocument;
/**
* Options for the LLM function calling schema conversion.
*/
options?: Partial<IHttpLlmApplication.IOptions<Model>>;

@@ -41,0 +50,0 @@ }

@@ -16,4 +16,4 @@ "use strict";

var HttpMigration_1 = require("./HttpMigration");
var HttpLlmConverter_1 = require("./converters/HttpLlmConverter");
var LlmSchemaConverter_1 = require("./converters/LlmSchemaConverter");
var HttpLlmApplicationComposer_1 = require("./composers/HttpLlmApplicationComposer");
var LlmSchemaComposer_1 = require("./composers/LlmSchemaComposer");
var HttpLlmFunctionFetcher_1 = require("./http/HttpLlmFunctionFetcher");

@@ -74,6 +74,6 @@ var LlmDataMerger_1 = require("./utils/LlmDataMerger");

var migrate = HttpMigration_1.HttpMigration.application(props.document);
return HttpLlmConverter_1.HttpLlmConverter.application({
return HttpLlmApplicationComposer_1.HttpLlmComposer.application({
migrate: migrate,
model: props.model,
options: __assign(__assign({}, LlmSchemaConverter_1.LlmSchemaConverter.defaultConfig(props.model)), { separate: (_b = (_a = props.options) === null || _a === void 0 ? void 0 : _a.separate) !== null && _b !== void 0 ? _b : null }),
options: __assign(__assign({}, LlmSchemaComposer_1.LlmSchemaComposer.defaultConfig(props.model)), { separate: (_b = (_a = props.options) === null || _a === void 0 ? void 0 : _a.separate) !== null && _b !== void 0 ? _b : null }),
});

@@ -80,0 +80,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpMigration = void 0;
var MigrateConverter_1 = require("./converters/MigrateConverter");
var MigrateConverter_1 = require("./composers/migrate/MigrateConverter");
var HttpMigrateRouteFetcher_1 = require("./http/HttpMigrateRouteFetcher");

@@ -6,0 +6,0 @@ /**

@@ -7,7 +7,7 @@ "use strict";

var SwaggerV2_1 = require("./SwaggerV2");
var OpenApiV3Converter_1 = require("./converters/OpenApiV3Converter");
var OpenApiV3Downgrader_1 = require("./converters/OpenApiV3Downgrader");
var OpenApiV3_1Converter_1 = require("./converters/OpenApiV3_1Converter");
var SwaggerV2Converter_1 = require("./converters/SwaggerV2Converter");
var OpenApiV3Upgrader_1 = require("./converters/OpenApiV3Upgrader");
var OpenApiV3_1Emender_1 = require("./converters/OpenApiV3_1Emender");
var SwaggerV2Downgrader_1 = require("./converters/SwaggerV2Downgrader");
var SwaggerV2Upgrader_1 = require("./converters/SwaggerV2Upgrader");
/**

@@ -57,7 +57,7 @@ * Emended OpenAPI v3.1 definition used by `typia` and `nestia`.

if (OpenApiV3_1_1.OpenApiV3_1.is(input))
return OpenApiV3_1Converter_1.OpenApiV3_1Converter.convert(input);
return OpenApiV3_1Emender_1.OpenApiV3_1Emender.convert(input);
else if (OpenApiV3_2.OpenApiV3.is(input))
return OpenApiV3Converter_1.OpenApiV3Converter.convert(input);
return OpenApiV3Upgrader_1.OpenApiV3Upgrader.convert(input);
else if (SwaggerV2_1.SwaggerV2.is(input))
return SwaggerV2Converter_1.SwaggerV2Converter.convert(input);
return SwaggerV2Upgrader_1.SwaggerV2Upgrader.convert(input);
throw new TypeError("Unrecognized Swagger/OpenAPI version.");

@@ -64,0 +64,0 @@ }

{
"name": "@samchon/openapi",
"version": "2.0.0-dev.20241130-2",
"version": "2.0.0-dev.20241201-2",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -0,0 +0,0 @@ import { OpenApi } from "../OpenApi";

@@ -0,0 +0,0 @@ import { OpenApi } from "../OpenApi";

import { HttpMigration } from "./HttpMigration";
import { OpenApi } from "./OpenApi";
import { HttpLlmConverter } from "./converters/HttpLlmConverter";
import { LlmSchemaConverter } from "./converters/LlmSchemaConverter";
import { HttpLlmComposer } from "./composers/HttpLlmApplicationComposer";
import { LlmSchemaComposer } from "./composers/LlmSchemaComposer";
import { HttpLlmFunctionFetcher } from "./http/HttpLlmFunctionFetcher";

@@ -47,4 +47,15 @@ import { IHttpConnection } from "./structures/IHttpConnection";

export interface IApplicationProps<Model extends ILlmSchema.Model> {
/**
* Target LLM model.
*/
model: Model;
/**
* OpenAPI document to convert.
*/
document: OpenApi.IDocument;
/**
* Options for the LLM function calling schema conversion.
*/
options?: Partial<IHttpLlmApplication.IOptions<Model>>;

@@ -85,7 +96,7 @@ }

);
return HttpLlmConverter.application<Model>({
return HttpLlmComposer.application<Model>({
migrate,
model: props.model,
options: {
...LlmSchemaConverter.defaultConfig(props.model),
...LlmSchemaComposer.defaultConfig(props.model),
separate: props.options?.separate ?? null,

@@ -92,0 +103,0 @@ },

import { OpenApi } from "./OpenApi";
import { MigrateConverter } from "./converters/MigrateConverter";
import { MigrateConverter } from "./composers/migrate/MigrateConverter";
import { HttpMigrateRouteFetcher } from "./http/HttpMigrateRouteFetcher";

@@ -4,0 +4,0 @@ import { IHttpConnection } from "./structures/IHttpConnection";

import { OpenApiV3 } from "./OpenApiV3";
import { OpenApiV3_1 } from "./OpenApiV3_1";
import { SwaggerV2 } from "./SwaggerV2";
import { OpenApiV3Converter } from "./converters/OpenApiV3Converter";
import { OpenApiV3Downgrader } from "./converters/OpenApiV3Downgrader";
import { OpenApiV3_1Converter } from "./converters/OpenApiV3_1Converter";
import { SwaggerV2Converter } from "./converters/SwaggerV2Converter";
import { OpenApiV3Upgrader } from "./converters/OpenApiV3Upgrader";
import { OpenApiV3_1Emender } from "./converters/OpenApiV3_1Emender";
import { SwaggerV2Downgrader } from "./converters/SwaggerV2Downgrader";
import { SwaggerV2Upgrader } from "./converters/SwaggerV2Upgrader";

@@ -72,7 +72,7 @@ /**

if (OpenApiV3_1.is(input))
return OpenApiV3_1Converter.convert(input) as IDocument;
return OpenApiV3_1Emender.convert(input) as IDocument;
else if (OpenApiV3.is(input))
return OpenApiV3Converter.convert(input) as IDocument;
return OpenApiV3Upgrader.convert(input) as IDocument;
else if (SwaggerV2.is(input))
return SwaggerV2Converter.convert(input) as IDocument;
return SwaggerV2Upgrader.convert(input) as IDocument;
throw new TypeError("Unrecognized Swagger/OpenAPI version.");

@@ -79,0 +79,0 @@ }

@@ -0,0 +0,0 @@ import { ILlmSchemaV3_1 } from "./ILlmSchemaV3_1";

@@ -0,0 +0,0 @@ import { ILlmSchemaV3_1 } from "./ILlmSchemaV3_1";

@@ -0,0 +0,0 @@ import { IChatGptSchema } from "../structures/IChatGptSchema";

@@ -0,0 +0,0 @@ import { IGeminiSchema } from "../structures/IGeminiSchema";

@@ -0,0 +0,0 @@ import { OpenApi } from "../../OpenApi";

@@ -0,0 +0,0 @@ import { ILlmSchemaV3_1 } from "../structures/ILlmSchemaV3_1";

@@ -0,0 +0,0 @@ import { ILlmSchemaV3 } from "../structures/ILlmSchemaV3";

@@ -0,0 +0,0 @@ import { OpenApi } from "../OpenApi";

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet