Skip to content

Commit

Permalink
Rename base class
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanFazal committed Oct 4, 2023
1 parent 0c66c9e commit ef1deee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BoekUwZendingClient, { ClientConfig } from "../src"
import BoekUwZending, { ClientConfig } from "../src"

const config: ClientConfig = {
clientId: process.env.CLIENT_ID || "",
Expand All @@ -10,7 +10,7 @@ const config: ClientConfig = {
* This example shows how to get authenticated user information.
*/
async function getMe() {
const client = await BoekUwZendingClient.create(config)
const client = await BoekUwZending.create(config)

try {
const { data, error: _ } = await client.endpoints.me.get()
Expand All @@ -35,7 +35,7 @@ async function getMe() {
* This example shows how to get the conversation history of the authenticated user.
*/
async function getConversation() {
const client = await BoekUwZendingClient.create(config)
const client = await BoekUwZending.create(config)
const { data: me, error: _ } = await client.endpoints.me.get()
if (!me?.conversation) {
throw new Error("Conversation path not found")
Expand Down
8 changes: 3 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface OAuthResponse {
error_description?: string
}

export default class BoekUwZendingClient {
export default class BoekUwZending {
// Private properties
private baseClient = createClient<paths>()
private accessToken?: string
Expand Down Expand Up @@ -72,10 +72,8 @@ export default class BoekUwZendingClient {
this.endpoints = this.endpoints as EndpointInstances
}

public static async create(
config: ClientConfig
): Promise<BoekUwZendingClient> {
const client = new BoekUwZendingClient(config)
public static async create(config: ClientConfig): Promise<BoekUwZending> {
const client = new BoekUwZending(config)
await client.authorize(config)
return client
}
Expand Down

0 comments on commit ef1deee

Please sign in to comment.