repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
design-studio
github_2023
Tiledesk
typescript
DepartmentService.updateDeptStatus
public updateDeptStatus(dept_id: string, status: number) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.URL_TILEDESK_DEPARTMENTS + dept_id; this.logger.log('UPDATE DEPT STATUS...
/** * UPDATE DEPARTMENT STATUS * @param dept_id * @param status */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/department.service.ts#L305-L322
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
DepartmentService.updateDefaultDeptOnlineMsg
public updateDefaultDeptOnlineMsg(id: string, onlineMsg: string) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.URL_TILEDESK_DEPARTMENTS + id; this.logger.log('[DEPTS-SERV] UP...
// --------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/department.service.ts#L327-L346
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
DepartmentService.updateDefaultDeptOfflineMsg
public updateDefaultDeptOfflineMsg(id: string, offlineMsg: string) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.URL_TILEDESK_DEPARTMENTS + id; this.logger.log('[DEPTS-SERV] ...
// --------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/department.service.ts#L351-L368
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
DepartmentService.testChat21AssignesFunction
public testChat21AssignesFunction(id: string): Observable<Department[]> { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; let url = this.URL_TILEDESK_DEPARTMENTS; // + '?nobot=' + true url +=...
// ------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/department.service.ts#L377-L398
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.getFaqKbByProjectId
public getFaqKbByProjectId(): Observable<Chatbot[]> { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.FAQKB_URL; this.logger.log('[FAQ-KB.SERV] - GET FAQ-KB BY PROJECT ID - URL', ...
/** * READ (GET ALL FAQKB WITH THE CURRENT PROJECT ID) * NOTE: chat21-api-node.js READ THE CURRENT PROJECT ID FROM THE URL SO IT SO NO LONGER NECESSARY TO PASS THE PROJECT * ID AS PARAMETER */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L47-L73
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.getAllBotByProjectId
public getAllBotByProjectId(): Observable<FaqKb[]> { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.FAQKB_URL + '?all=true'; this.logger.log('[FAQ-KB.SERV] - GET *ALL* FAQ-KB BY...
// ------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L78-L108
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.updateFaqKb
public updateFaqKb(chatbot: Chatbot) { const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; let url = this.FAQKB_URL + chatbot._id; this.logger.log('update BOT - U...
/** * UPDATE (PUT) * @param id * @param fullName */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L128-L147
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.updateFaqKbAgentsAvailable
public updateFaqKbAgentsAvailable(id: string, agents_available: boolean) { const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; let url = this.FAQKB_URL + id; this...
/** * UPDATE (PUT) * @param id * @param fullName */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L154-L170
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.updateFaqKbLanguage
updateFaqKbLanguage (id: string, chatbotlanguage: string) { const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; let url = this.FAQKB_URL + id + '/language/' + chatbot...
// PROJECT_ID/faq_kb/FAQ_KB_ID/language/LANGUAGE
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L175-L193
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqKbService.publish
public publish(chatbot: Chatbot) { const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) } let url = this.FAQKB_URL + chatbot._id + "/publish"; this.logger.log('publis...
// http://localhost:3000/63ea8812b48b3e22c9372f05/faq_kb/63ea8820b48b3e22c9372f83/publish
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq-kb.service.ts#L227-L241
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.exsportFaqsToCsv
public exsportFaqsToCsv(id_faq_kb: string) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken, }), responseType: 'text' as 'json' }; const url = this.EXPORT_FAQ_TO_CSV_URL + '?id_faq_kb=' + id_faq_kb; ...
/** * EXPORT FAQS AS CSV * @param id_faq_kb * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L53-L66
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.importChatbotFromJSONFromScratch
public importChatbotFromJSONFromScratch(jsonfile) { const options = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.SERVER_BASE_PATH + this.project_id + "/faq_kb/importjson/null/?create=true" this.logger....
// ( POST ../PROJECT_ID/bots/importjson/null/?create=true)
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L98-L111
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.addIntent
public addIntent(intent: any) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.FAQ_URL; this.logger.log('[FAQ-SERV] ADD FAQ - PUT URL ', url); this.logger.log('[FAQ-SERV] ADD...
/** * CREATE FAQ (POST) * @param intent * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L139-L150
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.updateIntent
public updateIntent(intent: any) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; this.logger.log('[FAQ-SERV] UPDATE FAQ - ID ', intent._id); let url = this.FAQ_URL + intent._id; if(intent.in...
/** * UPDATE FAQ (PUT) * @param intent * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L157-L173
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.createTrainBotAnswer
public createTrainBotAnswer(question: string, answer: string, id_faq_kb: string) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.FAQ_URL; this.logger.log('[FAQ-SERV] CREATE TRAI...
/** * CREATE TRAIN BOT ANSWER (POST) * @param question * @param answer * @param id_faq_kb * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L183-L198
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.deleteFaq
public deleteFaq(id: string, intent_id?: string, id_faq_kb?: string) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; let url = this.FAQ_URL + id; if(intent_id) url = this.FAQ_URL + 'intentId' + i...
/** * DELETE FAQ (DELETE) * @param id * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L205-L217
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.updateTrainBotFaq
public updateTrainBotFaq(id: string, question: string, answer: string) { this.logger.log('[FAQ-SERV] - UPDATE TRAIN BOT FAQ - ID ', id); const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledes...
/** * UPDATE TRAIN BOT FAQ * @param id * @param question * @param answer * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L226-L244
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FaqService.searchFaqByFaqKbId
public searchFaqByFaqKbId(botId: string, question: string) { const httpOptions = { headers: new HttpHeaders({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) }; const url = this.SERVER_BASE_PATH + this.project_id ...
/** * SEARCH FAQ BY BOT ID * @param botId * @param question * @returns */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/faq.service.ts#L253-L267
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService._displayContactUsModal
_displayContactUsModal(displayModal: boolean, areAvailableOperatorsSeats: string) { this.logger.log('[NOTIFY-SERVICE] - _displayContactUsModal areAvailableOperatorsSeats ', areAvailableOperatorsSeats); if (areAvailableOperatorsSeats === 'operators_seats_unavailable') { this.showSubtitleAllOperatorsSeatsUs...
// "CONTACT US - LET'S CHAT" MODAL
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L130-L141
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.openDataExportNotAvailable
openDataExportNotAvailable() { this.displayDataExportNotAvailable = 'block'; }
// -----------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L154-L156
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.presentModalInstallTiledeskModal
presentModalInstallTiledeskModal() { this.displayInstallTiledeskModal = 'block'; }
// -----------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L165-L167
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.presentModalSuccessCheckModal
presentModalSuccessCheckModal(titletext: string, bodytext: string) { this.successCheckModalTitleText = titletext; this.successCheckModalBodyText = bodytext; this.displaySuccessCheckModal = 'block'; }
// -----------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L176-L180
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.displayCancelSubscriptionModal
displayCancelSubscriptionModal(displayModal: boolean) { if (displayModal === true) { this.viewCancelSubscriptionModal = 'block'; } }
// -----------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L190-L194
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.cancelSubscriptionCompleted
cancelSubscriptionCompleted(hasDone: boolean) { this.viewCancelSubscriptionModal = 'none'; this.cancelSubscriptionCompleted$.next(hasDone); }
// CALLED FROM NotificationMessageComponent
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L201-L204
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.publishHasClickedChat
publishHasClickedChat(hasClickedChat: boolean) { this.logger.log('[NOTIFY-SERVICE] - hasClickedChat ', hasClickedChat); this.bs_hasClickedChat.next(true); }
// is CALLED FROM SIDEBAR, IN THE CHECLIST MODAL (NOTIFICATION-MESSAGE) AND HOME WHEN THE USER CLICK ON THE CHAT BTN
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L255-L258
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.showNotification
showNotification(message, notificationColor, icon) { const type = ['', 'info', 'success', 'warning', 'danger']; // const color = Math.floor((Math.random() * 4) + 1); const color = notificationColor this.notify = $.notify({ // icon: 'glyphicon glyphicon-warning-sign', // message: message ...
// showNotification(from, align) {
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L263-L288
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.showForegroungPushNotification
showForegroungPushNotification(sender: string, msg: string, link: string, requester_avatar_initial: string, requester_avatar_bckgrnd: string) { // console.log('[NOTIFY-SERVICE] showForegroungPushNotification link', link) // console.log('[NOTIFY-SERVICE] showForegroungPushNotification requester_avatar_initial', ...
// icon_type: 'image',
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L321-L355
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotifyService.showRequestIsArchivedNotification
showRequestIsArchivedNotification(msg_part1) { // tslint:disable-next-line:max-line-length // this.notifyArchivingRequest.update({ 'type': 'success', 'message': '<i class="material-icons" style="vertical-align: middle;"> done </i> <span style="vertical-align: middle; display: inline-block; padding-right:5px">' ...
// showRequestIsArchivedNotification(msg_part1, request_id, msg_part2) {
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/notify.service.ts#L559-L567
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
OpenaiService.previewPrompt
previewPrompt(data) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) } const url = this.URL_TILEDESK_OPENAI + "/openai/"; this.logger.debug('[OPENAI.SERVICE] - preview prompt URL: ', url); retu...
////////////////////////////////////////////////////////
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/openai.service.ts#L48-L60
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
OpenaiService.previewAskPrompt
previewAskPrompt(data) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken }) } const url = this.URL_TILEDESK_OPENAI + "/kb/qa"; this.logger.debug('[OPENAI.SERVICE] - preview prompt URL: ', url); ret...
////////////////////////////////////////////////////////
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/openai.service.ts#L70-L82
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
OpenaiService.askGpt
askGpt(data) { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Authorization': this.tiledeskToken // remove it for pugliai endpoint }) } // const url = this.GPT_API_URL + "/qa"; const url = this.URL_TILEDESK_OPENAI + "/kbsettings/qa"; ...
////////////////////////////////////////////////////////
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/openai.service.ts#L104-L117
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectService.createNewProjectUserToGetNewLeadID
public createNewProjectUserToGetNewLeadID(project_id: string) { const url = this.SERVER_BASE_URL + project_id + '/project_users/' this.logger.log('[TILEDESK-SERVICE] - CREATE NEW PROJECT USER TO GET NEW LEAD ID url ', url); const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'appl...
// ---------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/projects.service.ts#L148-L162
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectService.createNewLead
public createNewLead(leadid: string, fullname: string, leademail: string, project_id: string) { const url = this.SERVER_BASE_URL + project_id + '/leads/' this.logger.log('[TILEDESK-SERVICE] - CREATE NEW LEAD url ', url); const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'app...
// ---------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/projects.service.ts#L167-L185
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectService.getAllBotByProjectId
public getAllBotByProjectId(project_id: string) { const url = this.SERVER_BASE_URL + project_id + '/faq_kb?all=true' this.logger.log('[TILEDESK-SERVICE] - GET ALL BOTS BY PROJECT ID - URL', url); const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', ...
// -------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/projects.service.ts#L190-L206
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectService.getDeptsByProjectId
public getDeptsByProjectId(project_id: string) { const url = this.SERVER_BASE_URL + project_id + '/departments/allstatus'; this.logger.log('[TILEDESK-SERVICE] - GET DEPTS (ALL STATUS) - URL', url); const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', ...
// -------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/projects.service.ts#L211-L227
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
UsersService.getCurrentUserCommunityProfile
public getCurrentUserCommunityProfile(userid): Observable<UserModel[]> { const url = this.SERVER_BASE_URL + 'users_util/' + userid; this.logger.log('[USER-SERV] - GET CURRENT USER CMNTY PROFILE - URL', url); const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json',...
// }
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/users.service.ts#L255-L267
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
UsersService.updateUserWithCommunityProfile
public updateUserWithCommunityProfile(userWebsite: string, userPublicEmail: string, userDescription: string) { const url = this.SERVER_BASE_URL + 'users/'; this.logger.log('[USER-SERV] - UPDATE USER WITH COMMUNITY PROFILE (PUT) URL ', url); const httpOptions = { headers: new HttpHeaders({ 'Acc...
// }
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/users.service.ts#L1094-L1115
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.ref
ref(topic, calledby, onCreate, onUpdate, onData) { // this.logger.log('[WEBSOCKET-JS] ****** CALLING REF ****** '); this.logger.log('[WEBSOCKET-JS] - REF - calledby ', calledby); this.logger.log('[WEBSOCKET-JS] - REF - TOPIC ', topic); this.logger.log('[WEBSOCKET-JS] - REF - CALLBACKS', this.callbacks);...
// WsRequestsMsgsComponent onInit() is got the request id from url params
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L72-L112
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.subscribe
subscribe(topic) { if (this.topics.indexOf(topic) === -1) { this.topics.push(topic); } this.logger.log('[WEBSOCKET-JS] - SUBSCRIBE TO TOPIC ', topic); var message = { action: 'subscribe', payload: { //topic: '/' + project_id + '/requests', topic: topic, messag...
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L117-L137
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.unsubscribe
unsubscribe(topic) { this.logger.log("[WEBSOCKET-JS] - UN-SUBSCRIBE - FROM TOPIC: ", topic); // this.logger.log("% »»» WebSocketJs WF *** UNSUBSCRIBE *** - this.topics ", this.topics); // this.logger.log("% »»» WebSocketJs WF *** UNSUBSCRIBE *** - topic ", topic); // this.logger.log("% »»» WebSocketJs ...
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L146-L187
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.send
send(initialMessage, calling_method) { // this.logger.log("[WEBSOCKET-JS] - SEND - INIZIAL-MSG ", initialMessage, " CALLED BY ", calling_method); this.ws.send(initialMessage); }
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L192-L196
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.close
close() { this.topics = []; this.callbacks = []; this.logger.log("[WEBSOCKET-JS] - CALLED CLOSE - TOPICS ", this.topics, ' - CALLLBACKS ', this.callbacks); if (this.ws) { this.ws.onclose = function () { }; // disable onclose handler first this.ws.close(); } this.heartReset(); }
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L202-L212
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.resubscribe
resubscribe() { this.logger.log("[WEBSOCKET-JS] - RESUBSCRIBE - TO TOPICS ", this.topics); this.logger.log("[WEBSOCKET-JS] - RESUBSCRIBE - CALLBACKS ", this.callbacks); if (this.topics.length > 0) { this.topics.forEach(topic => { this.logger.log("[WEBSOCKET-JS] - RESUBSCRIBE - SUBDCRIBE TO TO...
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L217-L227
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.heartCheck
heartCheck() { this.heartReset(); this.heartStart(); }
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L232-L235
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.heartStart
heartStart() { // this.getRemainingTime(); this.pingTimeoutId = setTimeout(() => { // Qui viene inviato un battito cardiaco Dopo averlo ricevuto, viene restituito un messaggio di battito cardiaco. // onmessage Ottieni il battito cardiaco restituito per indicare che la connessione è normale if...
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L279-L305
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.heartReset
heartReset() { // this.logger.log("[WEBSOCKET-JS] - HEART-RESET"); clearTimeout(this.pingTimeoutId); clearTimeout(this.pongTimeoutId); }
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L310-L314
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.init
init(url, onCreate, onUpdate, onData, onOpen = undefined, onOpenCallback = undefined, _topics = [], _callbacks = new Map()) { this.url = url; this.onCreate = onCreate; this.onUpdate = onUpdate; this.onData = onData; this.onOpen = onOpen; this.topics = _topics//[];//new Map(); this.callbac...
// -----------------------------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L319-L539
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WebSocketJs.isArray
isArray(what) { return Object.prototype.toString.call(what) === '[object Array]'; }
// }
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/websocket-js.ts#L559-L561
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WsChatbotService.subsToAITrain_ByBot_id
subsToAITrain_ByBot_id(project_id, bot_id) { var self = this; this.logger.log("[WS-CHATBOT-SERV] - SUBSCRIBE TO AI TRAIN BY BOT ID bot_id", bot_id); const path = '/' + project_id + '/bots/' + bot_id this.logger.log("[WS-CHATBOT-SERV] - SUBSCRIBE TO AI TRAIN BY BOT ID path", path); this.webSocketJ...
/** * * Subscribe to websocket chatbot by bot id * called if chatbot.intentsEngine is equal to 'ai' * * @param bot_id */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/ws-chatbot.service.ts#L46-L96
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
WsChatbotService.unsubsToAITrain_ByBot_id
unsubsToAITrain_ByBot_id(bot_id) { this.logger.log("[WS-MSGS-SERV] - UNSUBSCRIBE TO MSGS BY REQUEST ID - request_id ", bot_id); this.webSocketJs.unsubscribe('/' + this.project_id + '/bots/' + bot_id ); }
/** * Unsubscribe to websocket messages by request id service * called when in WsRequestsMsgsComponent onInit() is got the request id from url params * * @param request_id */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/services/websocket/ws-chatbot.service.ts#L104-L108
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotificationMessageComponent.openModalExpiredSubscOrGoToPricing
openModalExpiredSubscOrGoToPricing() { if (this.USER_ROLE === 'owner') { if (this.prjct_profile_type === 'free' && this.trial_expired === true) { this.notify.closeDataExportNotAvailable(); this.router.navigate(['project/' + this.project._id + '/pricing']); // this.notify.presentContac...
// }
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/ui/notification-message/notification-message.component.ts#L197-L219
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotificationMessageComponent.copyToClipboard
copyToClipboard() { document.querySelector('textarea').select(); document.execCommand('copy'); this.has_copied = true; setTimeout(() => { this.has_copied = false; }, 2000); }
// ----------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/ui/notification-message/notification-message.component.ts#L254-L262
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotificationMessageComponent.openChat
openChat() { // localStorage.setItem('chatOpened', 'true'); const url = this.CHAT_BASE_URL; window.open(url, '_blank'); this.notify.publishHasClickedChat(true); }
// ----------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/ui/notification-message/notification-message.component.ts#L267-L272
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
NotificationMessageComponent.goToWidgetPage
goToWidgetPage() { this.router.navigate(['project/' + this.project._id + '/widget']); this.notify.closeModalInstallTiledeskModal() }
// ----------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/ui/notification-message/notification-message.component.ts#L277-L280
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectPlanUtils.hideActionCategory
private hideActionCategory(actionType: TYPE_ACTION_CATEGORY){ this.logger.log('[PROJECT_PROFILE] hideActionType', actionType); //MANAGE ACTION CATEGORIES let index = ACTION_CATEGORY.findIndex(el => el.type === getKeyByValue(actionType, TYPE_ACTION_CATEGORY)); if(index > -1){ ...
/** hide action by * 1. CATEGORY TYPE * 2. ACTION LIST * 3. ATTRIBUTE LIST ASSOCIATED WITH */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/utils/project-utils.ts#L213-L233
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectPlanUtils.hideAction
private hideAction(action: TYPE_ACTION | TYPE_ACTION_VXML){ let actionType: TYPE_ACTION_CATEGORY = Object.values(ACTIONS_LIST).find(el => el.type == action).category Object.values(ACTIONS_LIST).filter(el => el.type == action).map( el => el.status = 'inactive') //MANAGE ACTION CATEGORIES ...
/** hide action by * 1. ACTION LIST * 2. if no ACTION of same type exist, remove CTEGORY */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/utils/project-utils.ts#L239-L252
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectPlanUtils.checkActionCanShow
private checkActionCanShow(action: TYPE_ACTION | TYPE_ACTION_VXML){ let status = this.checkIfIsEnabledInProject(action) if(!status){ this.hideAction(action) } }
/** CHECK IF ACTION IS IN 'customization' * IF NOT: * --- remove action type from list */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/utils/project-utils.ts#L258-L263
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ProjectPlanUtils.checkActionCanShowInFT
private checkActionCanShowInFT(feature: string, action: TYPE_ACTION | TYPE_ACTION_VXML){ this.logger.log('[PROJECT_PROFILE] checkIfCategoryCanLoad -->', feature, action); let status = true; // --1: check into env let public_Key = this.appConfigService.getConfig().t2y12PruGU9wUtEGzBJfolMI...
/** CHECK IF ACTION IS IN 'feature-token' * IF NOT: * --- remove action type from list */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/app/utils/project-utils.ts#L269-L295
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.initialize
initialize() { const appconfig = this.appConfigService.getConfig(); this.tenant = appconfig.firebaseConfig.tenant; this.logger.log('[CHAT MANAGER] - initialize -> firebaseConfig tenant ', this.tenant); this.handlers = []; this.openInfoConversation = true; this.currentUser = null; this.logger...
/** * inizializza chatmanager */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L46-L54
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.setTiledeskToken
public setTiledeskToken(tiledeskToken: string) { this.logger.log('initialize FROM [APP-COMP] - [CHAT MANAGER] - initialize -> firebaseConfig tenant ', this.tenant); this.tiledeskToken = tiledeskToken; }
/** * setTiledeskToken */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L59-L62
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.getTiledeskToken
public getTiledeskToken(): string { return this.tiledeskToken; }
/** * return tiledeskToken */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L67-L69
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.setCurrentUser
public setCurrentUser(currentUser: UserModel) { this.logger.log('initialize FROM [APP-COMP] - [CHAT MANAGER] setCurrentUser currentUser ', currentUser) this.currentUser = currentUser; }
/** * setCurrentUser */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L74-L77
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.getCurrentUser
public getCurrentUser(): UserModel { return this.currentUser; }
/** * return current user detail */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L82-L84
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.getOpenInfoConversation
getOpenInfoConversation(): boolean { return this.openInfoConversation; }
/** * */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L92-L94
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.dispose
dispose() { this.logger.debug('[CHAT MANAGER] 1 - setOffAllReferences'); if (this.handlers) { this.setOffAllReferences(); } this.logger.debug('[CHAT MANAGER] 2 - disposeConversationsHandler'); if (this.conversationsHandlerService) { this.disposeConversationsHandler(); } this.logger.debug('[CHAT MANA...
/** * dispose all references * dispose refereces messaggi di ogni conversazione * dispose reference conversazioni * dispose reference sincronizzazione contatti */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L101-L114
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.goOffLine
goOffLine() { this.currentUser = null; // cancello token e user dal localstorage!!!!! this.logger.debug('[CHAT MANAGER] 1 - CANCELLO TUTTE LE REFERENCES'); this.dispose(); }
/** * invocato da user.ts al LOGOUT: * 1 - cancello tutte le references * 2 - pubblico stato loggedUser come logout */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L159-L164
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.addConversationHandler
addConversationHandler(handler: ConversationHandlerService) { this.logger.debug('[CHAT MANAGER] -----> addConversationHandler', this.handlers, handler); this.handlers.push(handler); }
/** * aggiungo la conversazione all'array delle conversazioni * chiamato dall'inizialize di dettaglio-conversazione.ts * @param handler */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L172-L175
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.removeConversationHandler
removeConversationHandler(conversationId) { this.logger.debug('[CHAT MANAGER] -----> removeConversationHandler: ', conversationId); const index = this.handlers.findIndex(i => i.conversationWith === conversationId); this.handlers.splice(index, 1); }
/** * rimuovo dall'array degli handlers delle conversazioni una conversazione * al momento non è utilizzato!!! * @param conversationId */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L182-L186
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.getConversationHandlerByConversationId
getConversationHandlerByConversationId(conversationId): any { let handler = null; this.handlers.forEach(conv => { // this.logger.('[CHAT MANAGER]forEach ***', conversationId, this.handlers, conv); if (conv.conversationWith === conversationId) { handler = conv; return; } });...
/** * cerco e ritorno una conversazione dall'array delle conversazioni * con conversationId coincidente con conversationId passato * chiamato dall'inizialize di dettaglio-conversazione.ts * @param conversationId */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L194-L214
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.setOffAllReferences
setOffAllReferences() { this.handlers.forEach((data) => { // const item = data.ref; // item.ref.off(); }); this.handlers = []; }
/** * elimino tutti gli hendler presenti nell'array handlers * dopo aver cancellato la reference per ogni handlers */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L220-L226
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.setConversationsHandler
setConversationsHandler(handler) { this.conversationsHandlerService = handler; }
/** * Salvo il CONVERSATIONS handler dopo averlo creato nella lista conversazioni */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L233-L235
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.disposeConversationsHandler
disposeConversationsHandler() { this.logger.debug('[CHAT MANAGER] 2 - this.conversationsHandler:: ', this.conversationsHandlerService); this.conversationsHandlerService.dispose(); }
/** * elimino la reference dell'handler delle conversazioni */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L243-L246
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
ChatManager.disposeArchivedConversationsHandler
disposeArchivedConversationsHandler() { this.logger.debug('[CHAT MANAGER] 3 - this.archivedConversationsService:: ', this.archivedConversationsService); this.archivedConversationsService.dispose(); }
/** * elimino la reference dell'handler delle conversazioni archiviate */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/chat-manager.ts#L251-L254
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
CustomTranslateService.translateLanguage
public translateLanguage(keys: any, lang?: string): Map<string, string> { // if (!lang || lang === '') { // this.language = this.translateService.currentLang; // } else { // this.language = lang; // } // this.translateService.use(this.language); return this.initialiseTranslation(keys);...
/** */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/custom-translate.service.ts#L21-L29
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
CustomTranslateService.initialiseTranslation
private initialiseTranslation(keys): Map<string, string> { const mapTranslate = new Map(); keys.forEach((key: string) => { this.translateService.get(key).subscribe((res: string) => { mapTranslate.set(key, res); }); }); return mapTranslate; }
/** */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/custom-translate.service.ts#L32-L40
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
LocalSessionStorage.getItem
getItem(key: string) { let prefix; try { // const sv = 'sv' + environment.shemaVersion + '_'; // prefix = prefix + sv; prefix = this.storagePrefix + '_'; } catch (e) { this.logger.error('[LocalSessionStorage] getItem - Error :' + e); } const newKey = prefix + this.projectID +...
/** GET item in local/session storage from key value * @param key */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/localSessionStorage.ts#L27-L38
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
LocalSessionStorage.setItem
setItem(key: string, value: any): void { // this.removeItem(key); let prefix; try { // const sv = 'sv' + environment.shemaVersion + '_'; // prefix = prefix + sv; prefix = this.storagePrefix + '_'; } catch (e) { this.logger.error('[LocalSessionStorage] setItem > Error :' + e); ...
/** SET new item in local/session storage * @param key * @param value */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/localSessionStorage.ts#L44-L56
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
LocalSessionStorage.removeItem
removeItem(key: string): void { let prefix; try { // const sv = 'sv' + environment.shemaVersion + '_'; // prefix = prefix + sv; prefix = this.storagePrefix + '_'; } catch (e) { this.logger.error('[LocalSessionStorage] removeItem > Error :' + e); } const newKey = prefix + this...
// }
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/localSessionStorage.ts#L93-L104
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
LocalSessionStorage.getValueForKey
private getValueForKey(key) { if (this.persistence === 'local' || this.persistence === 'LOCAL') { if (supports_html5_storage()) { return localStorage.getItem(key); } else { this.logger.warn('localStorage is not defind. Storage disabled'); return null; } } else if (this....
// ---------- PRIVATE METHODS start --------------- //
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/localSessionStorage.ts#L134-L159
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.initialize
async initialize(tenant: string, userId: string, translationMap: Map<string, string>) { this.logger.log('initialize FROM [APP-COMP] - FIREBASEArchivedConversationsHandlerSERVICE] tenant ', tenant, ' - userId: ', userId, ' - translationMap: ', translationMap) this.tenant = tenant; this.loggedUser...
/** * inizializzo conversations handler */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L58-L70
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.subscribeToConversations
subscribeToConversations(callback: any) { const that = this; const urlNodeFirebase = archivedConversationsPathForUserId(this.tenant, this.loggedUserId); this.logger.debug('[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations conversations::ARCHIVED urlNodeFirebase', urlNodeFire...
//----------------------------------------------------------------------------------
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L97-L119
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.countIsNew
countIsNew(): number { let num = 0; this.archivedConversations.forEach((element) => { if (element.is_new === true) { num++; } }); return num; }
/** * restituisce il numero di conversazioni nuove */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L126-L134
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.setConversationRead
setConversationRead(conversationrecipient): void { this.logger.log('[CONVS-DETAIL][FB-ARCHIVED] updateConversationBadge: '); const urlUpdate = archivedConversationsPathForUserId(this.tenant, this.loggedUserId) + '/' + conversationrecipient; const update = {}; update['/is_new'] = false; ...
//imposto la conversazione come: letta
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L137-L143
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.getClosingConversation
getClosingConversation(conversationId: string) { return this.isConversationClosingMap[conversationId]; }
/** * Returns the status of the conversations with conversationId from isConversationClosingMap * @param conversationId the conversation id * @returns true if the conversation is waiting to be closed, false otherwise */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L151-L153
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.setClosingConversation
setClosingConversation(conversationId: string, status: boolean) { this.isConversationClosingMap[conversationId] = status; }
/** * Add the conversation with conversationId to the isConversationClosingMap * @param conversationId the id of the conversation of which it wants to save the state * @param status true if the conversation is waiting to be closed, false otherwise */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L160-L162
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.deleteClosingConversation
deleteClosingConversation(conversationId: string) { this.isConversationClosingMap.delete(conversationId); }
/** * Delete the conversation with conversationId from the isConversationClosingMap * @param conversationId the id of the conversation of which is wants to delete */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L168-L170
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.dispose
dispose() { this.archivedConversations = []; this.uidConvSelected = ''; //this.ref.off(); // this.ref.off("child_changed"); // this.ref.off("child_removed"); // this.ref.off("child_added"); this.logger.debug('[FIREBASEArchivedConversationsHandlerSERVICE] DISPOSE::...
/** * dispose reference di conversations */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L215-L223
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.conversationGenerate
private conversationGenerate(childSnapshot: any): boolean { const childData: ConversationModel = childSnapshot.val(); childData.uid = childSnapshot.key; const conversation = this.completeConversation(childData); if (this.isValidConversation(conversation)) { this.setClosingCon...
// */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L248-L266
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.added
private added(childSnapshot: any) { if (this.conversationGenerate(childSnapshot)) { const index = searchIndexInArrayForUid(this.archivedConversations, childSnapshot.key); if (index > -1) { const conversationAdded = this.archivedConversations[index] this.ar...
/** * 1 - completo la conversazione con i parametri mancanti * 2 - verifico che sia una conversazione valida * 3 - salvo stato conversazione (false) nell'array delle conversazioni chiuse * 4 - aggiungo alla pos 0 la nuova conversazione all'array di conversazioni * o sostituisco la con...
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L306-L316
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.changed
private changed(childSnapshot: any) { if (this.conversationGenerate(childSnapshot)) { const index = searchIndexInArrayForUid(this.archivedConversations, childSnapshot.key); if (index > -1) { const conversationChanged = this.archivedConversations[index] thi...
/** * 1 - completo la conversazione con i parametri mancanti * 2 - verifico che sia una conversazione valida * 3 - aggiungo alla pos 0 la nuova conversazione all'array di conversazioni * 4 - salvo la conversazione nello storage * 5 - ordino l'array per timestamp * 6 - pubblico conve...
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L328-L338
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.removed
private removed(childSnapshot: any) { const index = searchIndexInArrayForUid(this.archivedConversations, childSnapshot.key); if (index > -1) { const conversationRemoved = this.archivedConversations[index] this.archivedConversations.splice(index, 1); // this.conversati...
/** * 1 - cerco indice conversazione da eliminare * 2 - elimino conversazione da array conversations * 3 - elimino la conversazione dallo storage * 4 - pubblico conversations:update * 5 - elimino conversazione dall'array delle conversazioni chiuse */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L347-L358
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.completeConversation
private completeConversation(conv): ConversationModel { conv.selected = false; if (!conv.sender_fullname || conv.sender_fullname === 'undefined' || conv.sender_fullname.trim() === '') { conv.sender_fullname = conv.sender; } if (!conv.recipient_fullname || conv.recipient_fulln...
/** * Completo conversazione aggiungendo: * 1 - nel caso in cui sender_fullname e recipient_fullname sono vuoti, imposto i rispettivi id come fullname, * in modo da avere sempre il campo fullname popolato * 2 - imposto conversation_with e conversation_with_fullname con i valori del sender o a...
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L374-L406
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.setStatusConversation
private setStatusConversation(sender: string, uid: string): string { let status = '0'; // letto if (sender === this.loggedUserId || uid === this.uidConvSelected) { status = '0'; } else { status = '1'; // non letto } return status; }
/** */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L409-L417
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.isValidConversation
private isValidConversation(convToCheck: ConversationModel): boolean { if (!this.isValidField(convToCheck.uid)) { return false; } if (!this.isValidField(convToCheck.is_new)) { return false; } if (!this.isValidField(convToCheck.last_message_text)) { ...
/** * check if the conversations is valid or not */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L422-L454
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseArchivedConversationsHandler.isValidField
private isValidField(field: any): boolean { return (field === null || field === undefined) ? false : true; }
/** * * @param field */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts#L460-L462
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseAuthService.initialize
async initialize() { this.SERVER_BASE_URL = this.getBaseUrl(); this.URL_TILEDESK_CREATE_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'chat21/firebase/auth/createCustomToken'; this.logger.debug('[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ', this.URL_TILEDESK_CREATE_CUSTOM_TOKEN) // this...
/** * */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L46-L57
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseAuthService.getToken
getToken(): string { return this.firebaseToken; }
/** */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L85-L87
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseAuthService.onAuthStateChanged
onAuthStateChanged() { const that = this; this.firebase.auth().onAuthStateChanged(user => { this.logger.debug('[FIREBASEAuthSERVICE] onAuthStateChanged', user) if (!user) { this.logger.debug('[FIREBASEAuthSERVICE] 1 - PUBLISH OFFLINE to chat-manager') that.BSAuthStateChanged.next('o...
/** * FIREBASE: onAuthStateChanged */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L94-L107
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseAuthService.signInFirebaseWithCustomToken
signInFirebaseWithCustomToken(token: string): Promise<any> { const that = this; let firebasePersistence; switch (this.getPersistence()) { case 'SESSION': { firebasePersistence = this.firebase.auth.Auth.Persistence.SESSION; break; } case 'LOCAL': { firebasePersistenc...
/** * FIREBASE: signInWithCustomToken * @param token */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L113-L144
297d30da01d98a1299e7197eb88cff5b2390a386
design-studio
github_2023
Tiledesk
typescript
FirebaseAuthService.createUserWithEmailAndPassword
createUserWithEmailAndPassword(email: string, password: string): any { const that = this; return this.firebase.auth().createUserWithEmailAndPassword(email, password).then((response) => { that.logger.debug('[FIREBASEAuthSERVICE] CRATE USER WITH EMAIL: ', email, ' & PSW: ', password); // that.firebase...
/** * FIREBASE: createUserWithEmailAndPassword * @param email * @param password * @param firstname * @param lastname */
https://github.com/Tiledesk/design-studio/blob/297d30da01d98a1299e7197eb88cff5b2390a386/src/chat21-core/providers/firebase/firebase-auth-service.ts#L153-L163
297d30da01d98a1299e7197eb88cff5b2390a386