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
4 changes: 2 additions & 2 deletions apps/api/src/controllers/export.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
getSettingsForProject,
} from '@openpanel/db';
import { ChartEngine } from '@openpanel/db';
import { zChartEvent, zChartInputBase } from '@openpanel/validation';
import { zChartEvent, zReport } from '@openpanel/validation';
import { omit } from 'ramda';

async function getProjectId(
Expand Down Expand Up @@ -139,7 +139,7 @@ export async function events(
});
}

const chartSchemeFull = zChartInputBase
const chartSchemeFull = zReport
.pick({
breakdowns: true,
interval: true,
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/controllers/webhook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ export async function polarWebhook(
where: {
subscriptionCustomerId: event.data.customer.id,
subscriptionId: event.data.id,
subscriptionStatus: 'active',
subscriptionStatus: {
in: ['active', 'past_due', 'unpaid'],
},
},
});

Expand Down
17 changes: 13 additions & 4 deletions apps/api/src/utils/ai-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@openpanel/db';
import { ChartEngine } from '@openpanel/db';
import { getCache } from '@openpanel/redis';
import { zChartInputAI } from '@openpanel/validation';
import { zReportInput } from '@openpanel/validation';
import { tool } from 'ai';
import { z } from 'zod';

Expand All @@ -27,7 +27,10 @@ export function getReport({
- ${chartTypes.metric}
- ${chartTypes.bar}
`,
parameters: zChartInputAI,
parameters: zReportInput.extend({
startDate: z.string().describe('The start date for the report'),
endDate: z.string().describe('The end date for the report'),
}),
execute: async (report) => {
return {
type: 'report',
Expand Down Expand Up @@ -72,7 +75,10 @@ export function getConversionReport({
return tool({
description:
'Generate a report (a chart) for conversions between two actions a unique user took.',
parameters: zChartInputAI,
parameters: zReportInput.extend({
startDate: z.string().describe('The start date for the report'),
endDate: z.string().describe('The end date for the report'),
}),
execute: async (report) => {
return {
type: 'report',
Expand All @@ -94,7 +100,10 @@ export function getFunnelReport({
return tool({
description:
'Generate a report (a chart) for funnel between two or more actions a unique user (session_id or profile_id) took.',
parameters: zChartInputAI,
parameters: zReportInput.extend({
startDate: z.string().describe('The start date for the report'),
endDate: z.string().describe('The end date for the report'),
}),
execute: async (report) => {
return {
type: 'report',
Expand Down
Binary file added apps/justfuckinguseopenpanel/favicon.ico
Binary file not shown.
Loading
Loading