Socket
Socket
Sign inDemoInstall

@google/chatbase

Package Overview
Dependencies
30
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 1.0.0

24

lib/MessageSink.js

@@ -31,3 +31,3 @@ /**

const MSG_CREATE_EXPORT_KEYS = ['api_key', 'user_id', 'type', 'time_stamp',
'platform', 'message', 'intent', 'version'];
'platform', 'message', 'intent', 'version', 'response_time'];
const REQUIRED_MSG_CREATE_EXPORT_KEYS = ['api_key', 'type', 'user_id',

@@ -206,2 +206,13 @@ 'time_stamp', 'platform', 'message'];

this.message_id = null;
/**
* OPTIONAL: This is an optional field which will be omitted from the
* serialized message given that its value remains unchanged from its
* default.
* The response time of the agent to the user message.
* @type {Number}
* @memberof MessageSink
* @instance
* @default
*/
this.response_time = null;
}

@@ -332,2 +343,13 @@ /**

/**
* Sets the instance response_time field to the given number
* @function setUserId
* @param {Number} responseTime - the response time of the agent to the user
* message.
* @chainable
*/
setResponseTime (responseTime) {
this.response_time = responseTime;
return this;
}
/**
* Validates instance properties to determine whether or not the not_handled

@@ -334,0 +356,0 @@ * and user fields are correctly set on the instance

5

package.json
{
"name": "@google/chatbase",
"version": "0.0.2",
"version": "1.0.0",
"description": "",

@@ -43,3 +43,6 @@ "main": "index.js",

]
},
"engines": {
"node": ">=6.5"
}
}

@@ -45,2 +45,3 @@ /**

.setIntent('book-hotel')
.setResponseTime(5)
.setAsNotHandled()

@@ -47,0 +48,0 @@ .setAsFeedback();

@@ -37,2 +37,3 @@ /**

.setIntent('book-flight')
.setResponseTime(1.03)
.setAsNotHandled()

@@ -39,0 +40,0 @@ .setAsFeedback()

@@ -73,2 +73,7 @@ /**

test('Should set the response time to the given value', t => {
const r = 1.23
t.is(inst.setResponseTime(r).response_time, r);
});
test('Should set the instance as not handled', t => {

@@ -75,0 +80,0 @@ t.is(inst.setAsHandled().not_handled, false);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc