Provide applicatiion assets (#18973)
- improve backend - improve frontend <img width="1293" height="824" alt="image" src="https://github.com/user-attachments/assets/7a4633f1-85cd-4126-b058-dbeae6ba2218" />
This commit is contained in:
@@ -66,6 +66,10 @@ export class ApiService {
|
||||
return this.applicationApi.uninstallApplication(universalIdentifier);
|
||||
}
|
||||
|
||||
syncMarketplaceCatalog(): Promise<ApiResponse<boolean>> {
|
||||
return this.applicationApi.syncMarketplaceCatalog();
|
||||
}
|
||||
|
||||
getSchema(options?: { authToken?: string }): Promise<ApiResponse<string>> {
|
||||
return this.schemaApi.getSchema(options);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,44 @@ import { type Manifest } from 'twenty-shared/application';
|
||||
export class ApplicationApi {
|
||||
constructor(private readonly client: AxiosInstance) {}
|
||||
|
||||
async syncMarketplaceCatalog(): Promise<ApiResponse<boolean>> {
|
||||
try {
|
||||
const query = `
|
||||
mutation SyncMarketplaceCatalog {
|
||||
syncMarketplaceCatalog
|
||||
}
|
||||
`;
|
||||
|
||||
const response = await this.client.post(
|
||||
'/metadata',
|
||||
{ query },
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: '*/*',
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
if (response.data.errors) {
|
||||
return {
|
||||
success: false,
|
||||
error: response.data.errors[0],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: response.data.data.syncMarketplaceCatalog,
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
error,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async findApplicationRegistrationByUniversalIdentifier(
|
||||
universalIdentifier: string,
|
||||
): Promise<
|
||||
@@ -63,7 +101,6 @@ export class ApplicationApi {
|
||||
|
||||
async createApplicationRegistration(input: {
|
||||
name: string;
|
||||
description?: string;
|
||||
universalIdentifier: string;
|
||||
}): Promise<
|
||||
ApiResponse<{
|
||||
|
||||
Reference in New Issue
Block a user