import z from "zod"; import { ServiceClient } from "../../service-client"; import { CreateAppSchema, CreateModuleSchema, CreatePageSchema, CreatePageSchemaSchema, GetAppSchema, GetPageBySlugSchema, GetPageSchemaSchema, GetPublishedSettingsSchema, ListAppsSchema, ListModulesSchema, ListPagesSchema, PublishAppSchema, ResolvePublishedRouteSchema, UpdateAppSchema, UpdateEditorConfigSchema, UpdatePageSchemaSchema } from "./schema"; import { App, Config, Module, Page, PageSchema, PublishedRouteResponse, PublishedSettingsResponse, PublishAppResult } from "./types"; export class BuilderService extends ServiceClient { protected getServiceName(): string { return 'com.appconda.service.builder'; } public async CreateApp(payload: z.infer): Promise { return await this.actionCall('app', 'CreateApp', payload); } public async UpdateApp(payload: z.infer): Promise { return await this.actionCall('app', 'UpdateApp', payload); } public async UpdateEditorConfig(payload: z.infer): Promise { return await this.actionCall('editor', 'UpdateEditorConfig', {config : payload}); } public async GetEditorConfig(): Promise { return await this.actionCall('editor', 'GetEditorConfig', {}); } public async GetApp(payload: z.infer): Promise { return await this.actionCall('app', 'GetApp', payload); } public async ListApps(payload: z.infer): Promise { return this.actionCall('app', 'ListApps', payload); } public async ListProjects(payload: z.infer): Promise { return this.actionCall('project', 'ListProjects', payload); } public async CreatePage(payload: z.infer): Promise { return await this.actionCall('page', 'CreatePage', payload); } public async ListPages(payload: z.infer): Promise { return this.actionCall('page', 'ListPages', payload); } public async CreatePageSchema(payload: z.infer): Promise { return await this.actionCall('page', 'CreatePageSchema', payload); } public async UpdatePageSchema(payload: z.infer): Promise { return await this.actionCall('page', 'UpdatePageSchema', payload); } public async GetPageSchema(payload: z.infer): Promise { return await this.actionCall('page', 'GetPageSchema', payload); } public async CreateModule(payload: z.infer): Promise { return await this.actionCall('module', 'CreateModule', payload); } public async ListModules(payload: z.infer): Promise { return this.actionCall('module', 'ListModules', payload); } public async GetPageBySlug(payload: z.infer): Promise { return this.actionCall('publish', 'GetPageBySlug', payload); } public async PublishApp(payload: z.infer): Promise { return this.actionCall('publish', 'PublishApp', payload); } public async GetPublishedSettings(payload: z.infer): Promise { return this.actionCall('publish', 'GetPublishedSettings', payload); } public async ResolvePublishedRoute(payload: z.infer): Promise { return this.actionCall('publish', 'ResolvePublishedRoute', payload); } }