{"id":15773984,"url":"https://github.com/allienx/wrapman","last_synced_at":"2025-08-10T06:43:27.559Z","repository":{"id":222256136,"uuid":"756716985","full_name":"allienx/wrapman","owner":"allienx","description":"Postman API request collection wrapper that generates an axios http client 🎁","archived":false,"fork":false,"pushed_at":"2024-02-26T05:22:45.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-08-10T06:43:26.199Z","etag":null,"topics":["api","axios","collection","http","postman","requests"],"latest_commit_sha":null,"homepage":"","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/allienx.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T06:58:20.000Z","updated_at":"2024-02-16T06:08:00.000Z","dependencies_parsed_at":"2024-10-25T20:09:01.238Z","dependency_job_id":"aafa4812-a120-4167-9862-e08d3eab4224","html_url":"https://github.com/allienx/wrapman","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"ff81649e0402deb77c003731ae3dae342324ba9e"},"previous_names":["allienx/wrapman"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/allienx/wrapman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allienx%2Fwrapman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allienx%2Fwrapman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allienx%2Fwrapman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allienx%2Fwrapman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allienx","download_url":"https://codeload.github.com/allienx/wrapman/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allienx%2Fwrapman/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688004,"owners_count":24459396,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","axios","collection","http","postman","requests"],"created_at":"2024-10-04T16:04:19.497Z","updated_at":"2025-08-10T06:43:27.492Z","avatar_url":"https://github.com/allienx.png","language":"TypeScript","readme":"# wrapman 🎁\n\nPostman API request collection wrapper that generates an axios http client.\n\n## Usage\n\n```sh\nnpm i wrapman\n\n# Generate a flattened JSON file\nnpx wrapman -i path/to/postman-collection.json -d data\n\n# Read the source collection from a URL\nnpx wrapman -i https://api.com/my/collection/json --url -d data\n```\n\nImport the flattened JSON file and initialize an API client.\n\n```js\nimport { WrapmanApiClient } from 'wrapman'\nimport wrapmanJson from 'data/wrapman.json'\n\nconst apiClient = new WrapmanApiClient({\n  collection: wrapmanJson\n})\n\n// Wraps axios.request.\n// https://axios-http.com/docs/res_schema\n// https://axios-http.com/docs/handling_errors\nconst res = await apiClient.request('Pet Store Collection::Pet::Get Pet')\n```\n\n## Programmatically\n\nIf the CLI doesn't work for you, generate the flattened collection yourself.\n\n```js\nimport { Wrapman } from 'wrapman'\n\nconst wrapman = new Wrapman({\n  collectionPath: 'path/to/postman-collection.json'\n})\n\nconst flattenedJson = await wrapman.flatten()\n\n// Do something fancy with flattenedJson.\n```\n\n## Request IDs\n\nGiven a postman collection like the [Pet Store](https://www.postman.com/schude/workspace/petstore/collection/14574125-2e916d97-e26f-42d5-a20d-4b34b25498f8):\n\n```\nPet Store Collection/\n  Pet/\n    Create Pet\n    Get Pet\n    Update Pet\n    Get Pet After Update\n    Delete Pet\n    Get Pet After Delete\n```\n\nWrapman will generate an API client with request IDs that mimic the collection folder hierarchy, joined by `::`\n\n```js\nawait apiClient.request('Pet Store Collection::Pet::Create Pet', {\n  data: {\n    name: 'Fido',\n    type: 'dog'\n  }\n})\n\nawait apiClient.request('Pet Store Collection::Pet::Get Pet', {\n  vars: {\n    pet_id: 123\n  }\n})\n```\n\n## Variables and Prefix\n\nGiven a request ID `Pet Store Collection::Pet::Get Pet` and a request url `{{url}}/pet/{{pet_id}}`,\nyou can simplify API client usage with base variable replacement and a prefix.\n\n```js\nimport { WrapmanApiClient } from 'wrapman'\nimport wrapmanJson from 'data/wrapman.json'\n\nconst apiClient = new WrapmanApiClient({\n  collection: wrapmanJson,\n  prefix: 'Pet Store Collection',\n  vars: {\n    url: 'https://petstore.swagger.io/v2'\n  }\n})\n\nawait apiClient.request('Pet::Get Pet', {\n  vars: {\n    pet_id: 123\n  }\n})\n\n// GET https://petstore.swagger.io/v2/pet/123\n```\n\nHappy wrapping! 🌯\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallienx%2Fwrapman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallienx%2Fwrapman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallienx%2Fwrapman/lists"}