Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nestia/sdk

Package Overview
Dependencies
Maintainers
1
Versions
480
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestia/sdk - npm Package Compare versions

Comparing version 3.17.0 to 4.0.0-dev.20241010

142

lib/analyses/ExceptionAnalyzer.js
"use strict";
// import path from "path";
// import ts from "typescript";
// import { MetadataCollection } from "typia/lib/factories/MetadataCollection";
// import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
// import { Metadata } from "typia/lib/schemas/metadata/Metadata";
// import { INestiaProject } from "../structures/INestiaProject";
// import { IReflectController } from "../structures/IReflectController";
// import { IReflectHttpOperation } from "../structures/IReflectHttpOperation";
// import { ITypeTuple } from "../structures/ITypeTuple";
// import { ITypedHttpRoute } from "../structures/ITypedHttpRoute";
// import { GenericAnalyzer } from "./GenericAnalyzer";
// import { ImportAnalyzer } from "./ImportAnalyzer";
// export namespace ExceptionAnalyzer {
// export const analyze =
// (project: INestiaProject) =>
// (props: {
// generics: GenericAnalyzer.Dictionary;
// imports: ImportAnalyzer.Dictionary;
// controller: IReflectController;
// operation: IReflectHttpOperation;
// declaration: ts.MethodDeclaration;
// }): Record<
// number | "2XX" | "3XX" | "4XX" | "5XX",
// ITypedHttpRoute.IOutput
// > => {
// const output: Record<
// number | "2XX" | "3XX" | "4XX" | "5XX",
// ITypedHttpRoute.IOutput
// > = {} as any;
// for (const decorator of props.declaration.modifiers ?? [])
// if (ts.isDecorator(decorator))
// analyzeTyped(project)({
// ...props,
// output,
// decorator,
// });
// return output;
// };
// const analyzeTyped =
// (project: INestiaProject) =>
// (props: {
// generics: GenericAnalyzer.Dictionary;
// imports: ImportAnalyzer.Dictionary;
// controller: IReflectController;
// operation: IReflectHttpOperation;
// output: Record<
// number | "2XX" | "3XX" | "4XX" | "5XX",
// ITypedHttpRoute.IOutput
// >;
// decorator: ts.Decorator;
// }): boolean => {
// // CHECK DECORATOR
// if (!ts.isCallExpression(props.decorator.expression)) return false;
// else if ((props.decorator.expression.typeArguments ?? []).length !== 1)
// return false;
// // CHECK SIGNATURE
// const signature: ts.Signature | undefined =
// project.checker.getResolvedSignature(props.decorator.expression);
// if (!signature || !signature.declaration) return false;
// else if (
// path
// .resolve(signature.declaration.getSourceFile().fileName)
// .indexOf(TYPED_EXCEPTION_PATH) === -1
// )
// return false;
// // GET TYPE INFO
// const status: string | null = getStatus(project.checker)(
// props.decorator.expression.arguments[0] ?? null,
// );
// if (status === null) return false;
// const node: ts.TypeNode = props.decorator.expression.typeArguments![0];
// const type: ts.Type = project.checker.getTypeFromTypeNode(node);
// if (type.isTypeParameter()) {
// project.errors.push({
// file: props.controller.file,
// controller: props.controller.name,
// function: props.operation.name,
// message: "TypedException() without generic argument specification.",
// });
// return false;
// }
// const tuple: ITypeTuple | null = ImportAnalyzer.analyze(project.checker)({
// generics: props.generics,
// imports: props.imports,
// type,
// });
// if (tuple === null) {
// project.errors.push({
// file: props.controller.file,
// controller: props.controller.name,
// function: props.operation.name,
// message: `TypeException() with unknown type on ${status} status.`,
// });
// return false;
// }
// // DO ASSIGN
// const matched: IReflectHttpOperation.IException[] = Object.entries(
// props.operation.exceptions,
// )
// .filter(([key]) => status === key)
// .map(([_key, value]) => value);
// for (const m of matched)
// props.output[m.status] = {
// type: tuple.type,
// typeName: tuple.typeName,
// contentType: "application/json",
// description: m.description,
// };
// return true;
// };
// const getStatus =
// (checker: ts.TypeChecker) =>
// (expression: ts.Expression | null): string | null => {
// if (expression === null) return null;
// const type: ts.Type = checker.getTypeAtLocation(expression);
// const result = MetadataFactory.analyze(checker)({
// escape: true,
// constant: true,
// absorb: true,
// })(new MetadataCollection())(type);
// if (false === result.success) return null;
// const meta: Metadata = result.data;
// if (meta.constants.length === 1)
// return meta.constants[0].values[0].value.toString();
// else if (meta.escaped && meta.escaped.returns.constants.length === 1)
// return meta.escaped.returns.constants[0].values[0].value.toString();
// else if (ts.isStringLiteral(expression)) return expression.text;
// else if (ts.isNumericLiteral(expression)) {
// const value: number = Number(expression.text.split("_").join(""));
// if (false === isNaN(value)) return value.toString();
// }
// return null;
// };
// }
// const TYPED_EXCEPTION_PATH = path.join(
// "node_modules",
// "@nestia",
// "core",
// "lib",
// "decorators",
// "TypedException.d.ts",
// );
//# sourceMappingURL=ExceptionAnalyzer.js.map

16

lib/analyses/TypedHttpRouteAnalyzer.js

@@ -36,8 +36,12 @@ "use strict";

const metadata = Metadata_1.Metadata.from(next.metadata, props.dictionary);
const metaErrors = MetadataFactory_1.MetadataFactory.validate()({
escape,
constant: true,
absorb: true,
validate: next.validate,
})(next.validate)(metadata);
const metaErrors = MetadataFactory_1.MetadataFactory.validate({
options: {
escape,
constant: true,
absorb: true,
validate: next.validate, // @todo -> CHECK IN TYPIA
},
functor: next.validate, // @todo -> CHECK IN TYPIA
metadata,
});
if (metaErrors.length)

@@ -44,0 +48,0 @@ errors.push({

@@ -39,2 +39,4 @@ "use strict";

exports.NestiaConfigLoader = void 0;
const __$assertGuard = __importStar(require("typia/lib/internal/$assertGuard.js"));
const __$accessExpressionAsString = __importStar(require("typia/lib/internal/$accessExpressionAsString.js"));
const NoTransformConfigurationError_1 = require("@nestia/core/lib/decorators/NoTransformConfigurationError");

@@ -64,19 +66,22 @@ const fs_1 = __importDefault(require("fs"));

const plugins = [
...(() => { const $guard = typia_1.default
.assert.guard; const $io0 = input => true; const $ao0 = (input, _path, _exceptionable = true) => true; const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem)); let _errorFactory; return (input, errorFactory) => {
...(() => { const $io0 = input => true; const $ao0 = (input, _path, _exceptionable = true) => true; const __is = input => Array.isArray(input) && input.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io0(elem)); let _errorFactory; return (input, errorFactory) => {
if (false === __is(input)) {
_errorFactory = errorFactory;
((input, _path, _exceptionable = true) => (Array.isArray(input) || $guard(true, {
((input, _path, _exceptionable = true) => (Array.isArray(input) || __$assertGuard.$assertGuard(true, {
method: "typia\r\n .assert",
path: _path + "",
expected: "Array<object>",
value: input
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $guard(true, {
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __$assertGuard.$assertGuard(true, {
method: "typia\r\n .assert",
path: _path + "[" + _index2 + "]",
expected: "object",
value: elem
}, _errorFactory)) && $ao0(elem, _path + "[" + _index2 + "]", true) || $guard(true, {
}, _errorFactory)) && $ao0(elem, _path + "[" + _index2 + "]", true) || __$assertGuard.$assertGuard(true, {
method: "typia\r\n .assert",
path: _path + "[" + _index2 + "]",
expected: "object",
value: elem
}, _errorFactory)) || $guard(true, {
}, _errorFactory)) || __$assertGuard.$assertGuard(true, {
method: "typia\r\n .assert",
path: _path + "",

@@ -106,3 +111,3 @@ expected: "Array<object>",

try {
return (() => { const $guard = typia_1.default.assert.guard; const $join = typia_1.default.assert.join; const $io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && $io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json); const $io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem)); const $io2 = input => "string" === typeof input.output && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && $io20(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose); const $io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io5(input.license)) && (undefined === input.version || "string" === typeof input.version); const $io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email)); const $io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url); const $io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io7(input.variables)); const $io7 = input => Object.keys(input).every(key => {
return (() => { const $io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && $io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json); const $io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem)); const $io2 = input => "string" === typeof input.output && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && $io20(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose); const $io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io5(input.license)) && (undefined === input.version || "string" === typeof input.version); const $io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email)); const $io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url); const $io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io7(input.variables)); const $io7 = input => Object.keys(input).every(key => {
const value = input[key];

@@ -135,235 +140,294 @@ if (undefined === value)

return false;
})(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.input || $guard(_exceptionable, {
})(); const $ao0 = (input, _path, _exceptionable = true) => (null !== input.input || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".input",
expected: "(Array<string> | INestiaConfig.IInput | string)",
value: input.input
}, _errorFactory)) && (undefined !== input.input || $guard(_exceptionable, {
}, _errorFactory)) && (undefined !== input.input || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".input",
expected: "(Array<string> | INestiaConfig.IInput | string)",
value: input.input
}, _errorFactory)) && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index9) => "string" === typeof elem || $guard(_exceptionable, {
}, _errorFactory)) && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index9) => "string" === typeof elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".input[" + _index9 + "]",
expected: "string",
value: elem
}, _errorFactory)) || "object" === typeof input.input && null !== input.input && $ao1(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) || "object" === typeof input.input && null !== input.input && $ao1(input.input, _path + ".input", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".input",
expected: "(Array<string> | INestiaConfig.IInput | string)",
value: input.input
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".input",
expected: "(Array<string> | INestiaConfig.IInput | string)",
value: input.input
}, _errorFactory)) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".swagger",
expected: "(INestiaConfig.ISwaggerConfig | undefined)",
value: input.swagger
}, _errorFactory)) && $ao2(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao2(input.swagger, _path + ".swagger", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".swagger",
expected: "(INestiaConfig.ISwaggerConfig | undefined)",
value: input.swagger
}, _errorFactory)) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.output || "string" === typeof input.output || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".output",
expected: "(string | undefined)",
value: input.output
}, _errorFactory)) && (undefined === input.distribute || "string" === typeof input.distribute || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.distribute || "string" === typeof input.distribute || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".distribute",
expected: "(string | undefined)",
value: input.distribute
}, _errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".simulate",
expected: "(boolean | undefined)",
value: input.simulate
}, _errorFactory)) && (undefined === input.e2e || "string" === typeof input.e2e || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.e2e || "string" === typeof input.e2e || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".e2e",
expected: "(string | undefined)",
value: input.e2e
}, _errorFactory)) && (undefined === input.propagate || "boolean" === typeof input.propagate || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.propagate || "boolean" === typeof input.propagate || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".propagate",
expected: "(boolean | undefined)",
value: input.propagate
}, _errorFactory)) && (undefined === input.clone || "boolean" === typeof input.clone || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.clone || "boolean" === typeof input.clone || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".clone",
expected: "(boolean | undefined)",
value: input.clone
}, _errorFactory)) && (undefined === input.primitive || "boolean" === typeof input.primitive || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.primitive || "boolean" === typeof input.primitive || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".primitive",
expected: "(boolean | undefined)",
value: input.primitive
}, _errorFactory)) && (undefined === input.assert || "boolean" === typeof input.assert || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.assert || "boolean" === typeof input.assert || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".assert",
expected: "(boolean | undefined)",
value: input.assert
}, _errorFactory)) && (undefined === input.json || "boolean" === typeof input.json || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.json || "boolean" === typeof input.json || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".json",
expected: "(boolean | undefined)",
value: input.json
}, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || $guard(_exceptionable, {
}, _errorFactory)); const $ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".include",
expected: "Array<string>",
value: input.include
}, _errorFactory)) && input.include.every((elem, _index10) => "string" === typeof elem || $guard(_exceptionable, {
}, _errorFactory)) && input.include.every((elem, _index10) => "string" === typeof elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".include[" + _index10 + "]",
expected: "string",
value: elem
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".include",
expected: "Array<string>",
value: input.include
}, _errorFactory)) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.exclude || (Array.isArray(input.exclude) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".exclude",
expected: "(Array<string> | undefined)",
value: input.exclude
}, _errorFactory)) && input.exclude.every((elem, _index11) => "string" === typeof elem || $guard(_exceptionable, {
}, _errorFactory)) && input.exclude.every((elem, _index11) => "string" === typeof elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".exclude[" + _index11 + "]",
expected: "string",
value: elem
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".exclude",
expected: "(Array<string> | undefined)",
value: input.exclude
}, _errorFactory)); const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || $guard(_exceptionable, {
}, _errorFactory)); const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".output",
expected: "string",
value: input.output
}, _errorFactory)) && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.openapi || "2.0" === input.openapi || "3.0" === input.openapi || "3.1" === input.openapi || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".openapi",
expected: "(\"2.0\" | \"3.0\" | \"3.1\" | undefined)",
value: input.openapi
}, _errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".beautify",
expected: "(boolean | number | undefined)",
value: input.beautify
}, _errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".additional",
expected: "(boolean | undefined)",
value: input.additional
}, _errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".info",
expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
value: input.info
}, _errorFactory)) && $ao3(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao3(input.info, _path + ".info", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".info",
expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
value: input.info
}, _errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".servers",
expected: "(Array<OpenApi.IServer> | undefined)",
value: input.servers
}, _errorFactory)) && input.servers.every((elem, _index12) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
}, _errorFactory)) && input.servers.every((elem, _index12) => ("object" === typeof elem && null !== elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".servers[" + _index12 + "]",
expected: "OpenApi.IServer",
value: elem
}, _errorFactory)) && $ao6(elem, _path + ".servers[" + _index12 + "]", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao6(elem, _path + ".servers[" + _index12 + "]", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".servers[" + _index12 + "]",
expected: "OpenApi.IServer",
value: elem
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".servers",
expected: "(Array<OpenApi.IServer> | undefined)",
value: input.servers
}, _errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".security",
expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
value: input.security
}, _errorFactory)) && $ao9(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao9(input.security, _path + ".security", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".security",
expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
value: input.security
}, _errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tags",
expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
value: input.tags
}, _errorFactory)) && input.tags.every((elem, _index13) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
}, _errorFactory)) && input.tags.every((elem, _index13) => ("object" === typeof elem && null !== elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tags[" + _index13 + "]",
expected: "OpenApi.IDocument.ITag",
value: elem
}, _errorFactory)) && $ao20(elem, _path + ".tags[" + _index13 + "]", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao20(elem, _path + ".tags[" + _index13 + "]", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tags[" + _index13 + "]",
expected: "OpenApi.IDocument.ITag",
value: elem
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tags",
expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
value: input.tags
}, _errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".decompose",
expected: "(boolean | undefined)",
value: input.decompose
}, _errorFactory)); const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
}, _errorFactory)); const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".title",
expected: "(string | undefined)",
value: input.title
}, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".summary",
expected: "(string | undefined)",
value: input.summary
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".termsOfService",
expected: "(string | undefined)",
value: input.termsOfService
}, _errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".contact",
expected: "(OpenApi.IDocument.IContact | undefined)",
value: input.contact
}, _errorFactory)) && $ao4(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao4(input.contact, _path + ".contact", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".contact",
expected: "(OpenApi.IDocument.IContact | undefined)",
value: input.contact
}, _errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".license",
expected: "(OpenApi.IDocument.ILicense | undefined)",
value: input.license
}, _errorFactory)) && $ao5(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao5(input.license, _path + ".license", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".license",
expected: "(OpenApi.IDocument.ILicense | undefined)",
value: input.license
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".version",
expected: "(string | undefined)",
value: input.version
}, _errorFactory)); const $ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
}, _errorFactory)); const $ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".name",
expected: "(string | undefined)",
value: input.name
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".url",
expected: "(string | undefined)",
value: input.url
}, _errorFactory)) && (undefined === input.email || "string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.email || "string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".email",
expected: "string & Format<\"email\">",
value: input.email
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".email",
expected: "((string & Format<\"email\">) | undefined)",
value: input.email
}, _errorFactory)); const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
}, _errorFactory)); const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".name",
expected: "string",
value: input.name
}, _errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".identifier",
expected: "(string | undefined)",
value: input.identifier
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.url || "string" === typeof input.url || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".url",
expected: "(string | undefined)",
value: input.url
}, _errorFactory)); const $ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || $guard(_exceptionable, {
}, _errorFactory)); const $ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".url",
expected: "string",
value: input.url
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".variables",
expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
value: input.variables
}, _errorFactory)) && $ao7(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao7(input.variables, _path + ".variables", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".variables",

@@ -376,28 +440,35 @@ expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",

return true;
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
path: _path + $join(key),
return ("object" === typeof value && null !== value || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + __$accessExpressionAsString.$accessExpressionAsString(key),
expected: "OpenApi.IServer.IVariable",
value: value
}, _errorFactory)) && $ao8(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
path: _path + $join(key),
}, _errorFactory)) && $ao8(value, _path + __$accessExpressionAsString.$accessExpressionAsString(key), true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + __$accessExpressionAsString.$accessExpressionAsString(key),
expected: "OpenApi.IServer.IVariable",
value: value
}, _errorFactory);
}); const $ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || $guard(_exceptionable, {
}); const $ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + "[\"default\"]",
expected: "string",
value: input["default"]
}, _errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + "[\"enum\"]",
expected: "(Array<string> | undefined)",
value: input["enum"]
}, _errorFactory)) && input["enum"].every((elem, _index14) => "string" === typeof elem || $guard(_exceptionable, {
}, _errorFactory)) && input["enum"].every((elem, _index14) => "string" === typeof elem || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + "[\"enum\"][" + _index14 + "]",
expected: "string",
value: elem
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + "[\"enum\"]",
expected: "(Array<string> | undefined)",
value: input["enum"]
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",

@@ -410,120 +481,150 @@ expected: "(string | undefined)",

return true;
return ("object" === typeof value && null !== value || $guard(_exceptionable, {
path: _path + $join(key),
return ("object" === typeof value && null !== value || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + __$accessExpressionAsString.$accessExpressionAsString(key),
expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
value: value
}, _errorFactory)) && $au0(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
path: _path + $join(key),
}, _errorFactory)) && $au0(value, _path + __$accessExpressionAsString.$accessExpressionAsString(key), true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + __$accessExpressionAsString.$accessExpressionAsString(key),
expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
value: value
}, _errorFactory);
}); const $ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
}); const $ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".type",
expected: "\"apiKey\"",
value: input.type
}, _errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + "[\"in\"]",
expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
value: input["in"]
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.name || "string" === typeof input.name || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".name",
expected: "(string | undefined)",
value: input.name
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)); const $ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
}, _errorFactory)); const $ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".type",
expected: "\"http\"",
value: input.type
}, _errorFactory)) && ("basic" === input.scheme || $guard(_exceptionable, {
}, _errorFactory)) && ("basic" === input.scheme || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scheme",
expected: "\"basic\"",
value: input.scheme
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)); const $ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
}, _errorFactory)); const $ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".type",
expected: "\"http\"",
value: input.type
}, _errorFactory)) && ("bearer" === input.scheme || $guard(_exceptionable, {
}, _errorFactory)) && ("bearer" === input.scheme || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scheme",
expected: "\"bearer\"",
value: input.scheme
}, _errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".bearerFormat",
expected: "(string | undefined)",
value: input.bearerFormat
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)); const $ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
}, _errorFactory)); const $ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".type",
expected: "\"oauth2\"",
value: input.type
}, _errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || $guard(_exceptionable, {
}, _errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".flows",
expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
value: input.flows
}, _errorFactory)) && $ao14(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao14(input.flows, _path + ".flows", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".flows",
expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
value: input.flows
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)); const $ao14 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) || $guard(_exceptionable, {
}, _errorFactory)); const $ao14 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".authorizationCode",
expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
value: input.authorizationCode
}, _errorFactory)) && $ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".authorizationCode",
expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
value: input.authorizationCode
}, _errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".implicit",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
value: input.implicit
}, _errorFactory)) && $ao17(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao17(input.implicit, _path + ".implicit", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".implicit",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
value: input.implicit
}, _errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".password",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
value: input.password
}, _errorFactory)) && $ao18(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao18(input.password, _path + ".password", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".password",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
value: input.password
}, _errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".clientCredentials",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
value: input.clientCredentials
}, _errorFactory)) && $ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".clientCredentials",
expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
value: input.clientCredentials
}, _errorFactory)); const $ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || $guard(_exceptionable, {
}, _errorFactory)); const $ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".authorizationUrl",
expected: "(string | undefined)",
value: input.authorizationUrl
}, _errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tokenUrl",
expected: "(string | undefined)",
value: input.tokenUrl
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".refreshUrl",
expected: "(string | undefined)",
value: input.refreshUrl
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",
expected: "(Record<string, string> | undefined)",
value: input.scopes
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",

@@ -536,56 +637,70 @@ expected: "(Record<string, string> | undefined)",

return true;
return "string" === typeof value || $guard(_exceptionable, {
path: _path + $join(key),
return "string" === typeof value || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + __$accessExpressionAsString.$accessExpressionAsString(key),
expected: "string",
value: value
}, _errorFactory);
}); const $ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || $guard(_exceptionable, {
}); const $ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".authorizationUrl",
expected: "(string | undefined)",
value: input.authorizationUrl
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".refreshUrl",
expected: "(string | undefined)",
value: input.refreshUrl
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",
expected: "(Record<string, string> | undefined)",
value: input.scopes
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",
expected: "(Record<string, string> | undefined)",
value: input.scopes
}, _errorFactory)); const $ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || $guard(_exceptionable, {
}, _errorFactory)); const $ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tokenUrl",
expected: "(string | undefined)",
value: input.tokenUrl
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".refreshUrl",
expected: "(string | undefined)",
value: input.refreshUrl
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",
expected: "(Record<string, string> | undefined)",
value: input.scopes
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".scopes",
expected: "(Record<string, string> | undefined)",
value: input.scopes
}, _errorFactory)); const $ao19 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
}, _errorFactory)); const $ao19 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".type",
expected: "\"openIdConnect\"",
value: input.type
}, _errorFactory)) && ("string" === typeof input.openIdConnectUrl || $guard(_exceptionable, {
}, _errorFactory)) && ("string" === typeof input.openIdConnectUrl || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".openIdConnectUrl",
expected: "string",
value: input.openIdConnectUrl
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)); const $ao20 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
}, _errorFactory)); const $ao20 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".name",
expected: "string",
value: input.name
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".description",

