FastAPI backend (Python 3.11, MSSQL ODBC for SambaPOS, Azure DI OCR),
kitchen_db on central PG. React/TS/Vite frontend with navy sidebar layout.
Backend: auth.py (APP_SLUG=kitchen, SimpleNamespace — archive routes use
.kitchen_id/.is_admin without modification), main.py (51 migrations, scheduler,
internal router for KDS bookings feed), api/internal.py, full archive API
(31 routers: invoices, recipes, menus, sambapos, resos, newbook, disputes,
purchase_orders, etc.), models, migrations, OCR pipeline.
kitchen_id pinned to 1 (B1 — single hotel).
Frontend: AuthGate (app=kitchen, token shim for archive compat — B5b pending),
Layout (navy sidebar, 6 sections, Lucide icons, teal --app-primary),
App.tsx (Outlet pattern, UploadApp outside Layout), index.css (full :root block).
strict: false — archive components have type issues; build clean.
Note: 45 archive components call fetch('/api/...') without /kitchen/ prefix
(B5b). Runtime 404s; deferred until after initial testing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
1.5 KiB
JavaScript
61 lines
1.5 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.statements = exports.statement = exports.smart = exports.program = exports.expression = void 0;
|
|
var _t = require("@babel/types");
|
|
const {
|
|
assertExpressionStatement
|
|
} = _t;
|
|
function makeStatementFormatter(fn) {
|
|
return {
|
|
code: str => `/* @babel/template */;\n${str}`,
|
|
validate: () => {},
|
|
unwrap: ast => {
|
|
return fn(ast.program.body.slice(1));
|
|
}
|
|
};
|
|
}
|
|
const smart = exports.smart = makeStatementFormatter(body => {
|
|
if (body.length > 1) {
|
|
return body;
|
|
} else {
|
|
return body[0];
|
|
}
|
|
});
|
|
const statements = exports.statements = makeStatementFormatter(body => body);
|
|
const statement = exports.statement = makeStatementFormatter(body => {
|
|
if (body.length === 0) {
|
|
throw new Error("Found nothing to return.");
|
|
}
|
|
if (body.length > 1) {
|
|
throw new Error("Found multiple statements but wanted one");
|
|
}
|
|
return body[0];
|
|
});
|
|
const expression = exports.expression = {
|
|
code: str => `(\n${str}\n)`,
|
|
validate: ast => {
|
|
if (ast.program.body.length > 1) {
|
|
throw new Error("Found multiple statements but wanted one");
|
|
}
|
|
if (expression.unwrap(ast).start === 0) {
|
|
throw new Error("Parse result included parens.");
|
|
}
|
|
},
|
|
unwrap: ({
|
|
program
|
|
}) => {
|
|
const [stmt] = program.body;
|
|
assertExpressionStatement(stmt);
|
|
return stmt.expression;
|
|
}
|
|
};
|
|
const program = exports.program = {
|
|
code: str => str,
|
|
validate: () => {},
|
|
unwrap: ast => ast.program
|
|
};
|
|
|
|
//# sourceMappingURL=formatters.js.map
|