Skip to content

Instantly share code, notes, and snippets.

@sayanriju
Last active June 18, 2020 13:22
Show Gist options
  • Save sayanriju/b7564786227e60508ed144306403c80d to your computer and use it in GitHub Desktop.
Save sayanriju/b7564786227e60508ed144306403c80d to your computer and use it in GitHub Desktop.
Generate Postman Collection scaffolds from Apidoc documentation
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "airbnb-base",
"rules": {
"func-names": [
"error",
"never"
],
"comma-dangle": [
"error",
"only-multiline"
],
"semi": [
"warn",
"never"
],
"quotes": [
"warn",
"double"
],
"max-len": [
"warn",
{
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"no-console": 1,
"no-unused-vars": 1,
"prefer-const": 1,
"no-var": 1,
"eol-last": 1,
"padded-blocks": 1,
"import/newline-after-import": 0,
"no-underscore-dangle": 0
}
}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# next.js build output
.next
## Editor Stuff
*.kate-swp
*.swp
*.swap
.vscode/
tempCodeRunnerFile.javascript

A simple NPM cli/bin package to generate Postman Collection scaffolds from Apidoc documentations.

Usage

  • cd into a documentation folder generated by the apidoc application. By default, such folders are named docs/ and contain the files api_data.json & api_project.json among others.

  • Run the command npx @sayanriju/apidoc2postman inside the folder. It will write a JSON text to STDOUT, which may be written to a file using the shell's piping mechanism, like so:

    npx @sayanriju/apidoc2postman > ~/myProject.postman_collection.json

  • The ~/myProject.postman_collection.json file may now be imported into Postman as usual. Note that, the imported Postman Collection is just a skeleton/scaffold and as such will need to be heavily edited/fine-tuned.

#! /usr/bin/env node
const API_DATA_FILE = "./api_data.json"
const PROJECT_DATA_FILE = "./api_project.json"
const { readFileSync } = require("fs")
const path = require("path")
const { capitalCase } = require("capital-case")
const { Collection, Item } = require("postman-collection")
// eslint-disable-next-line import/no-dynamic-require
const { bodyBuilder, headerBuilder } = require(path.resolve(__dirname, "./lib.js"))
const { name: projectName, description: projectDescription } = JSON.parse(readFileSync(PROJECT_DATA_FILE))
const apiData = JSON.parse(readFileSync(API_DATA_FILE))
.filter((item) => ["GET", "POST", "PUT", "PATCH", "DELETE"].includes(item.type.toUpperCase()))
const folders = [...new Set(apiData.map((item) => item.group))]
const postmanCollection = new Collection({
info: {
name: capitalCase(projectName || "MyProject"), description: projectDescription || projectName
},
item: folders.map((folder) => ({
id: folder, // unique!!
name: capitalCase(folder || `folder-${Date.now()}`),
item: [] // this implies an empty folder
}))
})
apiData.forEach((el) => postmanCollection.items.one(el.group).items.add(new Item({
name: capitalCase(el.name || "API Request"),
request: {
description: el.title,
url: `{{apiRoot}}${el.url}`,
method: el.type ? el.type.toUpperCase() : "GET",
header: headerBuilder(el),
body: { mode: "raw", raw: bodyBuilder(el) }
}
})))
postmanCollection.variables.add({
id: "jwt",
value: "XX.YYY.ZZZZZ",
type: "string"
})
postmanCollection.variables.add({
id: "apiRoot",
value: "http://localhost:3000",
type: "string"
})
console.log(JSON.stringify(postmanCollection, null, 2))
function transformNestedObjectParameters(paramsData) {
const objFields = paramsData
.filter((el) => el.field !== undefined && el.type !== undefined)
.filter((el) => el.type.toLowerCase().replace(/\[|\]/g, "").startsWith("object") && !el.field.includes("."))
.map((el) => ({ ...el, children: [] }))
const nonObjFields = paramsData
.filter((el) => el.field !== undefined && el.type !== undefined)
.filter((el) => !el.type.toLowerCase().replace(/\[|\]/g, "").startsWith("object") || el.field.includes("."))
.reduce((acc, cur) => {
if (cur.field.includes(".")) { // a child element
const parentField = cur.field.split(".")[0]
const parent = objFields.find((el) => el.field === parentField)
if (parent === undefined) return acc
parent.children.push({ ...cur, field: cur.field.replace(`${parentField}.`, "") })
} else {
acc.push(cur) // non child, non parent field
}
return acc
}, [])
return [...objFields, ...nonObjFields]
}
function bodyBuilder(data) {
if (data.url === undefined || data.parameter === undefined || data.parameter.fields === undefined || !Array.isArray(data.parameter.fields.Parameter)) return
const dummyDefaultValues = {
string: "",
number: 1,
"string[]": ["", ""],
"[string]": ["", ""],
"number[]": [1, 2],
"[number]": [1, 2],
boolean: true,
bool: true,
date: "2020-06-05T10:28:27.954Z",
datetime: "2020-06-05T10:28:27.954Z",
// for child objects:
object: {},
"object[]": [{}]
}
const urlParams = data.url.split("/").filter((c) => c.includes(":")).map((c) => c.replace(":", ""))
const bodyObj = transformNestedObjectParameters(data.parameter.fields.Parameter)
.filter((el) => el.group === "Parameter")
.filter((el) => !urlParams.includes(el.field)) // don't put the url params in body json
.reduce((acc, cur) => {
if (cur.type.toLowerCase().replace(/\[|\]/g, "").startsWith("object")) {
const childObj = cur.children.reduce((a, c) => {
if (c.field.includes(".")) return a // ignore deeper nesting
a[c.field] = c.defaultValue || dummyDefaultValues[c.type.toLowerCase()]
return a
}, {})
acc[cur.field.replace(/\[|\]/g, "")] = (cur.type.endsWith("]")) ? [childObj] : childObj
} else {
let { defaultValue } = cur
if (defaultValue !== undefined) {
if (cur.type.toLowerCase() === "number") defaultValue = Number(defaultValue)
else if (cur.type.toLowerCase() === "boolean") defaultValue = Boolean(defaultValue)
else if (cur.type.toLowerCase() === "string") defaultValue = String(defaultValue)
}
acc[cur.field] = defaultValue || dummyDefaultValues[cur.type.toLowerCase()]
}
return acc
}, {})
return JSON.stringify(bodyObj, null, 2)
}
function headerBuilder(data) {
if (data.header === undefined || data.header.fields === undefined || !Array.isArray(data.header.fields.Header)) {
return [{
key: "Content-Type",
value: "application/json"
}]
}
const headerArr = data.header.fields.Header
.filter((el) => el.group === "Header" && el.field !== undefined)
.map((el) => ({
key: el.field,
value: el.defaultValue || (el.field.toLowerCase() === "authorization")
? "Bearer {{jwt}}"
: ""
}))
return [...headerArr, {
key: "Content-Type",
value: "application/json"
}]
}
module.exports = {
bodyBuilder,
headerBuilder
}
{
"name": "@sayanriju/apidoc2postman",
"version": "1.1.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"requires": {
"color-convert": "^1.9.0"
}
},
"array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY="
},
"capital-case": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.3.tgz",
"integrity": "sha512-OlUSJpUr7SY0uZFOxcwnDOU7/MpHlKTZx2mqnDYQFrDudXLFm0JJ9wr/l4csB+rh2Ug0OPuoSO53PqiZBqno9A==",
"requires": {
"no-case": "^3.0.3",
"tslib": "^1.10.0",
"upper-case-first": "^2.0.1"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"charset": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/charset/-/charset-1.0.1.tgz",
"integrity": "sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg=="
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"dom-serializer": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
"integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==",
"requires": {
"domelementtype": "^2.0.1",
"entities": "^2.0.0"
},
"dependencies": {
"domelementtype": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz",
"integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ=="
},
"entities": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
"integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ=="
}
}
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
"integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w=="
},
"domhandler": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
"integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
"requires": {
"domelementtype": "1"
}
},
"domutils": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
"integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
"requires": {
"dom-serializer": "0",
"domelementtype": "1"
}
},
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"faker": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/faker/-/faker-4.1.0.tgz",
"integrity": "sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8="
},
"file-type": {
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
},
"htmlparser2": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
"integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
"requires": {
"domelementtype": "^1.3.1",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.1.1"
}
},
"http-reasons": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/http-reasons/-/http-reasons-0.1.0.tgz",
"integrity": "sha1-qVPKZwB4Zp3eFCzomUAbnW6F07Q="
},
"iconv-lite": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.1.tgz",
"integrity": "sha512-ONHr16SQvKZNSqjQT9gy5z24Jw+uqfO02/ngBSBoqChZ+W8qXX7GPRa1RoUnzGADw8K63R1BXUMzarCVQBpY8Q==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"liquid-json": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/liquid-json/-/liquid-json-0.3.1.tgz",
"integrity": "sha1-kVWhgTbYprJhXl8W+aJEira1Duo="
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
},
"lodash.escaperegexp": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz",
"integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c="
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.isstring": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
"integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
},
"lodash.mergewith": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz",
"integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ=="
},
"lower-case": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz",
"integrity": "sha512-LiWgfDLLb1dwbFQZsSglpRj+1ctGnayXz3Uv0/WO8n558JycT5fg6zkNcnW0G68Nn0aEldTFeEfmjCfmqry/rQ==",
"requires": {
"tslib": "^1.10.0"
}
},
"marked": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz",
"integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng=="
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
},
"mime-format": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mime-format/-/mime-format-2.0.0.tgz",
"integrity": "sha1-4p+IkeKE14JwJG8AUNaDS9u+EzI=",
"requires": {
"charset": "^1.0.0"
}
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"requires": {
"mime-db": "1.44.0"
}
},
"no-case": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz",
"integrity": "sha512-ehY/mVQCf9BL0gKfsJBvFJen+1V//U+0HQMPrWct40ixE4jnv0bfvxDbWtAHL9EcaPEOJHVVYKoQn1TlZUB8Tw==",
"requires": {
"lower-case": "^2.0.1",
"tslib": "^1.10.0"
}
},
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"postcss": {
"version": "7.0.32",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",
"integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==",
"requires": {
"chalk": "^2.4.2",
"source-map": "^0.6.1",
"supports-color": "^6.1.0"
},
"dependencies": {
"supports-color": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
"integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"postman-collection": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-3.6.1.tgz",
"integrity": "sha512-e83B3pEfQok+ZhLwfvg9+rNBo9SQ1xIJE95VaBQPnPRVUYHj9UEcMspwdDfN22KjGnYxCCIEfw9ZYFdMDpJ44w==",
"requires": {
"escape-html": "1.0.3",
"faker": "4.1.0",
"file-type": "3.9.0",
"http-reasons": "0.1.0",
"iconv-lite": "0.5.1",
"liquid-json": "0.3.1",
"lodash": "4.17.15",
"marked": "1.0.0",
"mime-format": "2.0.0",
"mime-types": "2.1.27",
"postman-url-encoder": "2.1.1",
"sanitize-html": "1.20.1",
"semver": "7.3.2",
"uuid": "8.0.0"
}
},
"postman-url-encoder": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/postman-url-encoder/-/postman-url-encoder-2.1.1.tgz",
"integrity": "sha512-WxXvA3pWupcboNylMpBRO3U3aUmPP6kIftN9GtNOEoXiHWx5vuCHTSw1+eQDj4vHWe4UuwJYN3K0BLAqTsXi8w==",
"requires": {
"postman-collection": "^3.6.0",
"punycode": "^2.1.1"
}
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sanitize-html": {
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.20.1.tgz",
"integrity": "sha512-txnH8TQjaQvg2Q0HY06G6CDJLVYCpbnxrdO0WN8gjCKaU5J0KbyGYhZxx5QJg3WLZ1lB7XU9kDkfrCXUozqptA==",
"requires": {
"chalk": "^2.4.1",
"htmlparser2": "^3.10.0",
"lodash.clonedeep": "^4.5.0",
"lodash.escaperegexp": "^4.1.2",
"lodash.isplainobject": "^4.0.6",
"lodash.isstring": "^4.0.1",
"lodash.mergewith": "^4.6.1",
"postcss": "^7.0.5",
"srcset": "^1.0.0",
"xtend": "^4.0.1"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"srcset": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz",
"integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=",
"requires": {
"array-uniq": "^1.0.2",
"number-is-nan": "^1.0.0"
}
},
"string_decoder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": {
"safe-buffer": "~5.2.0"
}
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"requires": {
"has-flag": "^3.0.0"
}
},
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
},
"upper-case-first": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.1.tgz",
"integrity": "sha512-105J8XqQ+9RxW3l9gHZtgve5oaiR9TIwvmZAMAIZWRHe00T21cdvewKORTlOJf/zXW6VukuTshM+HXZNWz7N5w==",
"requires": {
"tslib": "^1.10.0"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"uuid": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz",
"integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw=="
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
}
}
}
{
"name": "@sayanriju/apidoc2postman",
"description": "A tool to generate Postman Collection scaffolds from Apidoc documentation.",
"version": "1.1.7",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"postman",
"postman collection",
"apidoc"
],
"dependencies": {
"capital-case": "^1.0.3",
"postman-collection": "^3.6.1"
},
"author": "Sayan \"Riju\" Chakrabarti <[email protected]>",
"license": "MIT",
"homepage": "https://gist.github.com/sayanriju/ed14ef9bcae9b9188833e583313b0d21",
"repository": {
"type": "gist",
"url": "https://gist.github.com/sayanriju/ed14ef9bcae9b9188833e583313b0d21"
},
"bin": {
"@sayanriju/apidoc2postman": "./bin.js",
"apidoc2postman": "./bin.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment