-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): add homepage and partner URL constants and wrappers
- Loading branch information
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface PronoteSSO { | ||
codePartenaire: string | ||
intituleLien: string | ||
description: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { PronoteSSO } from "~/constants/partner"; | ||
import Pronote from "~/client/Pronote"; | ||
|
||
export class Partner { | ||
readonly #client: Pronote; | ||
readonly #code: string; | ||
readonly #description: string; | ||
readonly #linkLabel: string; | ||
|
||
public constructor (client: Pronote, sso: PronoteSSO) { | ||
this.#client = client; | ||
this.#code = sso.codePartenaire; | ||
this.#description = sso.description; | ||
this.#linkLabel = sso.intituleLien; | ||
} | ||
|
||
public async fetchURL (): Promise<string> { | ||
return this.#client.getPartnerURL(this); | ||
} | ||
|
||
public get code (): string { | ||
return this.#code; | ||
} | ||
|
||
public get description (): string { | ||
return this.#description; | ||
} | ||
|
||
public get linkLabel (): string { | ||
return this.#linkLabel; | ||
} | ||
} |