docs: oas (#197)

Adds OpenAPI specification of Storefront and Admin APIs.
Updates docs project.
This commit is contained in:
Sebastian Rindom authored and GitHub committed 2021-03-10 11:51:54 +01:00
1 parent 975de99ee7
commit 8edb32c742
240 files changed
+23592 -419

No files matched your search

@@ -0,0 +1,30 @@
const fs = require("fs").promises;
const path = require("path");
class FixtureWriter {
constructor() {
const resolvedPath = path.resolve("./docs/api/fixtures.json");
const existing = require(resolvedPath);
this.toWrite_ = existing.resources;
this.resolvedPath_ = resolvedPath;
}
addFixture(key, data) {
this.toWrite_ = {
...this.toWrite_,
[key]: data,
};
}
async execute() {
const toSet = {
resources: this.toWrite_,
};
const s = JSON.stringify(toSet, null, 2);
return await fs.writeFile(this.resolvedPath_, s);
}
}
const instance = new FixtureWriter();
export default instance;