-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c64e4e3
commit 72d6af7
Showing
26 changed files
with
4,604 additions
and
4,233 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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { Client } from "wapi.js"; | ||
|
||
new Client(); | ||
new Client({ | ||
|
||
}); |
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
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
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
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
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,38 @@ | ||
import { type EventDataMap } from '~/webhook/schema' | ||
import type { Client, MediaManagerInterface, PhoneNumberManagerInterface, Webhook } from '../..' | ||
import type { RequestClient } from './request-client' | ||
|
||
export interface ClientInterface { | ||
phone: PhoneNumberManagerInterface | ||
media: MediaManagerInterface | ||
webhook: Webhook | ||
requester: RequestClient | ||
status: 'Ready' | 'Idle' | null | ||
readyAtTimeStamp: Date | null | ||
getReadyAt: () => Date | null | ||
|
||
emit<T extends keyof EventDataMap>(eventName: T, data: EventDataMap[T]): boolean | ||
on<T extends keyof EventDataMap>(eventName: T, listener: (data: EventDataMap[T]) => void): this | ||
initiate: () => Promise<boolean> | ||
updateAccessToken(accessToken: string): void | ||
updateSenderPhoneNumberId(phoneNumber: string): void | ||
} | ||
|
||
export interface RequestClientInterface { | ||
host: string | ||
protocol: string | ||
phoneNumberId: string | ||
businessAccountId: string | ||
apiVersion: string | ||
client: Client | ||
userAgent: string | ||
accessToken: string | ||
|
||
getRequestUrl(): string | ||
|
||
requestCloudApi(params: { | ||
path: string | ||
body: any | ||
method: 'GET' | 'POST' | 'DELETE' | ||
}): Promise<void> | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import { type Client } from '../../..' | ||
import { type BaseManagerInterface } from './interface' | ||
|
||
export class BaseManager implements BaseManagerInterface {} | ||
export class BaseManager implements BaseManagerInterface { | ||
client: Client | ||
|
||
constructor(client: Client) { | ||
this.client = client | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export interface BaseManagerInterface {} | ||
import { type Client } from '../../..' | ||
|
||
export interface BaseManagerInterface { | ||
client: Client | ||
} |
Oops, something went wrong.