diff --git a/assets/openapi.json b/assets/openapi.json index a602ea6b..28880401 100644 Binary files a/assets/openapi.json and b/assets/openapi.json differ diff --git a/assets/schemas.json b/assets/schemas.json index 4f1d2cab..656a9e9d 100644 Binary files a/assets/schemas.json and b/assets/schemas.json differ diff --git a/scripts/schema.js b/scripts/schema.js index 11faefba..32af357f 100644 --- a/scripts/schema.js +++ b/scripts/schema.js @@ -20,6 +20,14 @@ Regenerates the `spacebarchat/server/assets/schemas.json` file, used for API/Gateway input validation. */ +const conWarn = console.warn; +console.warn = (...args) => { + // silence some expected warnings + if (args[0] === "initializer is expression for property id") return; + if (args[0].startsWith("unknown initializer for property ") && args[0].endsWith("[object Object]")) return; + conWarn(...args); +} + const path = require("path"); const fs = require("fs"); const TJS = require("typescript-json-schema"); @@ -35,6 +43,10 @@ const settings = { defaultProps: false, }; +const ExcludeAndWarn = [ + /^Record/, + /^Partial/, +] const Excluded = [ "DefaultSchema", "Schema", @@ -62,6 +74,21 @@ const Excluded = [ "AnySchema", "SMTPConnection.CustomAuthenticationResponse", "TransportMakeRequestResponse", + // Emma [it/its] @ Rory& - 2025-10-14 + /.*\..*/, + /^Axios.*/, + /^APIKeyConfiguration\..*/, + /^AccountSetting\..*/, + /^BulkContactManagement\..*/, + /^Campaign.*/, + /^Contact.*/, + /^DNS\..*/, + /^Delete.*/, + /^Destroy.*/, + /^Template\..*/, + /^Webhook\..*/, + /^(BigDecimal|BigInteger|Blob|Boolean|Document|Error|LazyRequest|List|Map|Normalized|Numeric)Schema/, + /^Put/ ]; function main() { @@ -74,16 +101,24 @@ function main() { let schemas = generator.getUserSymbols().filter((x) => { return ( - (x.endsWith("Schema") || - x.endsWith("Response") || - x.startsWith("API")) && - !Excluded.includes(x) + ( + x.endsWith("Schema") + ||x.endsWith("Response") + || x.startsWith("API") + ) + && !ExcludeAndWarn.some(exc => { + const match = exc instanceof RegExp ? exc.test(x) : x === exc; + if (match) console.warn("Warning: Excluding schema", x); + return match; + }) + && !Excluded.some(exc => exc instanceof RegExp ? exc.test(x) : x === exc) ); }); var definitions = {}; for (const name of schemas) { + console.log("Processing schema", name); const part = TJS.generateSchema(program, name, settings, [], generator); if (!part) continue; @@ -134,7 +169,7 @@ function deleteOneOfKindUndefinedRecursive(obj, path) { delete obj[key]; } } - + return false; } diff --git a/src/api/routes/store/published-listings/applications/#application_id/index.ts b/src/api/routes/store/published-listings/applications/#application_id/index.ts index 5bc02cbd..eb2df64e 100644 --- a/src/api/routes/store/published-listings/applications/#application_id/index.ts +++ b/src/api/routes/store/published-listings/applications/#application_id/index.ts @@ -17,7 +17,7 @@ */ import { Request, Response, Router } from "express"; -import { route } from "api"; +import { route } from "@spacebar/api"; const router: Router = Router({ mergeParams: true }); @@ -32,7 +32,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { type: 1, dependent_sku_id: null, application_id: "", - manifets_labels: [], + manifest_labels: [], access_type: 2, name: "", features: [], diff --git a/src/util/schemas/responses/TeamListResponse.ts b/src/util/schemas/responses/TeamListResponse.ts index c4a7d177..e4e8284e 100644 --- a/src/util/schemas/responses/TeamListResponse.ts +++ b/src/util/schemas/responses/TeamListResponse.ts @@ -18,5 +18,4 @@ import { Team } from "@spacebar/util"; -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface TeamListResponse extends Array {} +export type TeamListResponse = Team[];