Skip to content

Commit

Permalink
feat: Export Bloc class to instatiate new class for sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
peoray committed Jan 23, 2024
1 parent 236f519 commit 6d067c7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/bloc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Customer } from './services'

export class Bloc {
private customer: Customer = new Customer('', '')
// private serviceManager: ServiceManager = new ServiceManager('', '') //

constructor(public secretKey: string, publicKey: string) {
this.customer = new Customer(secretKey, publicKey)
// this.serviceManager = new ServiceManager(secretKey, publicKey)
}

public createCustomer = this.customer.createCustomer.bind(this.customer)
// public createCustomer = this.serviceManager.createCustomer.bind(
// this.serviceManager
// )
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './bloc'
export * from './types'
28 changes: 28 additions & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export * from './customer'

// services/ServiceManager.ts

import { Customer } from './customer'
import {
ICreateCustomer,
ICreateCustomerResponse /* Import other necessary types */,
} from '../types'

export class ServiceManager {
private customer: Customer

constructor(secretKey: string, publicKey: string) {
this.customer = new Customer(secretKey, publicKey)
}

// Add other service classes as needed

// Example method for creating a customer
public createCustomer(
data: ICreateCustomer
): Promise<ICreateCustomerResponse> {
return this.customer.createCustomer(data)
}

// You can add more methods for other services
}

0 comments on commit 6d067c7

Please sign in to comment.