-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* in progress * Update index.ts * done? * Update CONTRIBUTING.md * in progress * done * Update manage-project.ts * Update manage-project.ts * Update manage-project.ts * Update manage-project.ts * Update manage-project.ts * Update CONTRIBUTING.md * Update CONTRIBUTING.md * minor changes * Update CONTRIBUTING.md * Update manage-project.ts * Update manage-project.ts * Update manage-project.ts
- Loading branch information
1 parent
e2a635f
commit f6a5e3d
Showing
23 changed files
with
563 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/guides/discounts_recipes/Give-Items-For-Free-Unit-Discount.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,34 @@ | ||
import * as fs from 'fs/promises' | ||
import path from 'path'; | ||
import './globals.t' | ||
import * as openApi from '../reference/OpenAPI.json'; | ||
import { mdTables } from './md-tables'; | ||
import SchemaToMarkdownTable, {RenderMode, ExamplesRenderedAs} from './src/schema-to-md-table'; | ||
import * as fs from "fs/promises"; | ||
import path from "path"; | ||
import "./globals.t"; | ||
import * as openApi from "../reference/OpenAPI.json"; | ||
import { mdTables } from "./md-tables"; | ||
import SchemaToMarkdownTable, { | ||
RenderMode, | ||
ExamplesRenderedAs, | ||
} from "./src/schema-to-md-table"; | ||
|
||
const PATH_TO_GERENATED_TABLES = [__dirname, './output']; | ||
const PATH_TO_GERENATED_TABLES = [__dirname, "./output"]; | ||
|
||
(async () => { | ||
const stm = new SchemaToMarkdownTable(openApi.components.schemas, RenderMode.List, ExamplesRenderedAs.PartOfDescription); | ||
for(const [objectName] of mdTables){ | ||
try{ | ||
const fileName = `${objectName}.md`; | ||
await fs.writeFile(path.join(...PATH_TO_GERENATED_TABLES, fileName), stm.render(objectName)) | ||
console.log(`Generated markdown table in ${fileName}`) | ||
}catch(e){ | ||
console.log(`Error for ${objectName}`, e) | ||
|
||
} | ||
export const buildMdTablesFromOpenApi = async () => { | ||
const stm = new SchemaToMarkdownTable( | ||
openApi.components.schemas, | ||
RenderMode.List, | ||
ExamplesRenderedAs.PartOfDescription | ||
); | ||
for (const [objectName] of mdTables) { | ||
try { | ||
const fileName = `${objectName}.md`; | ||
await fs.writeFile( | ||
path.join(...PATH_TO_GERENATED_TABLES, fileName), | ||
stm.render(objectName) | ||
); | ||
console.log(`Generated markdown table in ${fileName}`); | ||
} catch (e) { | ||
console.log(`Error for ${objectName}`, e); | ||
} | ||
console.log('done') | ||
})() | ||
} | ||
console.log("done"); | ||
}; | ||
|
||
buildMdTablesFromOpenApi(); |
Oops, something went wrong.