Files
wanderer/web/src/lib/models/integration.ts
slothful-vassal b5739cb72e merge trails function added (#627)
* merge trails function added

* fix conflict resolve issues

* avoid incorrect authorship when merging trail comments

* require edit access for all selected trails before merge

* fix likes checkbox binding in trail merge modal

* improve error handling

* require editable target and deletable sources for merge

* avoid duplicate trail fetch during merge

* prevent duplicate likes when merging trails

* check photo download responses during trail merge

* add merge completion toast notifications

* cleanup

* small fixes

* move merge code to backend, option to merge single trail selection with similar one, automatic merge for integrations add as option, maintenance page to find and merge similar trails added

* fix build error

* fix

* docu, beautifying, refactoring

---------

Co-authored-by: Flomp <Flomp@users.noreply.github.com>
2026-05-09 13:09:26 +02:00

56 lines
1.3 KiB
TypeScript

export interface BaseIntegration {
active: boolean
}
export interface IntegrationMergeSettings {
enabled: boolean;
}
export interface StravaIntegration extends BaseIntegration {
clientId: string | number;
clientSecret?: string;
routes: boolean;
activities: boolean;
accessToken?: string;
refreshToken?: string;
expiresAt?: number;
after?: string
privacy: "original" | "settings"
merge: IntegrationMergeSettings;
}
export interface KomootIntegration extends BaseIntegration {
email: string,
password: string,
completed: boolean,
planned: boolean
privacy: "original" | "settings"
merge: IntegrationMergeSettings;
}
export interface HammerheadIntegration extends BaseIntegration {
email: string,
password: string,
completed: boolean,
planned: boolean,
after?: string
merge: IntegrationMergeSettings;
}
export class Integration {
id?: string;
user: string;
strava?: StravaIntegration | null;
komoot?: KomootIntegration | null;
hammerhead?: HammerheadIntegration | null;
constructor(user: string, strava?: StravaIntegration, komoot?: KomootIntegration, hammerhead?: HammerheadIntegration) {
this.user = user;
this.strava = strava;
this.komoot = komoot;
this.hammerhead = hammerhead;
}
}