@@ -606,3 +721,4 @@ expected: "(string | undefined)",

else
return $guard(_exceptionable, {
return __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path,

@@ -615,15 +731,19 @@ expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",

_errorFactory = errorFactory;
((input, _path, _exceptionable = true) => (Array.isArray(input) || $guard(true, {
((input, _path, _exceptionable = true) => (Array.isArray(input) || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "",
expected: "Array<INestiaConfig>",
value: input
}, _errorFactory)) && input.every((elem, _index8) => ("object" === typeof elem && null !== elem || $guard(true, {
}, _errorFactory)) && input.every((elem, _index8) => ("object" === typeof elem && null !== elem || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "[" + _index8 + "]",
expected: "INestiaConfig",
value: elem
}, _errorFactory)) && $ao0(elem, _path + "[" + _index8 + "]", true) || $guard(true, {
}, _errorFactory)) && $ao0(elem, _path + "[" + _index8 + "]", true) || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "[" + _index8 + "]",
expected: "INestiaConfig",
value: elem
}, _errorFactory)) || $guard(true, {
}, _errorFactory)) || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "",

@@ -630,0 +750,0 @@ expected: "Array<INestiaConfig>",

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

typescript_1.default.factory.createPropertyAssignment("headers", typescript_1.default.factory.createObjectLiteralExpression([
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"))("headers")),
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"), "headers")),
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [
project.config.clone === true

@@ -73,3 +73,3 @@ ? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(headers.metadata)

.filter((p) => p.category !== "headers")
.map((p) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [
.map((p) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [
project.config.clone === true

@@ -80,3 +80,3 @@ ? SdkAliasCollection_1.SdkAliasCollection.from(project)(importer)(p.metadata)

]);
const assert = typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("assert"), undefined, [typescript_1.default.factory.createIdentifier("output")]);
const assert = typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "assert"), undefined, [typescript_1.default.factory.createIdentifier("output")]);
return typescript_1.default.factory.createArrowFunction([typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.AsyncKeyword)], undefined, [

@@ -83,0 +83,0 @@ IdentifierFactory_1.IdentifierFactory.parameter("connection", typescript_1.default.factory.createTypeReferenceNode("api.IConnection")),

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -16,2 +39,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

exports.SdkDistributionComposer = void 0;
const __$assertGuard = __importStar(require("typia/lib/internal/$assertGuard.js"));
const child_process_1 = __importDefault(require("child_process"));

@@ -78,11 +102,14 @@ const fs_1 = __importDefault(require("fs"));

const json = JSON.parse(content);
return (() => { const $guard = typia_1.default.assert.guard; const $io0 = input => "string" === typeof input.version && "string" === typeof input.typia && "string" === typeof input.tgrid; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || $guard(_exceptionable, {
return (() => { const $io0 = input => "string" === typeof input.version && "string" === typeof input.typia && "string" === typeof input.tgrid; const $ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".version",
expected: "string",
value: input.version
}, _errorFactory)) && ("string" === typeof input.typia || $guard(_exceptionable, {
}, _errorFactory)) && ("string" === typeof input.typia || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".typia",
expected: "string",
value: input.typia
}, _errorFactory)) && ("string" === typeof input.tgrid || $guard(_exceptionable, {
}, _errorFactory)) && ("string" === typeof input.tgrid || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.assert",
path: _path + ".tgrid",

@@ -94,7 +121,9 @@ expected: "string",

_errorFactory = errorFactory;
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $guard(true, {
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "",
expected: "IDependencies",
value: input
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
}, _errorFactory)) && $ao0(input, _path + "", true) || __$assertGuard.$assertGuard(true, {
method: "typia.assert",
path: _path + "",

@@ -101,0 +130,0 @@ expected: "IDependencies",

@@ -41,3 +41,3 @@ "use strict";

var _a, _b, _c;
return typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.Fetcher(!!((_a = props.input) === null || _a === void 0 ? void 0 : _a.encrypted) || route.success.encrypted)(importer)))(project.config.propagate ? "propagate" : "fetch"), project.config.propagate
return typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.Fetcher(!!((_a = props.input) === null || _a === void 0 ? void 0 : _a.encrypted) || route.success.encrypted)(importer)), project.config.propagate ? "propagate" : "fetch"), project.config.propagate
? route.method.toLowerCase() === "get" ||

@@ -52,3 +52,3 @@ route.method.toLowerCase() === "head"

typescript_1.default.factory.createPropertyAssignment("headers", typescript_1.default.factory.createObjectLiteralExpression([
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"))("headers")),
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"), "headers")),
typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("Content-Type"), typescript_1.default.factory.createStringLiteral((_c = (_b = props.input) === null || _b === void 0 ? void 0 : _b.contentType) !== null && _c !== void 0 ? _c : "application/json")),

@@ -59,5 +59,5 @@ ], true)),

typescript_1.default.factory.createObjectLiteralExpression([
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name))("METADATA")),
typescript_1.default.factory.createPropertyAssignment("template", IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name))("METADATA"))("path")),
typescript_1.default.factory.createPropertyAssignment("path", typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name))("path"), undefined, route.parameters
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name), "METADATA")),
typescript_1.default.factory.createPropertyAssignment("template", IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name), "METADATA"), "path")),
typescript_1.default.factory.createPropertyAssignment("path", typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(route.name), "path"), undefined, route.parameters
.filter((p) => p.category === "param" || p.category === "query")

@@ -91,3 +91,3 @@ .map((p) => typescript_1.default.factory.createIdentifier(p.name)))),

.filter((p) => p.category !== "headers")
.map((p) => typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("assert"), [
.map((p) => typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "assert"), [
typescript_1.default.factory.createTypeQueryNode(typescript_1.default.factory.createIdentifier(p.name)),

@@ -94,0 +94,0 @@ ], [typescript_1.default.factory.createIdentifier(p.name)])))

@@ -59,3 +59,3 @@ "use strict";

typescript_1.default.factory.createPropertyAssignment("request", props.input
? LiteralFactory_1.LiteralFactory.generate(props.input !== undefined
? LiteralFactory_1.LiteralFactory.write(props.input !== undefined
? {

@@ -71,3 +71,3 @@ type: props.input.contentType,

typescript_1.default.factory.createPropertyAssignment("response", route.method !== "HEAD"
? LiteralFactory_1.LiteralFactory.generate({
? LiteralFactory_1.LiteralFactory.write({
type: route.success.contentType,

@@ -143,7 +143,7 @@ encrypted: !!route.success.encrypted,

]), typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createStrictEquality(typescript_1.default.factory.createIdentifier("undefined"), typescript_1.default.factory.createIdentifier("value")), typescript_1.default.factory.createContinueStatement(), typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("Array.isArray"), undefined, [typescript_1.default.factory.createIdentifier("value")]), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier("value"), typescript_1.default.factory.createIdentifier("forEach")), undefined, [
typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("append"), undefined, [
typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "append"), undefined, [
typescript_1.default.factory.createIdentifier("key"),
typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("String"), undefined, [typescript_1.default.factory.createIdentifier("elem")]),
])),
])), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("set"), undefined, [
])), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "set"), undefined, [
typescript_1.default.factory.createIdentifier("key"),

@@ -153,5 +153,5 @@ typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("String"), undefined, [typescript_1.default.factory.createIdentifier("value")]),

local("location")("string")(template()),
typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("size")), undefined, typescript_1.default.factory.createIdentifier("location"), undefined, typescript_1.default.factory.createTemplateExpression(typescript_1.default.factory.createTemplateHead(""), [
typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "size")), undefined, typescript_1.default.factory.createIdentifier("location"), undefined, typescript_1.default.factory.createTemplateExpression(typescript_1.default.factory.createTemplateHead(""), [
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createIdentifier("location"), typescript_1.default.factory.createTemplateMiddle("?")),
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("toString"), undefined, undefined), typescript_1.default.factory.createTemplateTail("")),
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "toString"), undefined, undefined), typescript_1.default.factory.createTemplateTail("")),
]))),

@@ -179,3 +179,3 @@ ], true);

IdentifierFactory_1.IdentifierFactory.parameter("input", typescript_1.default.factory.createTypeReferenceNode("Input")),
], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("json"))(project.config.assert ? "stringify" : "assertStringify"), undefined, [typescript_1.default.factory.createIdentifier("input")])));
], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "json"), project.config.assert ? "stringify" : "assertStringify"), undefined, [typescript_1.default.factory.createIdentifier("input")])));
})(SdkHttpNamespaceProgrammer || (exports.SdkHttpNamespaceProgrammer = SdkHttpNamespaceProgrammer = {}));

@@ -182,0 +182,0 @@ const local = (name) => (type) => (expression) => typescript_1.default.factory.createVariableStatement([], typescript_1.default.factory.createVariableDeclarationList([

@@ -25,3 +25,3 @@ "use strict";

? output
: typescript_1.default.factory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.Resolved(importer), [output]), undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [output], [typescript_1.default.factory.createIdentifier("g")])));
: typescript_1.default.factory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.Resolved(importer), [output]), undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [output], [typescript_1.default.factory.createIdentifier("g")])));
};

