Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions config.yaml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate that isn't used. The config file we use is located in resources/generate-from-oas/config.yaml

This file was deleted.

19 changes: 19 additions & 0 deletions src/download/exchangeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,22 @@ export type RawRestApi = Omit<RestApi, "categories" | "fatRaml"> & {
version: string;
}[];
};

export type ExchangeConfig = {
dependencies?: {
version: string;
assetId: string;
groupId: string;
}[];
version: string;
originalFormatVersion: string;
apiVersion: string;
descriptorVersion: string;
classifier: string;
main: string;
assetId: string;
groupId: string;
organizationId: string;
name: string;
tags: string[];
};
2 changes: 1 addition & 1 deletion src/download/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export { extractFiles } from "./exchangeDirectoryParser";
export { groupByCategory, removeRamlLinks } from "./exchangeTools";
export { DownloadCommand } from "./downloadCommand";
export { getBearer } from "./bearerToken";
export { RestApi } from "./exchangeTypes";
export { RestApi, ExchangeConfig } from "./exchangeTypes";
4 changes: 2 additions & 2 deletions src/generate/apiModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "../common/amfParser";

import { Name } from "../common/structures/name";
import { RestApi } from "../download/exchangeTypes";
import { ExchangeConfig, RestApi } from "../download/exchangeTypes";
import path from "path";
import fs from "fs-extra";
import { ramlToolLogger } from "../common/logger";
Expand Down Expand Up @@ -56,7 +56,7 @@ export class ApiModel extends ApiMetadata {
fs.lstatSync(filepath).isDirectory() &&
fs.existsSync(path.join(filepath, "exchange.json"))
) {
const exchangeConfig = fs.readJSONSync(
const exchangeConfig: ExchangeConfig = fs.readJSONSync(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line isn't necessary but I figure that since we've defined ExchangeConfig, we might as well use it in the one place we were reading the exchange.json before.

path.join(filepath, "exchange.json")
);

Expand Down