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
12 changes: 8 additions & 4 deletions src/lib/utils/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,17 @@ export function getSchema(id: string, api: OpenAPIV3.Document): OpenAPIV3.Schema
throw new Error("Schema doesn't exist");
}

const specs = import.meta.glob('$appwrite/app/config/specs/open-api3*-(client|server).json', {
as: 'raw'
});
const specs = import.meta.glob(
'$appwrite/app/config/specs/open-api3*-(client|server|console).json',
{
as: 'raw'
}
);
async function getSpec(version: string, platform: string) {
const isClient = platform.startsWith('client-');
const isServer = platform.startsWith('server-');
const target = `/node_modules/@appwrite.io/repo/app/config/specs/open-api3-${version}-${
isServer ? 'server' : 'client'
isServer ? 'server' : isClient ? 'client' : 'console'
}.json`;
return specs[target]();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Model = {

export const load: PageServerLoad = async ({ params }) => {
const version = params.version === 'cloud' ? '1.4.x' : params.version;
const api = await getApi(version, 'server-nodejs');
const api = await getApi(version, 'console-web');
const schema = getSchema(params.model, api);
const props = Object.entries(schema.properties ?? {});
const model: Model = {
Expand Down