mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
merge: upstream/dev with migration renumbering
This commit is contained in:
commit
a7145b2c63
176 changed files with 8791 additions and 3608 deletions
|
|
@ -233,6 +233,29 @@ class ConnectorsApiService {
|
|||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* List Composio Google Drive folders and files
|
||||
*/
|
||||
listComposioDriveFolders = async (request: ListGoogleDriveFoldersRequest) => {
|
||||
const parsedRequest = listGoogleDriveFoldersRequest.safeParse(request);
|
||||
|
||||
if (!parsedRequest.success) {
|
||||
console.error("Invalid request:", parsedRequest.error);
|
||||
|
||||
const errorMessage = parsedRequest.error.issues.map((issue) => issue.message).join(", ");
|
||||
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
||||
}
|
||||
|
||||
const { connector_id, parent_id } = parsedRequest.data;
|
||||
|
||||
const queryParams = parent_id ? `?parent_id=${encodeURIComponent(parent_id)}` : "";
|
||||
|
||||
return baseApiService.get(
|
||||
`/api/v1/connectors/${connector_id}/composio-drive/folders${queryParams}`,
|
||||
listGoogleDriveFoldersResponse
|
||||
);
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
// MCP Connector Methods
|
||||
// =============================================================================
|
||||
|
|
|
|||
29
surfsense_web/lib/apis/incentive-tasks-api.service.ts
Normal file
29
surfsense_web/lib/apis/incentive-tasks-api.service.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import {
|
||||
type CompleteTaskResponse,
|
||||
completeTaskResponse,
|
||||
type GetIncentiveTasksResponse,
|
||||
getIncentiveTasksResponse,
|
||||
type IncentiveTaskTypeEnum,
|
||||
} from "@/contracts/types/incentive-tasks.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
class IncentiveTasksApiService {
|
||||
/**
|
||||
* Get all available incentive tasks with completion status
|
||||
*/
|
||||
getTasks = async (): Promise<GetIncentiveTasksResponse> => {
|
||||
return baseApiService.get("/api/v1/incentive-tasks", getIncentiveTasksResponse);
|
||||
};
|
||||
|
||||
/**
|
||||
* Mark a task as completed and receive page reward
|
||||
*/
|
||||
completeTask = async (taskType: IncentiveTaskTypeEnum): Promise<CompleteTaskResponse> => {
|
||||
return baseApiService.post(
|
||||
`/api/v1/incentive-tasks/${taskType}/complete`,
|
||||
completeTaskResponse
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export const incentiveTasksApiService = new IncentiveTasksApiService();
|
||||
|
|
@ -16,11 +16,15 @@ export const getConnectorTypeDisplay = (type: string): string => {
|
|||
GOOGLE_CALENDAR_CONNECTOR: "Google Calendar",
|
||||
GOOGLE_GMAIL_CONNECTOR: "Google Gmail",
|
||||
GOOGLE_DRIVE_CONNECTOR: "Google Drive",
|
||||
COMPOSIO_GOOGLE_DRIVE_CONNECTOR: "Google Drive",
|
||||
COMPOSIO_GMAIL_CONNECTOR: "Gmail",
|
||||
COMPOSIO_GOOGLE_CALENDAR_CONNECTOR: "Google Calendar",
|
||||
AIRTABLE_CONNECTOR: "Airtable",
|
||||
LUMA_CONNECTOR: "Luma",
|
||||
ELASTICSEARCH_CONNECTOR: "Elasticsearch",
|
||||
WEBCRAWLER_CONNECTOR: "Web Pages",
|
||||
CIRCLEBACK_CONNECTOR: "Circleback",
|
||||
OBSIDIAN_CONNECTOR: "Obsidian",
|
||||
};
|
||||
return typeMap[type] || type;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -421,6 +421,31 @@ export function trackPeriodicIndexingStarted(
|
|||
});
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// INCENTIVE TASKS EVENTS
|
||||
// ============================================
|
||||
|
||||
export function trackIncentivePageViewed() {
|
||||
posthog.capture("incentive_page_viewed");
|
||||
}
|
||||
|
||||
export function trackIncentiveTaskCompleted(taskType: string, pagesRewarded: number) {
|
||||
posthog.capture("incentive_task_completed", {
|
||||
task_type: taskType,
|
||||
pages_rewarded: pagesRewarded,
|
||||
});
|
||||
}
|
||||
|
||||
export function trackIncentiveTaskClicked(taskType: string) {
|
||||
posthog.capture("incentive_task_clicked", {
|
||||
task_type: taskType,
|
||||
});
|
||||
}
|
||||
|
||||
export function trackIncentiveContactOpened() {
|
||||
posthog.capture("incentive_contact_opened");
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// USER IDENTIFICATION
|
||||
// ============================================
|
||||
|
|
|
|||
|
|
@ -71,6 +71,10 @@ export const cacheKeys = {
|
|||
folders: (connectorId: number, parentId?: string) =>
|
||||
["connectors", "google-drive", connectorId, "folders", parentId] as const,
|
||||
},
|
||||
composioDrive: {
|
||||
folders: (connectorId: number, parentId?: string) =>
|
||||
["connectors", "composio-drive", connectorId, "folders", parentId] as const,
|
||||
},
|
||||
},
|
||||
comments: {
|
||||
byMessage: (messageId: number) => ["comments", "message", messageId] as const,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue