mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-17 03:04:20 +00:00
feat: add plugin extension pages (iframe rendering, Page SDK, security hardening, i18n)
Co-Authored-By: Typer_Body <mcjiekejiemi@163.com>
This commit is contained in:
@@ -596,6 +596,27 @@ export class BackendClient extends BaseHttpClient {
|
||||
);
|
||||
}
|
||||
|
||||
public async pluginPageApi(
|
||||
author: string,
|
||||
name: string,
|
||||
pageId: string,
|
||||
endpoint: string,
|
||||
method: string = 'POST',
|
||||
body?: unknown,
|
||||
): Promise<unknown> {
|
||||
const resp = await this.instance.request({
|
||||
url: `/api/v1/plugins/${author}/${name}/page-api`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
page_id: pageId,
|
||||
endpoint,
|
||||
method,
|
||||
body,
|
||||
},
|
||||
});
|
||||
return resp.data?.data;
|
||||
}
|
||||
|
||||
public getPluginIconURL(author: string, name: string): string {
|
||||
if (this.instance.defaults.baseURL === '/') {
|
||||
const url = window.location.href;
|
||||
|
||||
Reference in New Issue
Block a user