Skip to content

Commit f823d1c

Browse files
committed
test: fix ci problem
1 parent cea50c5 commit f823d1c

File tree

8 files changed

+16
-5
lines changed

8 files changed

+16
-5
lines changed

src/client/components/insights/ChartRender.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import prettyMilliseconds from 'pretty-ms';
2727

2828
interface ChartRenderProps {
2929
insightId: string;
30-
insightType: 'survey' | 'website' | 'warehouse';
30+
insightType: 'survey' | 'website' | 'aigateway' | 'warehouse';
3131
}
3232
export const ChartRender: React.FC<ChartRenderProps> = React.memo((props) => {
3333
const workspaceId = useCurrentWorkspaceId();

src/client/components/worker/WorkerExecutionDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface WorkerExecutionDetailProps {
1818
createdAt: string;
1919
error?: string | null;
2020
responsePayload?: unknown;
21-
logs?: (string | number)[][];
21+
logs?: (string | number)[][] | null;
2222
};
2323
}
2424

src/client/store/insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import dayjs from 'dayjs';
99

1010
interface InsightsState {
1111
insightId: string;
12-
insightType: 'website' | 'survey' | 'warehouse';
12+
insightType: 'website' | 'survey' | 'aigateway' | 'warehouse';
1313
currentMetrics: (MetricsInfo | null)[];
1414
currentFilters: (FilterInfo | null)[];
1515
currentGroups: (GroupInfo | null)[];

src/server/prisma/schema.prisma

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,8 @@ model FunctionWorkerExecution {
984984
duration Int? // execution time(ms)
985985
memoryUsed Int? // memory used(bytes)
986986
cpuTime Int? // cpu time(ns)
987+
/// [FunctionWorkerExecutionLogs]
988+
/// @zod.custom(imports.FunctionWorkerExecutionLogsSchema)
987989
logs Json? @default("[]") @db.Json // logs, should be json array
988990
createdAt DateTime @default(now()) @db.Timestamptz(6)
989991
updatedAt DateTime @updatedAt @db.Timestamptz(6)

src/server/prisma/zod/functionworkerexecution.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export const FunctionWorkerExecutionModelSchema = z.object({
1919
duration: z.number().int().nullish(),
2020
memoryUsed: z.number().int().nullish(),
2121
cpuTime: z.number().int().nullish(),
22-
logs: jsonSchema,
22+
/**
23+
* [FunctionWorkerExecutionLogs]
24+
*/
25+
logs: imports.FunctionWorkerExecutionLogsSchema,
2326
createdAt: z.date(),
2427
updatedAt: z.date(),
2528
})

src/server/prisma/zod/schemas/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ export const StatusPageIncidentPayloadSchema = z.object({
4343
})
4444
),
4545
});
46+
47+
export const FunctionWorkerExecutionLogsSchema = z.array(
48+
z.array(z.union([z.string(), z.number()]))
49+
);

src/server/trpc/routers/insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const insightsRouter = router({
136136
.input(
137137
z.object({
138138
insightId: z.string(),
139-
insightType: z.enum(['website', 'survey']),
139+
insightType: insightTypeSchema,
140140
paramName: z.string(),
141141
})
142142
)

src/server/types/global.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {
33
MonitorStatusPageListSchema,
44
SurveyPayloadSchema,
55
StatusPageIncidentPayloadSchema,
6+
FunctionWorkerExecutionLogsSchema,
67
} from '../prisma/zod/schemas/index.ts';
78

89
declare global {
@@ -26,5 +27,6 @@ declare global {
2627
type StatusPageIncidentPayload = z.infer<
2728
typeof StatusPageIncidentPayloadSchema
2829
>;
30+
type FunctionWorkerExecutionLogs = (string | number)[][];
2931
}
3032
}

0 commit comments

Comments
 (0)