New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

blip-sdk

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blip-sdk - npm Package Compare versions

Comparing version 6.6.0 to 6.7.0

619

dist/blip-sdk.js

@@ -72,3 +72,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _ClientBuilder = __webpack_require__(5);
var _ClientBuilder = __webpack_require__(9);

@@ -90,2 +90,11 @@ Object.defineProperty(exports, 'ClientBuilder', {

});
var _Extensions = __webpack_require__(10);
Object.defineProperty(exports, 'Extensions', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_Extensions).default;
}
});

@@ -120,2 +129,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _ArtificialIntelligence = __webpack_require__(5);
var _ArtificialIntelligence2 = _interopRequireDefault(_ArtificialIntelligence);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -162,2 +175,4 @@

this._initializeClientChannel();
this._extensions = {};
}

@@ -383,2 +398,12 @@

}
}, {
key: '_getExtension',
value: function _getExtension(type) {
var extension = this._extensions[type];
if (!extension) {
extension = new type(this);
this._extensions[type] = extension;
}
return extension;
}

@@ -588,2 +613,7 @@ // close :: Promise ()

}
}, {
key: 'ArtificialIntelligence',
get: function get() {
return this._getExtension(_ArtificialIntelligence2.default);
}
}]);

@@ -681,6 +711,572 @@

var _UriTemplates = __webpack_require__(6);
var UriTemplates = _interopRequireWildcard(_UriTemplates);
var _ContentTypes = __webpack_require__(7);
var ContentTypes = _interopRequireWildcard(_ContentTypes);
var _limeJs = __webpack_require__(2);
var Lime = _interopRequireWildcard(_limeJs);
var _ExtensionBase2 = __webpack_require__(8);
var _ExtensionBase3 = _interopRequireDefault(_ExtensionBase2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var POSTMASTER_AI = 'postmaster@ai.msging.net';
var ArtificialIntelligenceExtension = function (_ExtensionBase) {
_inherits(ArtificialIntelligenceExtension, _ExtensionBase);
function ArtificialIntelligenceExtension(client) {
var to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
_classCallCheck(this, ArtificialIntelligenceExtension);
var _this = _possibleConstructorReturn(this, (ArtificialIntelligenceExtension.__proto__ || Object.getPrototypeOf(ArtificialIntelligenceExtension)).call(this, client));
_this._to = to ? to : POSTMASTER_AI;
return _this;
}
// Analysis
_createClass(ArtificialIntelligenceExtension, [{
key: 'getAnalysis',
value: function getAnalysis() {
var skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var take = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
var ascending = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var filter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return this._processCommand(this._createGetCommand(this._buildResourceQuery(UriTemplates.ANALYSIS, {
skip: skip,
take: take,
ascending: ascending,
$filter: filter
}), this._to));
}
}, {
key: 'analyse',
value: function analyse(analysis) {
return this._processCommand(this._createSetCommand(UriTemplates.ANALYSIS, ContentTypes.ANALYSIS, analysis, this._to));
}
}, {
key: 'setAnalysisByEmail',
value: function setAnalysisByEmail(analysis) {
return this._processCommand(this._createSetCommand(UriTemplates.ANALYSIS_EMAIL, null, analysis, this._to));
}
}, {
key: 'setAnalysisFeedback',
value: function setAnalysisFeedback(id, analysisFeedback) {
return this._processCommand(this._createSetCommand(this._buildUri(UriTemplates.ANALYSIS_FEEDBACK, id), ContentTypes.ANALYSIS_FEEDBACK, analysisFeedback, this._to));
}
// Analytics (Confusion Matrix)
}, {
key: 'getAnalytics',
value: function getAnalytics() {
var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var uri = id ? this._buildUri(UriTemplates.ANALYTICS_ID, id) : UriTemplates.ANALYTICS;
return this._processCommand(this._createGetCommand(uri, this._to));
}
}, {
key: 'setAnalytics',
value: function setAnalytics(confusionMatrix) {
return this._processCommand(this._createSetCommand(UriTemplates.ANALYTICS, ContentTypes.CONFUSION_MATRIX, confusionMatrix, this._to));
}
}, {
key: 'deleteAnalytics',
value: function deleteAnalytics(id) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.ANALYTICS_ID, id), this._to));
}
// Intents
}, {
key: 'getIntent',
value: function getIntent(id) {
var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return this._processCommand(this._createGetCommand(this._buildResourceQuery(this._buildUri(UriTemplates.INTENTION, id), {
deep: deep
}), this._to));
}
}, {
key: 'getIntents',
value: function getIntents() {
var skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var take = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
var ascending = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
return this._processCommand(this._createGetCommand(this._buildResourceQuery(UriTemplates.INTENTIONS, {
skip: skip,
take: take,
deep: deep,
name: name,
ascending: ascending
}), this._to));
}
}, {
key: 'setIntent',
value: function setIntent(intent) {
return this._processCommand(this._createSetCommand(UriTemplates.INTENTIONS, ContentTypes.INTENTION, intent, this._to));
}
}, {
key: 'setIntents',
value: function setIntents(intents) {
return this._processCommand(this._createSetCommand(UriTemplates.INTENTIONS, Lime.ContentTypes.COLLECTION, {
itemType: ContentTypes.INTENTION,
items: intents
}, this._to));
}
}, {
key: 'mergeIntent',
value: function mergeIntent(intent) {
return this._processCommand(this._createMergeCommand(UriTemplates.INTENTIONS, ContentTypes.INTENTION, intent, this._to));
}
}, {
key: 'mergeIntents',
value: function mergeIntents(intents) {
return this._processCommand(this._createMergeCommand(UriTemplates.INTENTIONS, Lime.ContentTypes.COLLECTION, {
itemType: ContentTypes.INTENTION,
items: intents
}, this._to));
}
}, {
key: 'deleteIntent',
value: function deleteIntent(id) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.INTENTION, id), this._to));
}
}, {
key: 'deleteIntents',
value: function deleteIntents() {
return this._processCommand(this._createDeleteCommand(UriTemplates.INTENTIONS, this._to));
}
// Answers
}, {
key: 'getIntentAnswers',
value: function getIntentAnswers(id) {
var skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var take = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
var ascending = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
return this._processCommand(this._createGetCommand(this._buildResourceQuery(this._buildUri(UriTemplates.INTENTION_ANSWERS, id), {
skip: skip,
take: take,
ascending: ascending
}), this._to));
}
}, {
key: 'setIntentAnswers',
value: function setIntentAnswers(id, answers) {
return this._processCommand(this._createSetCommand(this._buildUri(UriTemplates.INTENTION_ANSWERS, id), Lime.ContentTypes.COLLECTION, {
itemType: ContentTypes.ANSWER,
items: answers
}, this._to));
}
}, {
key: 'deleteIntentAnswer',
value: function deleteIntentAnswer(id, answerId) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.INTENTION_ANSWER, id, answerId), this._to));
}
// Questions
}, {
key: 'getIntentQuestions',
value: function getIntentQuestions(id) {
return this._processCommand(this._createGetCommand(this._buildUri(UriTemplates.INTENTION_QUESTIONS, id), this._to));
}
}, {
key: 'setIntentQuestions',
value: function setIntentQuestions(id, questions) {
return this._processCommand(this._createSetCommand(this._buildUri(UriTemplates.INTENTION_QUESTIONS, id), Lime.ContentTypes.COLLECTION, {
itemType: ContentTypes.QUESTION,
items: questions
}, this._to));
}
}, {
key: 'deleteIntentQuestion',
value: function deleteIntentQuestion(id, questionId) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.INTENTION_QUESTION, id, questionId), this._to));
}
// Entity
}, {
key: 'getEntity',
value: function getEntity(id) {
return this._processCommand(this._createGetCommand(this._buildUri(UriTemplates.ENTITY, id), this._to));
}
}, {
key: 'getEntities',
value: function getEntities() {
var skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var take = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
var ascending = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return this._processCommand(this._createGetCommand(this._buildResourceQuery(UriTemplates.ENTITIES, {
skip: skip,
take: take,
ascending: ascending,
name: name
}), this._to));
}
}, {
key: 'setEntity',
value: function setEntity(entity) {
return this._processCommand(this._createSetCommand(UriTemplates.ENTITIES, ContentTypes.ENTITY, entity, this._to));
}
}, {
key: 'deleteEntity',
value: function deleteEntity(id) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.ENTITY, id), this._to));
}
}, {
key: 'deleteEntities',
value: function deleteEntities() {
return this._processCommand(this._createDeleteCommand(UriTemplates.ENTITIES, this._to));
}
// Model
}, {
key: 'getModels',
value: function getModels() {
var skip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var take = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
var ascending = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
return this._processCommand(this._createGetCommand(this._buildResourceQuery(UriTemplates.MODELS, {
$skip: skip,
$take: take,
$ascending: ascending
}), this._to));
}
}, {
key: 'getModel',
value: function getModel(id) {
return this._processCommand(this._createGetCommand(this._buildUri(UriTemplates.MODEL, id), this._to));
}
}, {
key: 'getModelSummary',
value: function getModelSummary() {
return this._processCommand(this._createGetCommand(UriTemplates.MODELS_SUMMARY, this._to));
}
}, {
key: 'trainModel',
value: function trainModel() {
return this._processCommand(this._createSetCommand(UriTemplates.MODELS, ContentTypes.MODEL_TRAINING, {}, this._to));
}
}, {
key: 'publishModel',
value: function publishModel(id) {
return this._processCommand(this._createSetCommand(UriTemplates.MODELS, ContentTypes.MODEL_PUBLISHING, {
id: id
}, this._to));
}
// Word Set
}, {
key: 'getWordSet',
value: function getWordSet(id, deep) {
return this._processCommand(this._createGetCommand(this._buildResourceQuery(this._buildUri(UriTemplates.WORD_SET, id), {
deep: deep
}), this._to));
}
}, {
key: 'getWordSets',
value: function getWordSets(deep) {
return this._processCommand(this._createGetCommand(this._buildResourceQuery(UriTemplates.WORD_SETS, {
deep: deep
}), this._to));
}
}, {
key: 'setWordSetResource',
value: function setWordSetResource(id, resource) {
return this._processCommand(this._createSetCommand(this._buildUri(UriTemplates.WORD_SET, id), Lime.ContentTypes.COLLECTION, {
itemType: ContentTypes.WORD_SET_WORD,
items: resource
}, this._to));
}
}, {
key: 'setWordSet',
value: function setWordSet(wordSet) {
return this._processCommand(this._createSetCommand(UriTemplates.WORD_SETS, ContentTypes.WORD_SET, wordSet, this._to));
}
}, {
key: 'deleteWordSet',
value: function deleteWordSet(id) {
return this._processCommand(this._createDeleteCommand(this._buildUri(UriTemplates.WORD_SET, id), this._to));
}
}, {
key: 'analyseWordSet',
value: function analyseWordSet(analysis) {
return this._processCommand(this._createSetCommand(UriTemplates.WORD_SETS_ANALYSIS, ContentTypes.WORD_SETS_ANALYSIS, analysis, this._to));
}
}]);
return ArtificialIntelligenceExtension;
}(_ExtensionBase3.default);
exports.default = ArtificialIntelligenceExtension;
module.exports = exports['default'];
/***/ }),
/* 6 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var ANALYSIS = exports.ANALYSIS = '/analysis';
var ANALYSIS_FEEDBACK = exports.ANALYSIS_FEEDBACK = '/analysis/{0}/feedback';
var ANALYSIS_EMAIL = exports.ANALYSIS_EMAIL = '/enhancement/send-by-email';
var ANALYTICS = exports.ANALYTICS = '/analytics/confusion-matrix';
var ANALYTICS_ID = exports.ANALYTICS_ID = '/analytics/confusion-matrix/{0}';
var INTENTIONS = exports.INTENTIONS = '/intentions';
var INTENTION = exports.INTENTION = '/intentions/{0}';
var INTENTION_ANSWERS = exports.INTENTION_ANSWERS = '/intentions/{0}/answers';
var INTENTION_ANSWER = exports.INTENTION_ANSWER = '/intentions/{0}/answers/{1}';
var INTENTION_QUESTIONS = exports.INTENTION_QUESTIONS = '/intentions/{0}/questions';
var INTENTION_QUESTION = exports.INTENTION_QUESTION = '/intentions/{0}/questions/{1}';
var ENTITY = exports.ENTITY = '/entities/{0}';
var ENTITIES = exports.ENTITIES = '/entities';
var MODELS = exports.MODELS = '/models';
var MODEL = exports.MODEL = '/model/{0}';
var MODELS_SUMMARY = exports.MODELS_SUMMARY = '/models/summary';
var WORD_SETS = exports.WORD_SETS = '/word-sets';
var WORD_SET = exports.WORD_SET = '/word-sets/{0}';
var WORD_SETS_ANALYSIS = exports.WORD_SETS_ANALYSIS = '/word-sets-analysis ';
/***/ }),
/* 7 */
/***/ (function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var INTENTION = exports.INTENTION = 'application/vnd.iris.ai.intention+json';
var ENTITY = exports.ENTITY = 'application/vnd.iris.ai.entity+json';
var ANSWER = exports.ANSWER = 'application/vnd.iris.ai.answer+json';
var QUESTION = exports.QUESTION = 'application/vnd.iris.ai.question+json';
var CONFUSION_MATRIX = exports.CONFUSION_MATRIX = 'application/vnd.iris.ai.confusion-matrix+json';
var ANALYSIS_FEEDBACK = exports.ANALYSIS_FEEDBACK = 'application/vnd.iris.ai.analysis-feedback+json';
var MODEL_TRAINING = exports.MODEL_TRAINING = 'application/vnd.iris.ai.model-training+json';
var MODEL_PUBLISHING = exports.MODEL_PUBLISHING = 'application/vnd.iris.ai.model-publishing+json';
var WORD_SET = exports.WORD_SET = 'application/vnd.iris.ai.word-set+json';
var WORD_SET_WORD = exports.WORD_SET_WORD = 'application/vnd.iris.ai.word+json';
var WORD_SET_ANALYSIS = exports.WORD_SET_ANALYSIS = 'application/vnd.iris.ai.word-set-analysis+json';
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _limeJs = __webpack_require__(2);
var _limeJs2 = _interopRequireDefault(_limeJs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ExtensionBase = function () {
function ExtensionBase(client) {
_classCallCheck(this, ExtensionBase);
this._client = client;
}
_createClass(ExtensionBase, [{
key: '_createGetCommand',
value: function _createGetCommand(uri, to) {
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
return {
id: id ? id : _limeJs2.default.Guid(),
to: to,
method: 'get',
uri: uri
};
}
}, {
key: '_createSetCommand',
value: function _createSetCommand(uri, type, resource, to) {
var id = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
var command = {
id: id ? id : _limeJs2.default.Guid(),
to: to,
method: 'set',
uri: uri,
resource: resource
};
if (type) {
command.type = type;
}
return command;
}
}, {
key: '_createMergeCommand',
value: function _createMergeCommand(uri, type, resource, to) {
var id = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
return {
id: id ? id : _limeJs2.default.Guid(),
to: to,
method: 'merge',
uri: uri,
type: type,
resource: resource
};
}
}, {
key: '_createDeleteCommand',
value: function _createDeleteCommand(uri, to) {
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
return {
id: id ? id : _limeJs2.default.Guid(),
to: to,
method: 'delete',
uri: uri
};
}
}, {
key: '_processCommand',
value: function _processCommand(command) {
command = _extends({}, command, {
id: command.id ? command.id : _limeJs2.default.Guid()
});
return this._client.sendCommand(command).then(function (response) {
if (!response) {
return;
}
if (response.itemType && response.items) {
return response.items;
}
return response;
});
}
}, {
key: '_buildResourceQuery',
value: function _buildResourceQuery(uri, query) {
var i = 0;
Object.keys(query).forEach(function (key) {
var value = query[key].toString();
if (value) {
uri += i === 0 ? '?' : '&';
uri += key + '=' + value;
i += 1;
}
});
return encodeURI(uri);
}
}, {
key: '_buildUri',
value: function _buildUri(uri) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
args.forEach(function (arg, i) {
uri = uri.replace('{' + i + '}', arg);
});
return uri;
}
}]);
return ExtensionBase;
}();
exports.default = ExtensionBase;
module.exports = exports['default'];
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _limeJs = __webpack_require__(2);
var _limeJs2 = _interopRequireDefault(_limeJs);
var _Client = __webpack_require__(1);

@@ -861,2 +1457,23 @@

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ArtificialIntelligence = __webpack_require__(5);
var _ArtificialIntelligence2 = _interopRequireDefault(_ArtificialIntelligence);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
ArtificialIntelligence: _ArtificialIntelligence2.default
};
module.exports = exports['default'];
/***/ })

@@ -863,0 +1480,0 @@ /******/ ])

4

package.json
{
"name": "blip-sdk",
"version": "6.6.0",
"version": "6.7.0",
"description": "BLiP SDK JavaScript",

@@ -56,3 +56,3 @@ "main": "dist/blip-sdk.js",

"js-base64": "^2.1.9",
"lime-js": "^2.5.1",
"lime-js": "^2.5.2",
"lime-transport-websocket": "^2.0.0"

@@ -59,0 +59,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc