anl 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ar.md ADDED
@@ -0,0 +1,20 @@
1
+ # an-cli
2
+
3
+ [English](./README.en.md) | [Español](./README.es.md) | العربية | [Français](./README.fr.md) | [Русский](./README.ru.md) | [日本語](./README.jp.md) | [简体中文](./README.md)
4
+
5
+ أداة سطر الأوامر للواجهة الأمامية
6
+
7
+ أداة سطر أوامر تقوم تلقائياً بإنشاء تعريفات أنواع TypeScript ودوال طلبات API استناداً إلى Swagger JSON.
8
+
9
+ ## المميزات
10
+
11
+ - 🚀 التحليل التلقائي لوثائق Swagger JSON
12
+ - 📦 إنشاء ملفات تعريف أنواع TypeScript
13
+ - 🔄 إنشاء دوال طلبات API آمنة النوع
14
+ - 🎯 دعم معلمات المسار والاستعلام وجسم الطلب
15
+ - 📝 إنشاء تلقائي لتعريفات الأنواع المعدودة
16
+ - 🎨 دعم تنسيق الكود
17
+ - ⚡️ دعم رفع الملفات
18
+ - 🛠 خيارات قابلة للتكوين لإنشاء الكود
19
+
20
+ [... rest of content similar to README.en.md but in Arabic ...]
package/README.en.md ADDED
@@ -0,0 +1,81 @@
1
+ # an-cli
2
+
3
+ [简体中文](./README.md) | English
4
+
5
+ Frontend Command Line Tool
6
+
7
+ A command-line tool that automatically generates TypeScript type definitions and API request functions based on Swagger JSON.
8
+
9
+ ## Features
10
+
11
+ - 🚀 Automatic parsing of Swagger JSON documentation
12
+ - 📦 Generate TypeScript type definition files
13
+ - 🔄 Generate type-safe API request functions
14
+ - 🎯 Support for path parameters, query parameters, and request body
15
+ - 📝 Automatic generation of enum type definitions
16
+ - 🎨 Support for code formatting
17
+ - ⚡️ Support for file uploads
18
+ - 🛠 Configurable code generation options
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ $ npm install anl -g
24
+
25
+ $ yarn global add anl
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ 1. Execute command
31
+
32
+ ```bash
33
+ $ anl type
34
+ ```
35
+
36
+ 2. Complete configuration
37
+
38
+ - When executing `anl type` for the first time, a configuration file named `an.config.json` will be automatically created in the project root directory (manual creation is also possible)
39
+ - See configuration description for specific parameter details
40
+ - Configuration filename cannot be modified
41
+
42
+ ```json
43
+ {
44
+ "saveTypeFolderPath": "apps/types",
45
+ "saveApiListFolderPath": "apps/api/",
46
+ "saveEnumFolderPath": "apps/enums",
47
+ "importEnumPath": "../../enums",
48
+ "swaggerJsonUrl": "https://generator3.swagger.io/openapi.json",
49
+ "requestMethodsImportPath": "./fetch",
50
+ "dataLevel": "serve",
51
+ "formatting": {
52
+ "indentation": "\t",
53
+ "lineEnding": "\n"
54
+ },
55
+ "headers": {}
56
+ }
57
+ ```
58
+
59
+ 3. Generate TypeScript type definitions and API request functions by executing the generation command again
60
+
61
+ ```bash
62
+ $ anl type
63
+ ```
64
+
65
+ ## Configuration Options
66
+
67
+ | Option | Type | Required | Description |
68
+ | ------------------------ | ---------------------------- | -------- | ----------------------------------- |
69
+ | saveTypeFolderPath | string | Yes | Type definition file save path |
70
+ | saveApiListFolderPath | string | Yes | API request function file save path |
71
+ | saveEnumFolderPath | string | Yes | Enum type file save path |
72
+ | importEnumPath | string | Yes | Enum type import path |
73
+ | swaggerJsonUrl | string | Yes | Swagger JSON documentation URL |
74
+ | requestMethodsImportPath | string | Yes | Request method import path |
75
+ | dataLevel | 'data' \| 'serve' \| 'axios' | Yes | Interface return data level |
76
+ | formatting | object | No | Code formatting configuration |
77
+ | headers | object | No | Request header configuration |
78
+
79
+ ## Generated File Structure
80
+
81
+ - This file structure is generated based on the configuration file
package/README.es.md ADDED
@@ -0,0 +1,20 @@
1
+ # an-cli
2
+
3
+ [English](./README.en.md) | Español | [العربية](./README.ar.md) | [Français](./README.fr.md) | [Русский](./README.ru.md) | [日本語](./README.jp.md) | [简体中文](./README.md)
4
+
5
+ Herramienta de Línea de Comandos Frontend
6
+
7
+ Una herramienta de línea de comandos que genera automáticamente definiciones de tipos TypeScript y funciones de solicitud de API basadas en Swagger JSON.
8
+
9
+ ## Características
10
+
11
+ - 🚀 Análisis automático de documentación Swagger JSON
12
+ - 📦 Genera archivos de definición de tipos TypeScript
13
+ - 🔄 Genera funciones de solicitud de API con seguridad de tipos
14
+ - 🎯 Soporte para parámetros de ruta, consulta y cuerpo de solicitud
15
+ - 📝 Generación automática de definiciones de tipos enum
16
+ - 🎨 Soporte para formateo de código
17
+ - ⚡️ Soporte para carga de archivos
18
+ - 🛠 Opciones configurables de generación de código
19
+
20
+ [... resto del contenido similar al README.en.md pero en español ...]
package/README.fr.md ADDED
@@ -0,0 +1,20 @@
1
+ # an-cli
2
+
3
+ [English](./README.en.md) | [Español](./README.es.md) | [العربية](./README.ar.md) | Français | [Русский](./README.ru.md) | [日本語](./README.jp.md) | [简体中文](./README.md)
4
+
5
+ Outil en Ligne de Commande Frontend
6
+
7
+ Un outil en ligne de commande qui génère automatiquement des définitions de types TypeScript et des fonctions de requête API basées sur Swagger JSON.
8
+
9
+ ## Fonctionnalités
10
+
11
+ - 🚀 Analyse automatique de la documentation Swagger JSON
12
+ - 📦 Génération de fichiers de définition de types TypeScript
13
+ - 🔄 Génération de fonctions de requête API typées
14
+ - 🎯 Prise en charge des paramètres de chemin, de requête et de corps
15
+ - 📝 Génération automatique de définitions de types énumérés
16
+ - 🎨 Prise en charge du formatage du code
17
+ - ⚡️ Prise en charge du téléchargement de fichiers
18
+ - 🛠 Options de génération de code configurables
19
+
20
+ [... rest of content similar to README.en.md but in French ...]
package/README.jp.md ADDED
@@ -0,0 +1,20 @@
1
+ # an-cli
2
+
3
+ [English](./README.en.md) | [Español](./README.es.md) | [العربية](./README.ar.md) | [Français](./README.fr.md) | [Русский](./README.ru.md) | 日本語 | [简体中文](./README.md)
4
+
5
+ フロントエンドコマンドラインツール
6
+
7
+ Swagger JSONに基づいてTypeScriptの型定義とAPIリクエスト関数を自動生成するコマンドラインツール。
8
+
9
+ ## 特徴
10
+
11
+ - 🚀 Swagger JSON文書の自動解析
12
+ - 📦 TypeScript型定義ファイルの生成
13
+ - 🔄 型安全なAPIリクエスト関数の生成
14
+ - 🎯 パスパラメータ、クエリパラメータ、リクエストボディのサポート
15
+ - 📝 列挙型定義の自動生成
16
+ - 🎨 コードフォーマットのサポート
17
+ - ⚡️ ファイルアップロードのサポート
18
+ - 🛠 設定可能なコード生成オプション
19
+
20
+ [... rest of content similar to README.en.md but in Japanese ...]
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # an-cli
2
2
 
3
+ [English](./README.en.md) | [Español](./README.es.md) | [العربية](./README.ar.md) | [Français](./README.fr.md) | [Русский](./README.ru.md) | [日本語](./README.jp.md) | 简体中文
4
+
3
5
  前端命令行工具
4
6
 
5
7
  一个基于 Swagger JSON 自动生成 TypeScript 类型定义和 API 请求函数的命令行工具。
@@ -189,3 +191,42 @@ npm run blink
189
191
  ## 许可证
190
192
 
191
193
  ISC License
194
+
195
+ ## 多语言文档说明
196
+
197
+ 为了更好地维护多语言文档,我们提供以下建议:
198
+
199
+ 1. 文件命名规范
200
+
201
+ - 使用标准的语言代码命名:
202
+ - 中文版:`README.zh-CN.md`
203
+ - 英文版:`README.en.md`
204
+ - 西班牙语版:`README.es.md`
205
+ - 阿拉伯语版:`README.ar.md`
206
+ - 法语版:`README.fr.md`
207
+ - 俄语版:`README.ru.md`
208
+ - 日语版:`README.ja.md`
209
+
210
+ 2. 文档同步更新
211
+
212
+ - 使用 `sync-docs.js` 脚本自动同步所有语言版本
213
+ - 在修改主要文档后运行 `npm run sync-docs`
214
+ - 确保所有语言版本的结构保持一致
215
+
216
+ 3. 翻译规范
217
+
218
+ - 保持专业术语的一致性
219
+ - 代码示例保持原始英文
220
+ - 注释和说明使用对应语言
221
+ - 保持排版格式的统一
222
+
223
+ 4. 贡献指南
224
+
225
+ - 欢迎提交多语言版本的改进建议
226
+ - 请确保在提交 PR 时更新所有语言版本
227
+ - 如发现翻译问题,请提交 Issue
228
+
229
+ 5. 语言切换优化
230
+ - 在每个文档顶部添加语言切换图标
231
+ - 保持所有语言版本的链接顺序一致
232
+ - 当前语言链接保持未激活状态
package/README.ru.md ADDED
@@ -0,0 +1,20 @@
1
+ # an-cli
2
+
3
+ [English](./README.en.md) | [Español](./README.es.md) | [العربية](./README.ar.md) | [Français](./README.fr.md) | Русский | [日本語](./README.jp.md) | [简体中文](./README.md)
4
+
5
+ Инструмент Командной Строки для Frontend
6
+
7
+ Инструмент командной строки, который автоматически генерирует определения типов TypeScript и функции запросов API на основе Swagger JSON.
8
+
9
+ ## Особенности
10
+
11
+ - 🚀 Автоматический разбор документации Swagger JSON
12
+ - 📦 Генерация файлов определения типов TypeScript
13
+ - 🔄 Генерация типобезопасных функций запросов API
14
+ - 🎯 Поддержка параметров пути, запроса и тела запроса
15
+ - 📝 Автоматическая генерация определений перечислений
16
+ - 🎨 Поддержка форматирования кода
17
+ - ⚡️ Поддержка загрузки файлов
18
+ - 🛠 Настраиваемые параметры генерации кода
19
+
20
+ [... rest of content similar to README.en.md but in Russian ...]
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="3.0.1",t={title:"Swagger Generator",description:"This is an online swagger codegen server. You can find out more at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http://swagger.io/irc/).",license:{name:"Apache 2.0",url:"http://www.apache.org/licenses/LICENSE-2.0.html"},version:"3.0.68"},r=[{url:"/api"}],n=[{name:"clients"},{name:"servers"},{name:"documentation"},{name:"config"}],o={"/generate":{get:{tags:["clients","servers","documentation","config"],summary:"Generates and download code. GenerationRequest input provided as JSON available at URL specified in parameter codegenOptionsURL.",operationId:"generateFromURL",parameters:[{name:"codegenOptionsURL",in:"query",required:!0,schema:{type:"string"}}],responses:{200:{description:"successful operation",content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"},post:{tags:["clients","servers","documentation","config"],summary:"Generates and download code. GenerationRequest input provided as request body.",operationId:"generate",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/GenerationRequest"}}}},responses:{200:{description:"successful operation",content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/clients":{get:{tags:["clients","documentation"],summary:"Deprecated, use '/{type}/{version}' instead. List generator languages of type 'client' or 'documentation' for given codegen version (defaults to V3)",operationId:"clientLanguages",parameters:[{$ref:"#/components/parameters/version"},{name:"clientOnly",in:"query",description:"flag to only return languages of type `client`",schema:{type:"boolean",default:!1}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},deprecated:!0,"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/servers":{get:{tags:["servers"],summary:"Deprecated, use '/{type}/{version}' instead. List generator languages of type 'server' for given codegen version (defaults to V3)",operationId:"serverLanguages",parameters:[{$ref:"#/components/parameters/version"}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},deprecated:!0,"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/documentation":{get:{tags:["documentation"],summary:"Deprecated, use '/{type}/{version}' instead. List generator languages of type 'documentation' for given codegen version (defaults to V3)",operationId:"documentationLanguages",parameters:[{$ref:"#/components/parameters/version"}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},deprecated:!0,"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/{type}/{version}":{get:{tags:["clients","servers","documentation","config"],summary:"List generator languages of the given type and version",operationId:"languages",parameters:[{$ref:"#/components/parameters/type"},{name:"version",in:"path",description:"generator version used by codegen engine",required:!0,schema:{type:"string",enum:["V2","V3"]}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/types":{get:{tags:["clients","servers","documentation","config"],summary:"List generator languages of version defined in 'version parameter (defaults to V3) and type included in 'types' parameter; all languages",operationId:"languagesMulti",parameters:[{$ref:"#/components/parameters/types"},{$ref:"#/components/parameters/version"}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{type:"string"}}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/options":{get:{tags:["clients","servers","documentation","config"],summary:"Returns options for a given language and version (defaults to V3)",operationId:"listOptions",parameters:[{name:"language",in:"query",description:"language",schema:{type:"string"}},{$ref:"#/components/parameters/version"}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"object",additionalProperties:{$ref:"#/components/schemas/CliOption"}}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/model":{post:{tags:["clients","servers","documentation","config"],summary:'Generates the intermediate model ("bundle") and returns it as a JSON. body.',operationId:"generateBundle",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/GenerationRequest"}}}},responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"object"}}}}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}},"/render":{post:{tags:["documentation"],summary:"render a template using the provided data",operationId:"renderTemplate",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/RenderRequest"}}}},responses:{200:{description:"successful operation"}},"x-swagger-router-controller":"io.swagger.v3.generator.online.GeneratorController"}}},i={schemas:{GenerationRequest:{required:["lang"],type:"object",properties:{lang:{title:"language",type:"string",description:"language to generate (required)",example:"java"},spec:{type:"object",description:"spec in json format. . Alternative to `specURL`"},specURL:{type:"string",description:"URL of the spec in json format. Alternative to `spec`"},type:{type:"string",description:"type of the spec",enum:["CLIENT","SERVER","DOCUMENTATION","CONFIG"]},codegenVersion:{type:"string",description:"codegen version to use",enum:["V2","V3"]},options:{$ref:"#/components/schemas/Options"}},"x-swagger-router-model":"io.swagger.codegen.v3.service.GenerationRequest"},AuthorizationValue:{title:"authorization",type:"object",properties:{value:{type:"string",description:"Authorization value"},keyName:{type:"string",description:"Authorization key"},type:{type:"string",description:"Authorization type",enum:["query","header"]}},description:"adds authorization headers when fetching the open api definitions remotely. Pass in an authorizationValue object","x-swagger-router-model":"io.swagger.v3.parser.core.models.AuthorizationValue"},Options:{type:"object",properties:{auth:{title:"authorization",type:"string",description:"adds authorization headers when fetching the open api definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values"},authorizationValue:{$ref:"#/components/schemas/AuthorizationValue"},apiPackage:{title:"api package",type:"string",description:"package for generated api classes"},templateVersion:{title:"Template Version",type:"string",description:"template version for generation"},modelPackage:{title:"model package",type:"string",description:"package for generated models"},modelNamePrefix:{title:"model name prefix",type:"string",description:"Prefix that will be prepended to all model names. Default is the empty string."},modelNameSuffix:{title:"model name suffix",type:"string",description:"PrefixSuffix that will be appended to all model names. Default is the empty string."},systemProperties:{title:"System Properties",type:"object",additionalProperties:{type:"string"},description:"sets specified system properties in key/value format"},instantiationTypes:{title:"instantiation types",type:"object",additionalProperties:{type:"string"},description:"sets instantiation type mappings in key/value format. For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code."},typeMappings:{title:"type mappings",type:"object",additionalProperties:{type:"string"},description:"sets mappings between swagger spec types and generated code types in key/value format. For example: array=List,map=Map,string=String."},additionalProperties:{title:"additional properties",type:"object",additionalProperties:{type:"object"},description:"sets additional properties that can be referenced by the mustache templates in key/value format."},languageSpecificPrimitives:{title:"language specific primitives",type:"array",description:"specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option.",items:{type:"string"}},importMappings:{title:"import mappings",type:"object",additionalProperties:{type:"string"},description:"specifies mappings between a given class and the import that should be used for that class in key/value format."},invokerPackage:{title:"invoker package",type:"string",description:"root package for generated code"},groupId:{title:"group id",type:"string",description:"groupId in generated pom.xml"},artifactId:{title:"artifact id",type:"string",description:"artifactId in generated pom.xml"},artifactVersion:{title:"artifact version",type:"string",description:"artifact version generated in pom.xml"},library:{title:"library",type:"string",description:"library template (sub-template)"},gitUserId:{title:"git user id",type:"string",description:"Git user ID, e.g. swagger-api."},gitRepoId:{title:"git repo id",type:"string",description:"Git repo ID, e.g. swagger-codegen."},releaseNote:{title:"release note",type:"string",description:"Release note, default to 'Minor update'."},httpUserAgent:{title:"http user agent",type:"string",description:"HTTP user agent, e.g. codegen_csharp_api_client, default to 'Swagger-Codegen/{packageVersion}}/{language}'"},reservedWordsMappings:{title:"reserved words mappings",type:"object",additionalProperties:{type:"string"},description:"pecifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier."},ignoreFileOverride:{title:"ignore file override location",type:"string",description:"Specifies an override location for the .swagger-codegen-ignore file. Most useful on initial generation."},removeOperationIdPrefix:{title:"remove prefix of the operationId",type:"boolean",description:"Remove prefix of operationId, e.g. config_getId => getId"},skipOverride:{type:"boolean"}},"x-swagger-router-model":"io.swagger.codegen.v3.service.Options"},CliOption:{type:"object",properties:{optionName:{type:"string"},description:{type:"string"},type:{type:"string",description:"Data type is based on the types supported by the JSON-Schema"},enum:{type:"object",additionalProperties:{type:"string"}},default:{type:"string"}}},RenderRequest:{required:["context","template"],type:"object",properties:{template:{title:"template",type:"string",description:"template as string",example:"{{!mustache}}"},context:{title:"context",type:"string",description:"context as string",example:"{}"}},"x-swagger-router-model":"io.swagger.codegen.v3.service.RenderRequest"},RenderResponse:{required:["value"],type:"object",properties:{value:{type:"string"}},"x-swagger-router-model":"io.swagger.codegen.v3.service.RenderResponse"}},parameters:{version:{name:"version",in:"query",description:"generator version used by codegen engine",schema:{type:"string",enum:["V2","V3"]}},type:{name:"type",in:"path",description:"generator type",required:!0,schema:{type:"string",enum:["client","server","documentation","config"]}},types:{name:"types",in:"query",description:"comma-separated list of generator types",required:!0,style:"form",explode:!1,schema:{type:"array",items:{type:"string",enum:["client","server","documentation","config"]}}}}},s={openapi:e,info:t,servers:r,tags:n,paths:o,components:i};exports.components=i,exports.default=s,exports.info=t,exports.openapi=e,exports.paths=o,exports.servers=r,exports.tags=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.5.5",i="FE command line tool",s="bin/an-cli.js",l={dev:"rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript -w",build:"rimraf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",pub:"bash publish.sh",ts:"tsc ./src/int.ts --noEmit --watch",blink:"npm run build && npm link"},p={anl:"bin/an-cli.js"},t="Gleason <bianliuzhu@gmail.com>",r={"@commitlint/cli":"^17.4.3","@commitlint/config-conventional":"^17.4.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-typescript":"^8.3.0","@types/inquirer":"^9.0.3","@types/shelljs":"^0.8.11","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","cross-env":"^7.0.3",eslint:"^8.7.0",husky:"^8.0.3","openapi-types":"^12.1.3",prettier:"^3.3.2",rimraf:"^5.0.7",rollup:"^2.64.0","rollup-plugin-cleandir":"^2.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-terser":"^7.0.2",typescript:"^4.5.4"},o={"app-root-path":"^3.1.0",cac:"^6.7.12",chalk:"4.*","clear-console":"^1.1.0",commander:"^10.0.0",figures:"^6.1.0",inquirer:"^10.1.8","log-symbols":"^5.1.0",ora:"5.*","progress-estimator":"^0.3.0",shelljs:"^0.8.5"},n=["typescript","cli","typescript 脚手架","ts 脚手架","ts-cli","脚手架"],c=["package.json","README.md","lib","template"],u={type:"git",url:"https://github.com/bianliuzhu/an-cli.git"},a="commonjs",m={name:"anl",version:e,description:i,main:s,scripts:l,bin:p,author:t,license:"ISC",devDependencies:r,dependencies:o,keywords:n,files:c,repository:u,type:a};exports.author=t,exports.bin=p,exports.default=m,exports.dependencies=o,exports.description=i,exports.devDependencies=r,exports.files=c,exports.keywords=n,exports.license="ISC",exports.main=s,exports.name="anl",exports.repository=u,exports.scripts=l,exports.type=a,exports.version=e;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="1.5.6",i="FE command line tool",s="bin/an-cli.js",p={dev:"rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript -w",build:"rimraf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",pub:"bash publish.sh",ts:"tsc ./src/int.ts --noEmit --watch",blink:"npm run build && npm link","sync-docs":"node scripts/sync-docs.js"},l={anl:"bin/an-cli.js"},o="Gleason <bianliuzhu@gmail.com>",t={"@commitlint/cli":"^17.4.3","@commitlint/config-conventional":"^17.4.3","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-typescript":"^8.3.0","@types/inquirer":"^9.0.3","@types/shelljs":"^0.8.11","@typescript-eslint/eslint-plugin":"^5.52.0","@typescript-eslint/parser":"^5.52.0","cross-env":"^7.0.3",eslint:"^8.7.0",husky:"^8.0.3","openapi-types":"^12.1.3",prettier:"^3.3.2",rimraf:"^5.0.7",rollup:"^2.64.0","rollup-plugin-cleandir":"^2.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-terser":"^7.0.2",typescript:"^4.5.4"},r={"app-root-path":"^3.1.0",cac:"^6.7.12",chalk:"4.*","clear-console":"^1.1.0",commander:"^10.0.0",figures:"^6.1.0",inquirer:"^10.1.8","log-symbols":"^5.1.0",ora:"5.*","progress-estimator":"^0.3.0",shelljs:"^0.8.5"},n=["typescript","cli","typescript 脚手架","ts 脚手架","ts-cli","脚手架"],c=["package.json","README.md","lib","template"],u={type:"git",url:"https://github.com/bianliuzhu/an-cli.git"},a="commonjs",m={name:"anl",version:e,description:i,main:s,scripts:p,bin:l,author:o,license:"ISC",devDependencies:t,dependencies:r,keywords:n,files:c,repository:u,type:a};exports.author=o,exports.bin=l,exports.default=m,exports.dependencies=r,exports.description=i,exports.devDependencies=t,exports.files=c,exports.keywords=n,exports.license="ISC",exports.main=s,exports.name="anl",exports.repository=u,exports.scripts=p,exports.type=a,exports.version=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),t=require("../utils/index.js"),s=require("./core/components.js"),a=require("./core/get-data.js"),r=require("./core/path.js"),o=require("shelljs"),i=require("chalk"),n=require("path");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),p=c(i),u=c(n);let d;const h="development"===process.env.NODE_ENV,f={saveTypeFolderPath:h?"apps/types":"src/api/types",saveApiListFolderPath:h?"apps/types":"src/api",saveEnumFolderPath:h?"apps/types/enums":"src/enums",importEnumPath:"../../../enums",requestMethodsImportPath:"./fetch",dataLevel:"serve",swaggerJsonUrl:"www.example.swagger.json.url",headers:{},formatting:{indentation:"\t",lineEnding:"\n"}};class w{schemas={};paths={};async handle(e){try{let t;if(t="development"===process.env.NODE_ENV?(await Promise.resolve().then((function(){return require("../../data/openapi.json.js")}))).default:await a.getSwaggerJson(e),!t)throw new Error("无法获取 Swagger 数据");this.schemas=t.components?.schemas||{},this.paths=t.paths||{};const o=new s.default(this.schemas,e),i=new r.PathParse(this.paths,t.components?.parameters,e);return await Promise.all([o.handle(),i.handle()]),!0}catch(e){if(e instanceof Error)throw new Error(`处理 Swagger 数据失败: ${e.message}`);throw new Error("处理 Swagger 数据失败: 未知错误")}}async formatGeneratedFiles(e){const s=`npx prettier --write "${e.saveTypeFolderPath}/**/*.{ts,d.ts}"`;try{await l.default.promises.access(e.saveTypeFolderPath);const{stderr:a}=await new Promise(((e,t)=>{o.exec(s,((s,a,r)=>{s?t(s):e({stdout:a,stderr:r})}))}));if(a)throw new Error(a);t.log.success("文件格式化成功")}catch(e){console.log(""),t.log.error("格式化失败,请手动执行以下命令:"),console.log("$",p.default.yellow(s)),console.log("")}}async copyAjaxConfigFiles(e){try{const s=["config.ts","error-message.ts","fetch.ts","api-type.d.ts"],a=u.default.join(__dirname,"..","..","ajax-config"),r=e;for(const e of s){const s=u.default.join(a,e),o=u.default.join(r,e);try{await l.default.promises.access(s);try{await l.default.promises.access(o),t.log.info(`${e} 已存在,跳过生成.`)}catch{await l.default.promises.copyFile(s,o),t.log.success(`${e} create done.`)}}catch(e){t.log.error(`源文件 ${s} 不存在`);continue}}}catch(e){return e}}async initialize(){const e=process.cwd()+"/an.config.json";try{const s=await this.getConfig(e);if(!d)return;await l.default.promises.mkdir(s.saveApiListFolderPath,{recursive:!0}),await this.copyAjaxConfigFiles(s.saveApiListFolderPath),await t.clearDir(s.saveTypeFolderPath),await t.clearDir(s.saveEnumFolderPath),await this.handle(s),await this.formatGeneratedFiles(s)}catch(e){const s=e instanceof Error?e.message:"未知错误";t.log.error(`初始化失败: ${s}`)}}async getConfig(e){try{const t=await l.default.promises.readFile(e,"utf8");return d=!0,JSON.parse(t)}catch(s){return d=!1,t.log.warning("配置文件不存在,将自动创建配置文件。"),await t.writeFileRecursive(e,JSON.stringify(f,null,2)),t.log.success("请查看项目根目录下的 an.config.json 文件"),f}}}if("development"===process.env.NODE_ENV){(new w).initialize()}exports.Main=w;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("fs"),t=require("../utils/index.js"),s=require("./core/components.js"),a=require("./core/get-data.js"),r=require("./core/path.js"),o=require("shelljs"),i=require("chalk"),n=require("path");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),p=c(i),u=c(n);let d;const h="development"===process.env.NODE_ENV,f={saveTypeFolderPath:h?"apps/types":"src/api/types",saveApiListFolderPath:h?"apps/types":"src/api",saveEnumFolderPath:h?"apps/types/enums":"src/enums",importEnumPath:"../../../enums",requestMethodsImportPath:"./fetch",dataLevel:"serve",swaggerJsonUrl:"www.example.swagger.json.url",headers:{},formatting:{indentation:"\t",lineEnding:"\n"}};class w{schemas={};paths={};async handle(e){try{let t;if(t="development"===process.env.NODE_ENV?(await Promise.resolve().then((function(){return require("../../data/open-api.json.js")}))).default:await a.getSwaggerJson(e),!t)throw new Error("无法获取 Swagger 数据");this.schemas=t.components?.schemas||{},this.paths=t.paths||{};const o=new s.default(this.schemas,e),i=new r.PathParse(this.paths,t.components?.parameters,e);return await Promise.all([o.handle(),i.handle()]),!0}catch(e){if(e instanceof Error)throw new Error(`处理 Swagger 数据失败: ${e.message}`);throw new Error("处理 Swagger 数据失败: 未知错误")}}async formatGeneratedFiles(e){const s=`npx prettier --write "${e.saveTypeFolderPath}/**/*.{ts,d.ts}"`;try{await l.default.promises.access(e.saveTypeFolderPath);const{stderr:a}=await new Promise(((e,t)=>{o.exec(s,((s,a,r)=>{s?t(s):e({stdout:a,stderr:r})}))}));if(a)throw new Error(a);t.log.success("文件格式化成功")}catch(e){console.log(""),t.log.error("格式化失败,请手动执行以下命令:"),console.log("$",p.default.yellow(s)),console.log("")}}async copyAjaxConfigFiles(e){try{const s=["config.ts","error-message.ts","fetch.ts","api-type.d.ts"],a=u.default.join(__dirname,"..","..","ajax-config"),r=e;for(const e of s){const s=u.default.join(a,e),o=u.default.join(r,e);try{await l.default.promises.access(s);try{await l.default.promises.access(o),t.log.info(`${e} 已存在,跳过生成.`)}catch{await l.default.promises.copyFile(s,o),t.log.success(`${e} create done.`)}}catch(e){t.log.error(`源文件 ${s} 不存在`);continue}}}catch(e){return e}}async initialize(){const e=process.cwd()+"/an.config.json";try{const s=await this.getConfig(e);if(!d)return;await l.default.promises.mkdir(s.saveApiListFolderPath,{recursive:!0}),await this.copyAjaxConfigFiles(s.saveApiListFolderPath),await t.clearDir(s.saveTypeFolderPath),await t.clearDir(s.saveEnumFolderPath),await this.handle(s),await this.formatGeneratedFiles(s)}catch(e){const s=e instanceof Error?e.message:"未知错误";t.log.error(`初始化失败: ${s}`)}}async getConfig(e){try{const t=await l.default.promises.readFile(e,"utf8");return d=!0,JSON.parse(t)}catch(s){return d=!1,t.log.warning("配置文件不存在,将自动创建配置文件。"),await t.writeFileRecursive(e,JSON.stringify(f,null,2)),t.log.success("请查看项目根目录下的 an.config.json 文件"),f}}}if("development"===process.env.NODE_ENV){(new w).initialize()}exports.Main=w;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anl",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "FE command line tool",
5
5
  "main": "bin/an-cli.js",
6
6
  "scripts": {
@@ -8,7 +8,8 @@
8
8
  "build": "rimraf lib && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
9
9
  "pub": "bash publish.sh",
10
10
  "ts": "tsc ./src/int.ts --noEmit --watch",
11
- "blink": "npm run build && npm link"
11
+ "blink": "npm run build && npm link",
12
+ "sync-docs": "node scripts/sync-docs.js"
12
13
  },
13
14
  "bin": {
14
15
  "anl": "bin/an-cli.js"
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="3.0.3",t={title:"Swagger Petstore - OpenAPI 3.0",description:"This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\n_If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click [here](https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml). Alternatively, you can load via the `Edit > Load Petstore OAS 2.0` menu option!_\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)",termsOfService:"http://swagger.io/terms/",contact:{email:"apiteam@swagger.io"},license:{name:"Apache 2.0",url:"http://www.apache.org/licenses/LICENSE-2.0.html"},version:"1.0.11"},s={description:"Find out more about Swagger",url:"http://swagger.io"},r=[{url:"https://petstore3.swagger.io/api/v3"}],a=[{name:"pet",description:"Everything about your Pets",externalDocs:{description:"Find out more",url:"http://swagger.io"}},{name:"store",description:"Access to Petstore orders",externalDocs:{description:"Find out more about our store",url:"http://swagger.io"}},{name:"user",description:"Operations about user"}],o={"/pet":{put:{tags:["pet"],summary:"Update an existing pet",description:"Update an existing pet by Id",operationId:"updatePet",requestBody:{description:"Update an existent pet in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Pet"}}},required:!0},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid ID supplied"},404:{description:"Pet not found"},422:{description:"Validation exception"}},security:[{petstore_auth:["write:pets","read:pets"]}]},post:{tags:["pet"],summary:"Add a new pet to the store",description:"Add a new pet to the store",operationId:"addPet",requestBody:{description:"Create a new pet in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Pet"}}},required:!0},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid input"},422:{description:"Validation exception"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/findByStatus":{get:{tags:["pet"],summary:"Finds Pets by status",description:"Multiple status values can be provided with comma separated strings",operationId:"findPetsByStatus",parameters:[{name:"status",in:"query",description:"Status values that need to be considered for filter",required:!1,explode:!0,schema:{type:"string",default:"available",enum:["available","pending","sold"]}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid status value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/findByTags":{get:{tags:["pet"],summary:"Finds Pets by tags",description:"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",operationId:"findPetsByTags",parameters:[{name:"tags",in:"query",description:"Tags to filter by",required:!1,explode:!0,schema:{type:"array",items:{type:"string"}}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid tag value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/{petId}":{get:{tags:["pet"],summary:"Find pet by ID",description:"Returns a single pet",operationId:"getPetById",parameters:[{name:"petId",in:"path",description:"ID of pet to return",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid ID supplied"},404:{description:"Pet not found"}},security:[{api_key:[]},{petstore_auth:["write:pets","read:pets"]}]},post:{tags:["pet"],summary:"Updates a pet in the store with form data",description:"",operationId:"updatePetWithForm",parameters:[{name:"petId",in:"path",description:"ID of pet that needs to be updated",required:!0,schema:{type:"integer",format:"int64"}},{name:"name",in:"query",description:"Name of pet that needs to be updated",schema:{type:"string"}},{name:"status",in:"query",description:"Status of pet that needs to be updated",schema:{type:"string"}}],responses:{400:{description:"Invalid input"}},security:[{petstore_auth:["write:pets","read:pets"]}]},delete:{tags:["pet"],summary:"Deletes a pet",description:"delete a pet",operationId:"deletePet",parameters:[{name:"api_key",in:"header",description:"",required:!1,schema:{type:"string"}},{name:"petId",in:"path",description:"Pet id to delete",required:!0,schema:{type:"integer",format:"int64"}}],responses:{400:{description:"Invalid pet value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/{petId}/uploadImage":{post:{tags:["pet"],summary:"uploads an image",description:"",operationId:"uploadFile",parameters:[{name:"petId",in:"path",description:"ID of pet to update",required:!0,schema:{type:"integer",format:"int64"}},{name:"additionalMetadata",in:"query",description:"Additional Metadata",required:!1,schema:{type:"string"}}],requestBody:{content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}},responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/ApiResponse"}}}}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/store/inventory":{get:{tags:["store"],summary:"Returns pet inventories by status",description:"Returns a map of status codes to quantities",operationId:"getInventory",responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"object",additionalProperties:{type:"integer",format:"int32"}}}}}},security:[{api_key:[]}]}},"/store/order":{post:{tags:["store"],summary:"Place an order for a pet",description:"Place a new order in the store",operationId:"placeOrder",requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/Order"}}}},responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid input"},422:{description:"Validation exception"}}}},"/store/order/{orderId}":{get:{tags:["store"],summary:"Find purchase order by ID",description:"For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.",operationId:"getOrderById",parameters:[{name:"orderId",in:"path",description:"ID of order that needs to be fetched",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}},delete:{tags:["store"],summary:"Delete purchase order by ID",description:"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",operationId:"deleteOrder",parameters:[{name:"orderId",in:"path",description:"ID of the order that needs to be deleted",required:!0,schema:{type:"integer",format:"int64"}}],responses:{400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}}},"/user":{post:{tags:["user"],summary:"Create user",description:"This can only be done by the logged in user.",operationId:"createUser",requestBody:{description:"Created user object",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/User"}}}},responses:{default:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}}}}},"/user/createWithList":{post:{tags:["user"],summary:"Creates list of users with given input array",description:"Creates list of users with given input array",operationId:"createUsersWithListInput",requestBody:{content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/User"}}}}},responses:{200:{description:"Successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}},default:{description:"successful operation"}}}},"/user/login":{get:{tags:["user"],summary:"Logs user into the system",description:"",operationId:"loginUser",parameters:[{name:"username",in:"query",description:"The user name for login",required:!1,schema:{type:"string"}},{name:"password",in:"query",description:"The password for login in clear text",required:!1,schema:{type:"string"}}],responses:{200:{description:"successful operation",headers:{"X-Rate-Limit":{description:"calls per hour allowed by the user",schema:{type:"integer",format:"int32"}},"X-Expires-After":{description:"date in UTC when token expires",schema:{type:"string",format:"date-time"}}},content:{"application/xml":{schema:{type:"string"}},"application/json":{schema:{type:"string"}}}},400:{description:"Invalid username/password supplied"}}}},"/user/logout":{get:{tags:["user"],summary:"Logs out current logged in user session",description:"",operationId:"logoutUser",parameters:[],responses:{default:{description:"successful operation"}}}},"/user/{username}":{get:{tags:["user"],summary:"Get user by user name",description:"",operationId:"getUserByName",parameters:[{name:"username",in:"path",description:"The name that needs to be fetched. Use user1 for testing. ",required:!0,schema:{type:"string"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}},400:{description:"Invalid username supplied"},404:{description:"User not found"}}},put:{tags:["user"],summary:"Update user",description:"This can only be done by the logged in user.",operationId:"updateUser",parameters:[{name:"username",in:"path",description:"name that need to be deleted",required:!0,schema:{type:"string"}}],requestBody:{description:"Update an existent user in the store",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}},"application/x-www-form-urlencoded":{schema:{$ref:"#/components/schemas/User"}}}},responses:{default:{description:"successful operation"}}},delete:{tags:["user"],summary:"Delete user",description:"This can only be done by the logged in user.",operationId:"deleteUser",parameters:[{name:"username",in:"path",description:"The name that needs to be deleted",required:!0,schema:{type:"string"}}],responses:{400:{description:"Invalid username supplied"},404:{description:"User not found"}}}}},n={schemas:{Order:{type:"object",properties:{id:{type:"integer",format:"int64",example:10},petId:{type:"integer",format:"int64",example:198772},quantity:{type:"integer",format:"int32",example:7},shipDate:{type:"string",format:"date-time"},status:{type:"string",description:"Order Status",example:"approved",enum:["placed","approved","delivered"]},complete:{type:"boolean"}},xml:{name:"order"}},Customer:{type:"object",properties:{id:{type:"integer",format:"int64",example:1e5},username:{type:"string",example:"fehguy"},address:{type:"array",xml:{name:"addresses",wrapped:!0},items:{$ref:"#/components/schemas/Address"}}},xml:{name:"customer"}},Address:{type:"object",properties:{street:{type:"string",example:"437 Lytton"},city:{type:"string",example:"Palo Alto"},state:{type:"string",example:"CA"},zip:{type:"string",example:"94301"}},xml:{name:"address"}},Category:{type:"object",properties:{id:{type:"integer",format:"int64",example:1},name:{type:"string",example:"Dogs"}},xml:{name:"category"}},User:{type:"object",properties:{id:{type:"integer",format:"int64",example:10},username:{type:"string",example:"theUser"},firstName:{type:"string",example:"John"},lastName:{type:"string",example:"James"},email:{type:"string",example:"john@email.com"},password:{type:"string",example:"12345"},phone:{type:"string",example:"12345"},userStatus:{type:"integer",description:"User Status",format:"int32",example:1}},xml:{name:"user"}},Tag:{type:"object",properties:{id:{type:"integer",format:"int64"},name:{type:"string"}},xml:{name:"tag"}},Pet:{required:["name","photoUrls"],type:"object",properties:{id:{type:"integer",format:"int64",example:10},name:{type:"string",example:"doggie"},category:{$ref:"#/components/schemas/Category"},photoUrls:{type:"array",xml:{wrapped:!0},items:{type:"string",xml:{name:"photoUrl"}}},tags:{type:"array",xml:{wrapped:!0},items:{$ref:"#/components/schemas/Tag"}},status:{type:"string",description:"pet status in the store",enum:["available","pending","sold"]}},xml:{name:"pet"}},ApiResponse:{type:"object",properties:{code:{type:"integer",format:"int32"},type:{type:"string"},message:{type:"string"}},xml:{name:"##default"}}},requestBodies:{Pet:{description:"Pet object that needs to be added to the store",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},UserArray:{description:"List of user object",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/User"}}}}}},securitySchemes:{petstore_auth:{type:"oauth2",flows:{implicit:{authorizationUrl:"https://petstore3.swagger.io/oauth/authorize",scopes:{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},api_key:{type:"apiKey",name:"api_key",in:"header"}}},i={openapi:e,info:t,externalDocs:s,servers:r,tags:a,paths:o,components:n};exports.components=n,exports.default=i,exports.externalDocs=s,exports.info=t,exports.openapi=e,exports.paths=o,exports.servers=r,exports.tags=a;