Methods
(async) Blast(postdata, io) → {Promise}
Blast function to send messages.
Name | Type | Description |
---|---|---|
postdata | Object | the postdata object containing user data |
io | Object | the io object for socket communication |
a promise that resolves when the function completes
- Type:
- Promise
const postdata = { user_level: 2, dept: '1', tim: 'Admin', user_dept: '1', user_id: '1', idtl: '1' }
const io = io
await Blast(postdata, io)
(async) Blast(postdata, io) → {Promise}
Blast function to send messages.
Name | Type | Description |
---|---|---|
postdata | Object | the postdata object containing user data |
io | Object | the io object for socket communication |
a promise that resolves when the function completes
- Type:
- Promise
const postdata = { user_level: 2, dept: '1', tim: 'Admin', user_dept: '1', user_id: '1', idtl: '1' }
const io = io
await Blast(postdata, io)
_escapeString(val) → {string}
Escapes special characters in a string.
Name | Type | Description |
---|---|---|
val | string | The input string to be escaped. |
The escaped string.
- Type:
- string
_escapeString(val) → {string}
Escapes special characters in a string.
Name | Type | Description |
---|---|---|
val | string | The input string to be escaped. |
The escaped string.
- Type:
- string
formatDateTime(date) → {string}
Formats a given date and time into a string representation.
Name | Type | Description |
---|---|---|
date | Date | The date to be formatted. |
The formatted date and time string in the format 'YYYY-MM-DD HH:mm:ss'.
- Type:
- string
formatDateTime(date) → {string}
Formats a given date and time into a string representation.
Name | Type | Description |
---|---|---|
date | Date | The date to be formatted. |
The formatted date and time string in the format 'YYYY-MM-DD HH:mm:ss'.
- Type:
- string
(async) handleMessage(parsedMessage, isNewMessage, nasabah, res, io)
Handles incoming messages.
Name | Type | Description |
---|---|---|
parsedMessage | Object | The parsed message object. |
isNewMessage | boolean | Flag indicating if the message is new. |
nasabah | Object | The nasabah object. |
res | Object | The response object. |
io | Object | The Socket.IO server instance. |
- Source
(async) handleMessage(parsedMessage, isNewMessage, nasabah, res, io)
Handles incoming messages.
Name | Type | Description |
---|---|---|
parsedMessage | Object | The parsed message object. |
isNewMessage | boolean | Flag indicating if the message is new. |
nasabah | Object | The nasabah object. |
res | Object | The response object. |
io | Object | The Socket.IO server instance. |
- Source
(async) handleNewMessage(parsedMessage)
Handles new incoming messages.
Name | Type | Description |
---|---|---|
parsedMessage | Object | The parsed message object. |
- Source
(async) handleNewMessage(parsedMessage)
Handles new incoming messages.
Name | Type | Description |
---|---|---|
parsedMessage | Object | The parsed message object. |
- Source
(async) insertTbLogPesan(Data) → {Promise}
Inserts a record into the tb_log_pesan table.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing the details of the record to be inserted. |
A promise that resolves with the result of the execution.
- Type:
- Promise
(async) insertTbLogPesan(Data) → {Promise}
Inserts a record into the tb_log_pesan table.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing the details of the record to be inserted. |
A promise that resolves with the result of the execution.
- Type:
- Promise
(async) isHoliday(date) → {Promise.<boolean>}
Checks if a given date is a holiday.
Name | Type | Description |
---|---|---|
date | Date | The date to check. |
- Source
- True if the date is a holiday, otherwise false.
- Type:
- Promise.<boolean>
(async) isHoliday(date) → {Promise.<boolean>}
Checks if a given date is a holiday.
Name | Type | Description |
---|---|---|
date | Date | The date to check. |
- Source
- True if the date is a holiday, otherwise false.
- Type:
- Promise.<boolean>
(async) module:analytic(req, res)
Handles GET requests to "/analytic" to retrieve conversation analytics data.
Name | Type | Description |
---|---|---|
req | express. | The Express request object. |
res | express. | The Express response object. |
(async) module:analytic(req, res)
Handles GET requests to "/analytic" to retrieve conversation analytics data.
Name | Type | Description |
---|---|---|
req | express. | The Express request object. |
res | express. | The Express response object. |
module:delete_template(req, res)
Handles GET requests to "/delete_template" for deleting a template.
Name | Type | Description |
---|---|---|
req | express. | The Express request object. |
res | express. | The Express response object. |
module:delete_template(req, res)
Handles GET requests to "/delete_template" for deleting a template.
Name | Type | Description |
---|---|---|
req | express. | The Express request object. |
res | express. | The Express response object. |
parseStatus(webhookData) → {Object|null}
Parses the status from the webhook data.
Name | Type | Description |
---|---|---|
webhookData | Object | The data received from the webhook. |
- Source
- The parsed status object, or null if not applicable.
- Type:
- Object |
null
parseStatus(webhookData) → {Object|null}
Parses the status from the webhook data.
Name | Type | Description |
---|---|---|
webhookData | Object | The data received from the webhook. |
- Source
- The parsed status object, or null if not applicable.
- Type:
- Object |
null
(async) processAgentNotifications(Nasabah, parsedMessage, res)
Processes notifications for agents.
Name | Type | Description |
---|---|---|
Nasabah | Object | The nasabah object containing information about the customer. |
parsedMessage | Object | The parsed message object. |
res | Object | The response object. |
- Source
(async) processAgentNotifications(Nasabah, parsedMessage, res)
Processes notifications for agents.
Name | Type | Description |
---|---|---|
Nasabah | Object | The nasabah object containing information about the customer. |
parsedMessage | Object | The parsed message object. |
res | Object | The response object. |
- Source
replaceSpintaxWithParams(text, params) → {string}
Replaces spintax patterns in a text with the corresponding parameters.
Name | Type | Description |
---|---|---|
text | string | The text containing spintax patterns. |
params | Array | The array of parameters to replace the spintax patterns. |
The text with spintax patterns replaced with parameters.
- Type:
- string
replaceSpintaxWithParams(text, params) → {string}
Replaces spintax patterns in a text with the corresponding parameters.
Name | Type | Description |
---|---|---|
text | string | The text containing spintax patterns. |
params | Array | The array of parameters to replace the spintax patterns. |
The text with spintax patterns replaced with parameters.
- Type:
- string
(async) sendNotification(nomor, nama_divisi, nama_nasabah, nomor_nasabah, isi_pesan) → {Promise.<Object>}
Sends a notification message.
Name | Type | Description |
---|---|---|
nomor | string | The phone number to send the notification to. |
nama_divisi | string | The name of the division. |
nama_nasabah | string | The name of the customer (nasabah). |
nomor_nasabah | string | The phone number of the customer (nasabah). |
isi_pesan | string | The content of the message. |
- Source
- The response from the message sending action.
- Type:
- Promise.<Object>
(async) sendNotification(nomor, nama_divisi, nama_nasabah, nomor_nasabah, isi_pesan) → {Promise.<Object>}
Sends a notification message.
Name | Type | Description |
---|---|---|
nomor | string | The phone number to send the notification to. |
nama_divisi | string | The name of the division. |
nama_nasabah | string | The name of the customer (nasabah). |
nomor_nasabah | string | The phone number of the customer (nasabah). |
isi_pesan | string | The content of the message. |
- Source
- The response from the message sending action.
- Type:
- Promise.<Object>
(async) updateInboxLogAssign(Data) → {Promise}
Updates the inbox log assign.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing properties such as phone_id, tim, dept, idagent, idtl, idsv, idpb, idpd, and nomor. |
A promise that resolves with the result of the query execution or rejects with an error.
- Type:
- Promise
(async) updateInboxLogAssign(Data) → {Promise}
Updates the inbox log assign.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing properties such as phone_id, tim, dept, idagent, idtl, idsv, idpb, idpd, and nomor. |
A promise that resolves with the result of the query execution or rejects with an error.
- Type:
- Promise
(async) updateInboxLogUnAssign(Data) → {Promise}
Updates the inbox log to unassign a message.
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | Object | The data object containing the necessary information for updating the inbox log. Properties
|
A promise that resolves with the result of the query.
- Type:
- Promise
(async) updateInboxLogUnAssign(Data) → {Promise}
Updates the inbox log to unassign a message.
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | Object | The data object containing the necessary information for updating the inbox log. Properties
|
A promise that resolves with the result of the query.
- Type:
- Promise
(async) updateOutboxLogAssign(Data) → {Promise.<any>}
Updates the outbox log assignment.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing the following properties:
|
A promise that resolves with the result of the query execution.
- Type:
- Promise.<any>
(async) updateOutboxLogAssign(Data) → {Promise.<any>}
Updates the outbox log assignment.
Name | Type | Description |
---|---|---|
Data | Object | The data object containing the following properties:
|
A promise that resolves with the result of the query execution.
- Type:
- Promise.<any>
(async) updateOutboxLogUnAssign(Data) → {Promise}
Updates the outbox log by unassigning the specified data.
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | Object | The data to be used for updating the outbox log. Properties
|
A promise that resolves with the result of the update query.
- Type:
- Promise
(async) updateOutboxLogUnAssign(Data) → {Promise}
Updates the outbox log by unassigning the specified data.
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | Object | The data to be used for updating the outbox log. Properties
|
A promise that resolves with the result of the update query.
- Type:
- Promise
(async) updateTpl1(Data) → {Promise}
Updates the template flag in the tb_pesan_${datetb} table.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
Data | Object | The data used to update the template flag. Properties
|
A promise that resolves with the result of the update query.
- Type:
- Promise
(async) updateTpl1(Data) → {Promise}
Updates the template flag in the tb_pesan_${datetb} table.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
Data | Object | The data used to update the template flag. Properties
|
A promise that resolves with the result of the update query.
- Type:
- Promise
(async) updateTpl2(Data) → {Promise}
Updates the tpl_flag of the tb_nomor_${datetb} table to '0' for the given nomor in the Data object.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
Data | object | The data needed to update the tpl_flag. Properties
|
A promise that resolves with the result of the executeQuery function.
- Type:
- Promise
(async) updateTpl2(Data) → {Promise}
Updates the tpl_flag of the tb_nomor_${datetb} table to '0' for the given nomor in the Data object.
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
Data | object | The data needed to update the tpl_flag. Properties
|
A promise that resolves with the result of the executeQuery function.
- Type:
- Promise
Events
GET /webhook
Generates the function comment for the given function body.
- string
Name | Type | Description |
---|---|---|
app | Object | the Express app object |
- Source
- resolves when the function is complete
- Type:
- Promise.<void>
GET /webhook
Generates the function comment for the given function body.
- string
Name | Type | Description |
---|---|---|
app | Object | the Express app object |
- Source
- resolves when the function is complete
- Type:
- Promise.<void>