Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Lennerdahl committed Nov 13, 2023
1 parent 4223abf commit dc109ab
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/lib/UrlBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@

export class UrlBuilder {
export class UrlBuilder {
static createUrl(
teamName: string,
teamProjectName: string,
codeRepositoryName: string,
subscriptionId: string,
states: object
): string {

//Please update the url if there are any changes to the infrastructure.
const urlDashboard: string = "https://cydig.omegapoint.cloud/";
//Please update the func url if there are any changes to the infrastructure.
const readFunctionURL: string = 'https://func-cydig-comp-state-prod.azurewebsites.net/api/ReadToReadme?code=';
//Please update the url if there are any changes to the infrastructure.
const readToReadMeKeyAcessKey: string = 'xaEvCDsaK01y2Z6SBivwOKndN4o915lpOTt1VkmULgsxgsjkml7u1DOhgULzmAPX';

const source: string = 'GitHub';

let urls: string = '';
let encodedURL: string;
let singleBadgeURL: string;
Expand All @@ -27,16 +29,7 @@ export class UrlBuilder {

//timestamp
encodedURL = encodeURIComponent(
readFunctionURL +
readToReadMeKeyAcessKey +
'&teamName=' +
encodeURIComponent(teamName) +
'&teamProjectName=' +
encodeURIComponent(teamProjectName) +
'&codeRepositoryName=' +
encodeURIComponent(codeRepositoryName) +
'&stateType=' +
'timestamp'
`${readFunctionURL}/teams/${teamName}/sources/${source}/projects/${teamProjectName}/repositories/${codeRepositoryName}/controls/timestamp?code=${badgeAccessKey}`
);
singleBadgeURL = '![' + 'Timestamp' + '](https://img.shields.io/endpoint?url=' + encodedURL + ')';
urls = urls + singleBadgeURL + '<br/>' + '<br/>' + '\n';
Expand Down

0 comments on commit dc109ab

Please sign in to comment.