adds komoot integration
This commit is contained in:
@@ -12,14 +12,22 @@ const StravaSchema = z.object({
|
||||
active: z.boolean()
|
||||
})
|
||||
|
||||
const KomootSchema = z.object({
|
||||
email: z.string().email(),
|
||||
password: z.string(),
|
||||
active: z.boolean()
|
||||
})
|
||||
|
||||
const IntegrationCreateSchema = z.object({
|
||||
user: z.string().length(15),
|
||||
strava: StravaSchema,
|
||||
strava: StravaSchema.optional(),
|
||||
komoot: KomootSchema.optional()
|
||||
|
||||
}) satisfies ZodType<Integration>
|
||||
|
||||
const IntegrationUpdateSchema = z.object({
|
||||
strava: StravaSchema.optional(),
|
||||
strava: StravaSchema.optional().nullable(),
|
||||
komoot: KomootSchema.optional().nullable()
|
||||
}) satisfies ZodType<Partial<Integration>>
|
||||
|
||||
export { StravaSchema, IntegrationCreateSchema, IntegrationUpdateSchema }
|
||||
export { StravaSchema, IntegrationCreateSchema, IntegrationUpdateSchema, KomootSchema };
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
interface BaseIntegration {
|
||||
export interface BaseIntegration {
|
||||
active: boolean
|
||||
}
|
||||
|
||||
interface StravaIntegration extends BaseIntegration {
|
||||
export interface StravaIntegration extends BaseIntegration {
|
||||
clientId: string | number;
|
||||
clientSecret: string;
|
||||
routes: boolean;
|
||||
@@ -13,13 +13,21 @@ interface StravaIntegration extends BaseIntegration {
|
||||
expiresAt?: number;
|
||||
}
|
||||
|
||||
export interface KomootIntegration extends BaseIntegration {
|
||||
email: string,
|
||||
password: string,
|
||||
}
|
||||
|
||||
|
||||
export class Integration {
|
||||
id?: string;
|
||||
user: string;
|
||||
strava?: StravaIntegration;
|
||||
strava?: StravaIntegration | null;
|
||||
komoot?: KomootIntegration | null
|
||||
|
||||
constructor(user: string, strava?: StravaIntegration) {
|
||||
constructor(user: string, strava?: StravaIntegration, komoot?: KomootIntegration) {
|
||||
this.user = user;
|
||||
this.strava = strava;
|
||||
this.komoot = komoot;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user