-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Export Bloc class to instatiate new class for sdk
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
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
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 | ||
// ) | ||
} |
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,2 @@ | ||
export * from './bloc' | ||
export * from './types' |
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,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 | ||
} |