@@ -57,3 +57,3 @@ SdkHttpSimulationProgrammer.simulate = (project) => (importer) => (route, props) => {

typescript_1.default.factory.createPropertyAssignment("status", ExpressionFactory_1.ExpressionFactory.number((_a = route.success.status) !== null && _a !== void 0 ? _a : (route.method === "POST" ? 201 : 200))),
typescript_1.default.factory.createPropertyAssignment("headers", LiteralFactory_1.LiteralFactory.generate({
typescript_1.default.factory.createPropertyAssignment("headers", LiteralFactory_1.LiteralFactory.write({
"Content-Type": route.success.contentType,

@@ -71,19 +71,22 @@ })),

const typia = SdkImportWizard_1.SdkImportWizard.typia(importer);
const validator = StatementFactory_1.StatementFactory.constant("assert", typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(importer.external({
type: false,
library: `@nestia/fetcher/lib/NestiaSimulator`,
instance: "NestiaSimulator",
})))("assert"), undefined, [
typescript_1.default.factory.createObjectLiteralExpression([
typescript_1.default.factory.createPropertyAssignment("method", typescript_1.default.factory.createIdentifier("METADATA.method")),
typescript_1.default.factory.createPropertyAssignment("host", typescript_1.default.factory.createIdentifier("connection.host")),
typescript_1.default.factory.createPropertyAssignment("path", typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("path"), undefined, route.parameters
.filter((p) => p.category === "param" || p.category === "query")
.map((p) => typescript_1.default.factory.createIdentifier(p.name)))),
typescript_1.default.factory.createPropertyAssignment("contentType", typescript_1.default.factory.createIdentifier(JSON.stringify(route.success.contentType))),
], true),
]));
const validator = StatementFactory_1.StatementFactory.constant({
name: "assert",
value: typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(importer.external({
type: false,
library: `@nestia/fetcher/lib/NestiaSimulator`,
instance: "NestiaSimulator",
})), "assert"), undefined, [
typescript_1.default.factory.createObjectLiteralExpression([
typescript_1.default.factory.createPropertyAssignment("method", typescript_1.default.factory.createIdentifier("METADATA.method")),
typescript_1.default.factory.createPropertyAssignment("host", typescript_1.default.factory.createIdentifier("connection.host")),
typescript_1.default.factory.createPropertyAssignment("path", typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("path"), undefined, route.parameters
.filter((p) => p.category === "param" || p.category === "query")
.map((p) => typescript_1.default.factory.createIdentifier(p.name)))),
typescript_1.default.factory.createPropertyAssignment("contentType", typescript_1.default.factory.createIdentifier(JSON.stringify(route.success.contentType))),
], true),
]),
});
const individual = parameters
.map((p) => typescript_1.default.factory.createCallExpression((() => {
const base = IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("assert"))(p.category);
const base = IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("assert"), p.category);
if (p.category !== "param")

@@ -95,3 +98,3 @@ return base;

})(), undefined, [
typescript_1.default.factory.createArrowFunction(undefined, undefined, [], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(typia))("assert"), undefined, [typescript_1.default.factory.createIdentifier(p.name)])),
typescript_1.default.factory.createArrowFunction(undefined, undefined, [], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(typia), "assert"), undefined, [typescript_1.default.factory.createIdentifier(p.name)])),
]))

@@ -107,3 +110,3 @@ .map(typescript_1.default.factory.createExpressionStatement);

const tryAndCatch = (importer) => (individual) => typescript_1.default.factory.createTryStatement(typescript_1.default.factory.createBlock(individual, true), typescript_1.default.factory.createCatchClause("exp", typescript_1.default.factory.createBlock([
typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createLogicalNot(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("is"), [
typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createLogicalNot(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "is"), [
typescript_1.default.factory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.HttpError(importer)),

@@ -110,0 +113,0 @@ ], [typescript_1.default.factory.createIdentifier("exp")])), typescript_1.default.factory.createThrowStatement(typescript_1.default.factory.createIdentifier("exp"))),

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

], typescript_1.default.NodeFlags.Const), typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("Object.entries"), undefined, [typescript_1.default.factory.createAsExpression(expr, TypeFactory_1.TypeFactory.keyword("any"))]), typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createStrictEquality(typescript_1.default.factory.createIdentifier("undefined"), typescript_1.default.factory.createIdentifier("value")), typescript_1.default.factory.createContinueStatement(), typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("Array.isArray"), undefined, [typescript_1.default.factory.createIdentifier("value")]), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier("value"), typescript_1.default.factory.createIdentifier("forEach")), undefined, [
typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("append"), undefined, [
typescript_1.default.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter("elem")], undefined, undefined, typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "append"), undefined, [
typescript_1.default.factory.createIdentifier("key"),
typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("String"), undefined, [typescript_1.default.factory.createIdentifier("elem")]),
])),
])), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("set"), undefined, [
])), typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "set"), undefined, [
typescript_1.default.factory.createIdentifier("key"),

@@ -103,5 +103,5 @@ typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("String"), undefined, [typescript_1.default.factory.createIdentifier("value")]),

local("location")("string")(template()),
typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("size")), undefined, typescript_1.default.factory.createIdentifier("location"), undefined, typescript_1.default.factory.createTemplateExpression(typescript_1.default.factory.createTemplateHead(""), [
typescript_1.default.factory.createReturnStatement(typescript_1.default.factory.createConditionalExpression(typescript_1.default.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "size")), undefined, typescript_1.default.factory.createIdentifier("location"), undefined, typescript_1.default.factory.createTemplateExpression(typescript_1.default.factory.createTemplateHead(""), [
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createIdentifier("location"), typescript_1.default.factory.createTemplateMiddle("?")),
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables))("toString"), undefined, undefined), typescript_1.default.factory.createTemplateTail("")),
typescript_1.default.factory.createTemplateSpan(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(variables), "toString"), undefined, undefined), typescript_1.default.factory.createTemplateTail("")),
]))),

@@ -108,0 +108,0 @@ ], true);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -16,2 +39,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

exports.SwaggerGenerator = void 0;
const __$assertGuard = __importStar(require("typia/lib/internal/$assertGuard.js"));
const openapi_1 = require("@samchon/openapi");

@@ -94,35 +118,44 @@ const fs_1 = __importDefault(require("fs"));

const content = yield fs_1.default.promises.readFile(location, "utf8");
const data = (() => { const $guard = typia_1.default.json.assertParse.guard; const $io0 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.description || "string" === typeof input.description) && (null !== input.license && (undefined === input.license || "string" === typeof input.license || "object" === typeof input.license && null !== input.license && $io1(input.license))); const $io1 = input => "string" === typeof input.type && ("string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url))); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
const data = (() => { const $io0 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.description || "string" === typeof input.description) && (null !== input.license && (undefined === input.license || "string" === typeof input.license || "object" === typeof input.license && null !== input.license && $io1(input.license))); const $io1 = input => "string" === typeof input.type && ("string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url))); const $ao0 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".name",
expected: "(string | undefined)",
value: input.name
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.version || "string" === typeof input.version || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".version",
expected: "(string | undefined)",
value: input.version
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.description || "string" === typeof input.description || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".description",
expected: "(string | undefined)",
value: input.description
}, _errorFactory)) && ((null !== input.license || $guard(_exceptionable, {
}, _errorFactory)) && ((null !== input.license || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".license",
expected: "(__type.o1 | string | undefined)",
value: input.license
}, _errorFactory)) && (undefined === input.license || "string" === typeof input.license || ("object" === typeof input.license && null !== input.license || $guard(_exceptionable, {
}, _errorFactory)) && (undefined === input.license || "string" === typeof input.license || ("object" === typeof input.license && null !== input.license || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".license",
expected: "(__type.o1 | string | undefined)",
value: input.license
}, _errorFactory)) && $ao1(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
}, _errorFactory)) && $ao1(input.license, _path + ".license", true && _exceptionable) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".license",
expected: "(__type.o1 | string | undefined)",
value: input.license
}, _errorFactory))); const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.type || $guard(_exceptionable, {
}, _errorFactory))); const $ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.type || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".type",
expected: "string",
value: input.type
}, _errorFactory)) && ("string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url) || $guard(_exceptionable, {
}, _errorFactory)) && ("string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".url",
expected: "string & Format<\"uri\">",
value: input.url
}, _errorFactory)) || $guard(_exceptionable, {
}, _errorFactory)) || __$assertGuard.$assertGuard(_exceptionable, {
method: "typia.json.assertParse",
path: _path + ".url",

@@ -134,7 +167,9 @@ expected: "(string & Format<\"uri\">)",

_errorFactory = errorFactory;
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $guard(true, {
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || __$assertGuard.$assertGuard(true, {
method: "typia.json.assertParse",
path: _path + "",
expected: "__type",
value: input
}, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
}, _errorFactory)) && $ao0(input, _path + "", true) || __$assertGuard.$assertGuard(true, {
method: "typia.json.assertParse",
path: _path + "",

@@ -141,0 +176,0 @@ expected: "__type",

@@ -5,4 +5,4 @@ import ts from "typescript";

checker: ts.TypeChecker;
api: ts.TransformationContext;
transformer: ts.TransformationContext;
collection: MetadataCollection;
}

@@ -36,3 +36,3 @@ "use strict";

description: p.symbol
? (_c = CommentFactory_1.CommentFactory.description(p.symbol)) !== null && _c !== void 0 ? _c : null
? ((_c = CommentFactory_1.CommentFactory.description(p.symbol)) !== null && _c !== void 0 ? _c : null)
: null,

@@ -60,7 +60,13 @@ };

};
const [primitive, resolved] = [true, false].map((escape) => MetadataFactory_1.MetadataFactory.analyze(p.context.checker, p.context.api)({
escape,
constant: true,
absorb: true,
})(p.context.collection)(p.type));
const [primitive, resolved] = [true, false].map((escape) => MetadataFactory_1.MetadataFactory.analyze({
checker: p.context.checker,
transformer: p.context.transformer,
options: {
escape,
constant: true,
absorb: true,
},
collection: p.context.collection,
type: p.type,
}));
return Object.assign(Object.assign({}, analyzed), { primitive: writeSchema({

@@ -67,0 +73,0 @@ collection: p.context.collection,

@@ -20,3 +20,3 @@ "use strict";

checker,
api,
transformer: api,
collection: collection.get(),

@@ -44,3 +44,3 @@ };

};
const iterateNode = (props) => typescript_1.default.visitEachChild(transformNode(props), (child) => iterateNode(Object.assign(Object.assign({}, props), { node: child })), props.context.api);
const iterateNode = (props) => typescript_1.default.visitEachChild(transformNode(props), (child) => iterateNode(Object.assign(Object.assign({}, props), { node: child })), props.context.transformer);
const transformNode = (props) => {

@@ -91,3 +91,3 @@ return typescript_1.default.isClassDeclaration(props.node)

typescript_1.default.factory.createDecorator(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier("__OperationMetadata.OperationMetadata"), undefined, [
typescript_1.default.factory.createAsExpression(LiteralFactory_1.LiteralFactory.generate(metadata), TypeFactory_1.TypeFactory.keyword("any")),
typescript_1.default.factory.createAsExpression(LiteralFactory_1.LiteralFactory.write(metadata), TypeFactory_1.TypeFactory.keyword("any")),
])),

@@ -94,0 +94,0 @@ ], props.node.asteriskToken, props.node.name, props.node.questionToken, props.node.typeParameters, props.node.parameters, props.node.type, props.node.body);

{
"name": "@nestia/sdk",
"version": "3.17.0",
"version": "4.0.0-dev.20241010",
"description": "Nestia SDK and Swagger generator",

@@ -35,4 +35,4 @@ "main": "lib/index.js",

"dependencies": {
"@nestia/core": "^3.17.0",
"@nestia/fetcher": "^3.17.0",
"@nestia/core": "^4.0.0-dev.20241010",
"@nestia/fetcher": "^4.0.0-dev.20241010",
"@samchon/openapi": "^1.1.0",

@@ -48,7 +48,7 @@ "cli": "^1.0.1",

"tstl": "^3.0.0",
"typia": "^6.11.0"
"typia": "^7.0.0-dev.20241010"
},
"peerDependencies": {
"@nestia/core": ">=3.17.0",
"@nestia/fetcher": ">=3.17.0",
"@nestia/core": ">=4.0.0-dev.20241010",
"@nestia/fetcher": ">=4.0.0-dev.20241010",
"@nestjs/common": ">=7.0.1",

@@ -58,3 +58,3 @@ "@nestjs/core": ">=7.0.1",

"ts-node": ">=10.6.0",
"typia": ">=6.11.0 <7.0.0"
"typia": ">=7.0.0-dev.20241010 <8.0.0"
},

@@ -61,0 +61,0 @@ "devDependencies": {

@@ -18,3 +18,2 @@ # Nestia

- Swagger generator evolved than ever
- OpenAI function calling schema generator
- SDK library generator for clients

@@ -21,0 +20,0 @@ - Mockup Simulator for client applications

@@ -74,8 +74,12 @@ import { MetadataFactory } from "typia/lib/factories/MetadataFactory";

const metadata: Metadata = Metadata.from(next.metadata, props.dictionary);
const metaErrors: MetadataFactory.IError[] = MetadataFactory.validate()({
escape,
constant: true,
absorb: true,
validate: next.validate,
})(next.validate)(metadata);
const metaErrors: MetadataFactory.IError[] = MetadataFactory.validate({
options: {
escape,
constant: true,
absorb: true,
validate: next.validate, // @todo -> CHECK IN TYPIA
},
functor: next.validate, // @todo -> CHECK IN TYPIA
metadata,
});
if (metaErrors.length)

@@ -82,0 +86,0 @@ errors.push({

@@ -84,3 +84,4 @@ import ts from "typescript";

ts.factory.createIdentifier("connection"),
)("headers"),
"headers",
),
),

@@ -93,3 +94,4 @@ ts.factory.createSpreadAssignment(

),
)("random"),
"random",
),
[

@@ -126,3 +128,4 @@ project.config.clone === true

ts.factory.createIdentifier(SdkImportWizard.typia(importer)),
)("random"),
"random",
),
[

@@ -141,3 +144,4 @@ project.config.clone === true

ts.factory.createIdentifier(SdkImportWizard.typia(importer)),
)("assert"),
"assert",
),
undefined,

@@ -144,0 +148,0 @@ [ts.factory.createIdentifier("output")],

@@ -95,3 +95,4 @@ import ts from "typescript";

),
)(project.config.propagate ? "propagate" : "fetch"),
project.config.propagate ? "propagate" : "fetch",
),
project.config.propagate

@@ -117,3 +118,4 @@ ? route.method.toLowerCase() === "get" ||

ts.factory.createIdentifier("connection"),
)("headers"),
"headers",
),
),

@@ -139,3 +141,4 @@ ts.factory.createPropertyAssignment(

ts.factory.createIdentifier(route.name),
)("METADATA"),
"METADATA",
),
),

@@ -147,4 +150,6 @@ ts.factory.createPropertyAssignment(

ts.factory.createIdentifier(route.name),
)("METADATA"),
)("path"),
"METADATA",
),
"path",
),
),

@@ -156,3 +161,4 @@ ts.factory.createPropertyAssignment(

ts.factory.createIdentifier(route.name),
)("path"),
"path",
),
undefined,

@@ -212,3 +218,4 @@ route.parameters

),
)("assert"),
"assert",
),
[

@@ -215,0 +222,0 @@ ts.factory.createTypeQueryNode(

@@ -129,3 +129,3 @@ import ts from "typescript";

props.input
? LiteralFactory.generate(
? LiteralFactory.write(
props.input !== undefined

@@ -146,3 +146,3 @@ ? {

route.method !== "HEAD"
? LiteralFactory.generate({
? LiteralFactory.write({
type: route.success.contentType,

@@ -357,3 +357,4 @@ encrypted: !!route.success.encrypted,

ts.factory.createIdentifier(variables),
)("append"),
"append",
),
undefined,

@@ -377,3 +378,4 @@ [

ts.factory.createIdentifier(variables),
)("set"),
"set",
),
undefined,

@@ -400,3 +402,4 @@ [

ts.factory.createIdentifier(variables),
)("size"),
"size",
),
),

@@ -417,3 +420,4 @@ undefined,

ts.factory.createIdentifier(variables),
)("toString"),
"toString",
),
undefined,

@@ -491,4 +495,6 @@ undefined,

ts.factory.createIdentifier(SdkImportWizard.typia(importer)),
)("json"),
)(project.config.assert ? "stringify" : "assertStringify"),
"json",
),
project.config.assert ? "stringify" : "assertStringify",
),
undefined,

@@ -495,0 +501,0 @@ [ts.factory.createIdentifier("input")],

@@ -51,3 +51,4 @@ import ts from "typescript";

ts.factory.createIdentifier(SdkImportWizard.typia(importer)),
)("random"),
"random",
),
[output],

@@ -164,3 +165,3 @@ [ts.factory.createIdentifier("g")],

"headers",
LiteralFactory.generate({
LiteralFactory.write({
"Content-Type": route.success.contentType,

@@ -194,5 +195,5 @@ }),

const typia = SdkImportWizard.typia(importer);
const validator = StatementFactory.constant(
"assert",
ts.factory.createCallExpression(
const validator = StatementFactory.constant({
name: "assert",
value: ts.factory.createCallExpression(
IdentifierFactory.access(

@@ -206,3 +207,4 @@ ts.factory.createIdentifier(

),
)("assert"),
"assert",
),
undefined,

@@ -243,3 +245,3 @@ [

),
);
});
const individual = parameters

@@ -251,3 +253,4 @@ .map((p) =>

ts.factory.createIdentifier("assert"),
)(p.category);
p.category,
);
if (p.category !== "param") return base;

@@ -267,3 +270,4 @@ return ts.factory.createCallExpression(base, undefined, [

ts.factory.createCallExpression(
IdentifierFactory.access(ts.factory.createIdentifier(typia))(
IdentifierFactory.access(
ts.factory.createIdentifier(typia),
"assert",

@@ -303,3 +307,4 @@ ),

),
)("is"),
"is",
),
[

@@ -306,0 +311,0 @@ ts.factory.createTypeReferenceNode(

@@ -255,3 +255,4 @@ import ts from "typescript";

ts.factory.createIdentifier(variables),
)("append"),
"append",
),
undefined,

@@ -275,3 +276,4 @@ [

ts.factory.createIdentifier(variables),
)("set"),
"set",
),
undefined,

@@ -298,3 +300,4 @@ [

ts.factory.createIdentifier(variables),
)("size"),
"size",
),
),

@@ -315,3 +318,4 @@ undefined,

ts.factory.createIdentifier(variables),
)("toString"),
"toString",
),
undefined,

@@ -318,0 +322,0 @@ undefined,

@@ -6,4 +6,4 @@ import ts from "typescript";

checker: ts.TypeChecker;
api: ts.TransformationContext;
transformer: ts.TransformationContext;
collection: MetadataCollection;
}

@@ -51,3 +51,3 @@ import ts from "typescript";

description: p.symbol
? CommentFactory.description(p.symbol) ?? null
? (CommentFactory.description(p.symbol) ?? null)
: null,

@@ -106,10 +106,13 @@ };

const [primitive, resolved] = [true, false].map((escape) =>
MetadataFactory.analyze(
p.context.checker,
p.context.api,
)({
escape,
constant: true,
absorb: true,
})(p.context.collection)(p.type),
MetadataFactory.analyze({
checker: p.context.checker,
transformer: p.context.transformer,
options: {
escape,
constant: true,
absorb: true,
},
collection: p.context.collection,
type: p.type,
}),
);

@@ -116,0 +119,0 @@ return {

@@ -18,3 +18,3 @@ import path from "path";

checker,
api,
transformer: api,
collection: collection.get(),

@@ -76,3 +76,3 @@ };

}),
props.context.api,
props.context.transformer,
);

@@ -176,3 +176,3 @@

ts.factory.createAsExpression(
LiteralFactory.generate(metadata),
LiteralFactory.write(metadata),
TypeFactory.keyword("any"),

@@ -179,0 +179,0 @@ ),

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc