From 74302846dc387423d51da79be82f7e0fee4a45bf Mon Sep 17 00:00:00 2001 From: Serj Malko Date: Sun, 9 Oct 2022 17:27:26 +0300 Subject: [PATCH] feat(webim): add plugin (#4355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Малько Сергей Сергеевич --- .../plugins/webim/index.ts | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 src/@awesome-cordova-plugins/plugins/webim/index.ts diff --git a/src/@awesome-cordova-plugins/plugins/webim/index.ts b/src/@awesome-cordova-plugins/plugins/webim/index.ts new file mode 100644 index 000000000..415a5d675 --- /dev/null +++ b/src/@awesome-cordova-plugins/plugins/webim/index.ts @@ -0,0 +1,203 @@ +import { Injectable } from '@angular/core'; +import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core'; + +export interface InitParams { + accountName: string; + closeWithClearVisitorData: boolean; + storeHistoryLocally: boolean; + pushToken: string; + location: string; + visitorFields: string; +} + +export interface InitResponse { + result: string; +} + + +/** + * @name Webim + * @description + * A cordova plugin, a JS version of Webim SDK + * @usage + * ```typescript + * import { Webim } from '@awesome-cordova-plugins/webim/ngx'; + * + * + * constructor(private webim: Webim) { } + * + * ... + * + * + * this.webim.functionName('Hi bro', 42) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'Webim', + plugin: 'webim-cordova-plugin', + pluginRef: 'Webim', + repo: 'https://github.com/webim/webim-cordova-plugin.git', + install: 'cordova plugin add https://github.com/webim/webim-cordova-plugin.git', + platforms: ['Android', 'iOS', 'Browser'], +}) +@Injectable() +export class Webim extends AwesomeCordovaNativePlugin { + + + @Cordova() + init(params: InitParams): Promise{ + return; + } + + + @Cordova() + requestDialog(): Promise { + return; + } + + + @Cordova() + getMessagesHistory(limit: number, offset: number): Promise{ + return; + } + + + @Cordova() + typingMessage(message: string): Promise{ + return; + } + + @Cordova() + sendMessage(message: string): Promise{ + return; + } + + @Cordova() + replyMessage(message: string): Promise{ + return; + } + + @Cordova() + sendFile(filePath: string): Promise{ + return; + } + + @Cordova() + sendSurveyAnswer(surveyAnswer: string): Promise{ + return; + } + + @Cordova() + cancelSurvey(): Promise{ + return; + } + + @Cordova() + onMessage(): Promise{ + return; + } + + @Cordova() + onDeletedMessage(): Promise{ + return; + } + + @Cordova() + onFile(message: string): Promise{ + return; + } + + @Cordova() + onTyping(): Promise{ + return; + } + + @Cordova() + onConfirm(): Promise{ + return; + } + + @Cordova() + onDialog(): Promise{ + return; + } + + @Cordova() + onBan(): Promise{ + return; + } + + @Cordova() + close(): Promise{ + return; + } + + @Cordova() + rateOperator(id: string, rating: number): Promise{ + return; + } + + @Cordova() + rateOperatorWithNote(id: string, rating: number, note: string): Promise{ + return; + } + + @Cordova() + sendDialogToEmailAddress(emailAddress: string): Promise{ + return; + } + + @Cordova() + onUnreadByVisitorMessageCount(): Promise{ + return; + } + + @Cordova() + onSurvey(): Promise{ + return; + } + + @Cordova() + onNextQuestion(): Promise{ + return; + } + + @Cordova() + onSurveyCancel(): Promise{ + return; + } + + @Cordova() + getUnreadByVisitorMessageCount(): Promise{ + return; + } + + @Cordova() + sendKeyboardRequest(): Promise{ + return; + } + + @Cordova() + setChatRead(): Promise{ + return; + } + + @Cordova() + getShowEmailButton(): Promise{ + return; + } + + @Cordova() + showRateOperatorWindow(): Promise{ + return; + } + + @Cordova() + onLogging(): Promise{ + return; + } + +}