Skip to content

Commit

Permalink
Standardize naming convention for URLs (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
nandan-bhat authored Jan 14, 2025
1 parent 096b0a4 commit 447264f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions packages/auth0-acul-js/interfaces/models/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export interface BrandingSettings {
};
faviconUrl?: string;
logoUrl?: string;
font?: {
url: string;
};
fontUrl?: string;
};

export interface BrandingThemes{
Expand Down
2 changes: 1 addition & 1 deletion packages/auth0-acul-js/interfaces/models/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface ClientContext {
export interface ClientMembers {
id: string;
name: string;
logoUri: string | null;
logoUrl: string | null;
description: string | null;
metadata: { [key: string]: string } | null;
}
2 changes: 1 addition & 1 deletion packages/auth0-acul-js/interfaces/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface EnterpriseConnectionContext extends Connection {

export interface EnterpriseConnection extends Connection {
options: {
iconURL?: string;
iconUrl?: string;
displayName?: string;
showAsButton: boolean;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/auth0-acul-js/src/models/branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Branding implements BrandingMembers {
}),
...(favicon_url ? { faviconUrl: favicon_url } : {}),
...(logo_url ? { logoUrl: logo_url } : {}),
...(font ? { font: { url: font.url } } : {}),
...(font ? { fontUrl: font.url } : {}),
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/auth0-acul-js/src/models/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type { ClientContext, ClientMembers } from '../../interfaces/models/clien
export class Client implements ClientMembers {
id: ClientMembers['id'];
name: ClientMembers['name'];
logoUri: ClientMembers['logoUri'];
logoUrl: ClientMembers['logoUrl'];
description: ClientMembers['description'];
metadata: ClientMembers['metadata'];

constructor(client: ClientContext) {
this.id = client.id;
this.name = client.name;
this.logoUri = client?.logo_uri ?? null;
this.logoUrl = client?.logo_uri ?? null;
this.description = client?.description ?? null;
this.metadata = client?.metadata ?? null;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/auth0-acul-js/src/models/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ export class Transaction implements TransactionMembers {
};

if ('options' in connection) {
const { icon_url: iconURL, display_name: displayName, show_as_button: showAsButton } = connection.options;
const { icon_url: iconUrl, display_name: displayName, show_as_button: showAsButton } = connection.options;
return {
...connectionProperties,
options: { iconURL, displayName, showAsButton },
options: { iconUrl, displayName, showAsButton },
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/auth0-acul-js/tests/unit/models/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe(':: models/client | when all fields are available', () => {
});

it('should return the correct logoUrl', () => {
expect(client.logoUri).toBe(clientContext.logo_uri);
expect(client.logoUrl).toBe(clientContext.logo_uri);
});

it('should return the correct clientDescription', () => {
Expand All @@ -55,7 +55,7 @@ describe(':: models/client | when optional fields are not available', () => {
});

it('should return undefined for logoUrl if not available', () => {
expect(client.logoUri).toBeNull();
expect(client.logoUrl).toBeNull();
});

it('should return undefined for clientDescription if not available', () => {
Expand Down

0 comments on commit 447264f

Please sign in to comment.