Skip to content

Commit

Permalink
Rydder
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-nom committed May 15, 2024
1 parent cd5809d commit 4c867ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/analytics/task-analytics/ta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const fetchAndStart = async (state: AppState, currentUrl: URL) => {
});
};

export const startTaskAnalyticsSurvey = (
const startTaskAnalyticsSurvey = (
state: AppState,
currentUrl = new URL(window.location.href),
) => {
Expand Down
12 changes: 6 additions & 6 deletions packages/server/src/task-analytics-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { z } from "zod";
import { Result, ResultType } from "./result";
import { StaleWhileRevalidateResponseCache } from "decorator-shared/response-cache";

export type TaskAnalyticsSurvey = z.infer<typeof taSurveyItemSchema>;
export type TaskAnalyticsUrlRule = z.infer<typeof taUrlRule>;
export type TaskAnalyticsSurvey = z.infer<typeof taSurveySchema>;
export type TaskAnalyticsUrlRule = z.infer<typeof taUrlRuleSchema>;

const taUrlRule = z.object({
const taUrlRuleSchema = z.object({
url: z.string(),
match: z.enum(["exact", "startsWith"]),
exclude: z.optional(z.boolean()),
});

const taSurveyItemSchema = z.object({
const taSurveySchema = z.object({
id: z.string(),
selection: z.optional(z.number()),
duration: z.optional(
Expand All @@ -21,12 +21,12 @@ const taSurveyItemSchema = z.object({
end: z.optional(z.string()),
}),
),
urls: z.optional(z.array(taUrlRule)),
urls: z.optional(z.array(taUrlRuleSchema)),
audience: z.optional(z.array(contextSchema)),
language: z.optional(z.array(languageSchema)),
});

const configSchema = z.array(taSurveyItemSchema);
const configSchema = z.array(taSurveySchema);

const TEN_SECONDS_MS = 10 * 1000;

Expand Down

0 comments on commit 4c867ba

Please sign in to comment.