{"id":18470820,"url":"https://github.com/nefe/swag-engine","last_synced_at":"2025-04-08T11:32:00.441Z","repository":{"id":57375797,"uuid":"121945006","full_name":"nefe/swag-engine","owner":"nefe","description":"auto generate awesome API code using swagger","archived":false,"fork":false,"pushed_at":"2018-05-23T06:05:13.000Z","size":58,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-04T08:48:35.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nefe.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-18T11:21:12.000Z","updated_at":"2019-04-04T08:10:20.000Z","dependencies_parsed_at":"2022-08-29T17:00:37.010Z","dependency_job_id":null,"html_url":"https://github.com/nefe/swag-engine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nefe%2Fswag-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nefe%2Fswag-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nefe%2Fswag-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nefe%2Fswag-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nefe","download_url":"https://codeload.github.com/nefe/swag-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223317849,"owners_count":17125605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:14:57.417Z","updated_at":"2024-11-06T10:14:57.504Z","avatar_url":"https://github.com/nefe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swag-engine\n\nswagger2ts transfer Swagger docs to a controller, which help you write your owner API code and definetion\n\n## usage\n\n### use in code\n\n```typescript\nimport { Cmd } from 'swag-engine';\n\nconst cmd = new Cmd(rootPath?, customConfig?);\n\n(async function() {\n  // sync remote docs data\n  await cmd.ready();\n\n  // get docs update information\n  const { boDiffs, modDiffs } = cmd.diff();\n\n  // boDiffs.details: string[] modDiffs.details: string[]\n\n  // update docs information\n  cmd.updateMod(mod);\n  cmd.updateBo(bo);\n  cmd.updateAll();\n\n  // write API code with docs information\n  cmd.write();\n\n  // data persistence to swag.lock like yarn.lock\n  cmd.save();\n\n  // reget new docs information\n  await cmd.syncNew();\n}())\n```\n\n### use as cmd\n\n#### config\n\n* originUrl(string)\n\nswagger api url\n\n* outDir(string)\n\nauto generate code file path\n\n* templatePath(string)\n\nyour custom template path\n\n* prettierConfig(object)\n\ngenerated code is formatted by prettier, your can config your prettier style here;\n\n* lockPath(string)\n\nlock file path, swag-engine lock the current code version use a lockFile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnefe%2Fswag-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnefe%2Fswag-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnefe%2Fswag-engine/lists"}