@google/chatbase
Advanced tools
Comparing version 0.0.2 to 1.0.0
@@ -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 |
{ | ||
"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); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
152081
3730
1
5