Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdb3c27637 | |||
| d11adfc704 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartswagger",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartswagger",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "^10.0.3",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartswagger",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"private": false,
|
||||
"description": "a swagger tookit for working with swagger files",
|
||||
"main": "dist_ts/index.js",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartswagger from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(smartswagger.standardExport);
|
||||
console.log(smartswagger);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
||||
@@ -85,7 +85,7 @@ export class Smartswagger {
|
||||
/**
|
||||
* merges a document from url
|
||||
*/
|
||||
public async mergeDocumentFromUrl(documentUrlArg: string, basePathArg: string) {
|
||||
public async mergeDocumentFromUrl(documentUrlArg: string, basePathArg: string = '') {
|
||||
console.log(`getting document at ${documentUrlArg} for merging...`)
|
||||
const documentResponse = await plugins.nodeFetch(documentUrlArg, {
|
||||
headers: {
|
||||
@@ -98,6 +98,18 @@ export class Smartswagger {
|
||||
await this.mergeDocument(apiDoc, basePathArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* merge multiple documents in parallel
|
||||
* @param urlArrayArg
|
||||
*/
|
||||
public async mergeManyDocumentsFromUrl(urlArrayArg: {url: string, basePath: string}[]) {
|
||||
const promiseArray: Promise<void>[] = [];
|
||||
for (const urlArg of urlArrayArg) {
|
||||
promiseArray.push(this.mergeDocumentFromUrl(urlArg.url, urlArg.basePath));
|
||||
};
|
||||
await Promise.all(promiseArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* merges a component to routes based on regex
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user