fix(core): update
This commit is contained in:
parent
cf230c5b44
commit
d11adfc704
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user