@pairsystems/goodmem-client 1.0.0-beta.1 → 1.0.0-dev.cb052d6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -82
- package/dist/ApiClient.js +33 -52
- package/dist/api/APIKeysApi.js +72 -51
- package/dist/api/EmbeddersApi.js +93 -63
- package/dist/api/MemoriesApi.js +263 -80
- package/dist/api/RerankersApi.js +262 -0
- package/dist/api/SpacesApi.js +100 -66
- package/dist/api/SystemApi.js +24 -18
- package/dist/api/UsersApi.js +100 -26
- package/dist/client.js +26 -1
- package/dist/index.js +181 -0
- package/dist/model/AbstractReply.js +138 -0
- package/dist/model/ApiKeyResponse.js +5 -5
- package/dist/model/BatchMemoryCreationRequest.js +5 -5
- package/dist/model/BatchMemoryDeletionRequest.js +5 -5
- package/dist/model/BatchMemoryRetrievalRequest.js +5 -5
- package/dist/model/BinaryContent.js +129 -0
- package/dist/model/ChunkReference.js +152 -0
- package/dist/model/ChunkingConfiguration.js +115 -0
- package/dist/model/ContextItem.js +136 -0
- package/dist/model/CreateApiKeyRequest.js +5 -5
- package/dist/model/CreateApiKeyResponse.js +5 -5
- package/dist/model/DistributionType.js +58 -0
- package/dist/model/EmbedderCreationRequest.js +20 -9
- package/dist/model/EmbedderResponse.js +20 -9
- package/dist/model/EmbedderWeight.js +125 -0
- package/dist/model/GoodMemStatus.js +129 -0
- package/dist/model/LengthMeasurement.js +63 -0
- package/dist/model/ListApiKeysResponse.js +5 -5
- package/dist/model/ListEmbeddersResponse.js +5 -5
- package/dist/model/ListRerankersResponse.js +132 -0
- package/dist/model/ListSpacesResponse.js +5 -5
- package/dist/model/Memory.js +23 -15
- package/dist/model/MemoryChunkResponse.js +240 -0
- package/dist/model/MemoryCreationRequest.js +21 -9
- package/dist/model/MemoryListResponse.js +5 -5
- package/dist/model/Modality.js +4 -4
- package/dist/model/PostProcessor.js +125 -0
- package/dist/model/ProviderType.js +9 -4
- package/dist/model/RecursiveChunkingConfiguration.js +165 -0
- package/dist/model/RerankerCreationRequest.js +266 -0
- package/dist/model/RerankerResponse.js +316 -0
- package/dist/model/ResultSetBoundary.js +153 -0
- package/dist/model/RetrieveMemoryEvent.js +148 -0
- package/dist/model/RetrieveMemoryRequest.js +219 -0
- package/dist/model/RetrievedItem.js +106 -0
- package/dist/model/SentenceChunkingConfiguration.js +141 -0
- package/dist/model/SeparatorKeepStrategy.js +63 -0
- package/dist/model/Space.js +19 -5
- package/dist/model/SpaceCreationRequest.js +19 -5
- package/dist/model/SpaceEmbedder.js +5 -5
- package/dist/model/SpaceEmbedderConfig.js +5 -5
- package/dist/model/SpaceKey.js +145 -0
- package/dist/model/SystemInitResponse.js +5 -5
- package/dist/model/UpdateApiKeyRequest.js +5 -5
- package/dist/model/UpdateEmbedderRequest.js +5 -5
- package/dist/model/UpdateRerankerRequest.js +226 -0
- package/dist/model/UpdateSpaceRequest.js +22 -44
- package/dist/model/UserResponse.js +5 -5
- package/dist/streaming.js +649 -0
- package/package.json +4 -36
|
@@ -12,11 +12,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
12
12
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
17
17
|
*
|
|
18
|
-
* The version of the OpenAPI document:
|
|
19
|
-
*
|
|
18
|
+
* The version of the OpenAPI document:
|
|
19
|
+
*
|
|
20
20
|
*
|
|
21
21
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
22
|
* https://openapi-generator.tech
|
|
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
26
26
|
/**
|
|
27
27
|
* The ApiKeyResponse model module.
|
|
28
28
|
* @module model/ApiKeyResponse
|
|
29
|
-
* @version
|
|
29
|
+
* @version 1.0.0
|
|
30
30
|
*/
|
|
31
31
|
var ApiKeyResponse = /*#__PURE__*/function () {
|
|
32
32
|
/**
|
|
@@ -16,11 +16,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
16
16
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
18
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
*
|
|
20
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
21
21
|
*
|
|
22
|
-
* The version of the OpenAPI document:
|
|
23
|
-
*
|
|
22
|
+
* The version of the OpenAPI document:
|
|
23
|
+
*
|
|
24
24
|
*
|
|
25
25
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
26
|
* https://openapi-generator.tech
|
|
@@ -30,7 +30,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
30
30
|
/**
|
|
31
31
|
* The BatchMemoryCreationRequest model module.
|
|
32
32
|
* @module model/BatchMemoryCreationRequest
|
|
33
|
-
* @version
|
|
33
|
+
* @version 1.0.0
|
|
34
34
|
*/
|
|
35
35
|
var BatchMemoryCreationRequest = /*#__PURE__*/function () {
|
|
36
36
|
/**
|
|
@@ -15,11 +15,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
15
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
20
20
|
*
|
|
21
|
-
* The version of the OpenAPI document:
|
|
22
|
-
*
|
|
21
|
+
* The version of the OpenAPI document:
|
|
22
|
+
*
|
|
23
23
|
*
|
|
24
24
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
25
|
* https://openapi-generator.tech
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
/**
|
|
30
30
|
* The BatchMemoryDeletionRequest model module.
|
|
31
31
|
* @module model/BatchMemoryDeletionRequest
|
|
32
|
-
* @version
|
|
32
|
+
* @version 1.0.0
|
|
33
33
|
*/
|
|
34
34
|
var BatchMemoryDeletionRequest = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -15,11 +15,11 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
15
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
20
20
|
*
|
|
21
|
-
* The version of the OpenAPI document:
|
|
22
|
-
*
|
|
21
|
+
* The version of the OpenAPI document:
|
|
22
|
+
*
|
|
23
23
|
*
|
|
24
24
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
25
|
* https://openapi-generator.tech
|
|
@@ -29,7 +29,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
29
29
|
/**
|
|
30
30
|
* The BatchMemoryRetrievalRequest model module.
|
|
31
31
|
* @module model/BatchMemoryRetrievalRequest
|
|
32
|
-
* @version
|
|
32
|
+
* @version 1.0.0
|
|
33
33
|
*/
|
|
34
34
|
var BatchMemoryRetrievalRequest = /*#__PURE__*/function () {
|
|
35
35
|
/**
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
18
|
+
*
|
|
19
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
20
|
+
*
|
|
21
|
+
* The version of the OpenAPI document:
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
25
|
+
* https://openapi-generator.tech
|
|
26
|
+
* Do not edit the class manually.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The BinaryContent model module.
|
|
31
|
+
* @module model/BinaryContent
|
|
32
|
+
* @version 1.0.0
|
|
33
|
+
*/
|
|
34
|
+
var BinaryContent = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>BinaryContent</code>.
|
|
37
|
+
* Binary content with MIME type for context items.
|
|
38
|
+
* @alias module:model/BinaryContent
|
|
39
|
+
* @param contentType {String} MIME type of the binary content.
|
|
40
|
+
* @param data {String} Base64-encoded binary data.
|
|
41
|
+
*/
|
|
42
|
+
function BinaryContent(contentType, data) {
|
|
43
|
+
_classCallCheck(this, BinaryContent);
|
|
44
|
+
BinaryContent.initialize(this, contentType, data);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(BinaryContent, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, contentType, data) {
|
|
55
|
+
obj['contentType'] = contentType;
|
|
56
|
+
obj['data'] = data;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>BinaryContent</code> from a plain JavaScript object, optionally creating a new instance.
|
|
61
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
62
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
63
|
+
* @param {module:model/BinaryContent} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/BinaryContent} The populated <code>BinaryContent</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new BinaryContent();
|
|
71
|
+
if (data.hasOwnProperty('contentType')) {
|
|
72
|
+
obj['contentType'] = _ApiClient["default"].convertToType(data['contentType'], 'String');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('data')) {
|
|
75
|
+
obj['data'] = _ApiClient["default"].convertToType(data['data'], 'String');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Validates the JSON data with respect to <code>BinaryContent</code>.
|
|
83
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
84
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>BinaryContent</code>.
|
|
85
|
+
*/
|
|
86
|
+
}, {
|
|
87
|
+
key: "validateJSON",
|
|
88
|
+
value: function validateJSON(data) {
|
|
89
|
+
// check to make sure all required properties are present in the JSON string
|
|
90
|
+
var _iterator = _createForOfIteratorHelper(BinaryContent.RequiredProperties),
|
|
91
|
+
_step;
|
|
92
|
+
try {
|
|
93
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
94
|
+
var property = _step.value;
|
|
95
|
+
if (!data.hasOwnProperty(property)) {
|
|
96
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// ensure the json data is a string
|
|
100
|
+
} catch (err) {
|
|
101
|
+
_iterator.e(err);
|
|
102
|
+
} finally {
|
|
103
|
+
_iterator.f();
|
|
104
|
+
}
|
|
105
|
+
if (data['contentType'] && !(typeof data['contentType'] === 'string' || data['contentType'] instanceof String)) {
|
|
106
|
+
throw new Error("Expected the field `contentType` to be a primitive type in the JSON string but got " + data['contentType']);
|
|
107
|
+
}
|
|
108
|
+
// ensure the json data is a string
|
|
109
|
+
if (data['data'] && !(typeof data['data'] === 'string' || data['data'] instanceof String)) {
|
|
110
|
+
throw new Error("Expected the field `data` to be a primitive type in the JSON string but got " + data['data']);
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
}();
|
|
116
|
+
BinaryContent.RequiredProperties = ["contentType", "data"];
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* MIME type of the binary content.
|
|
120
|
+
* @member {String} contentType
|
|
121
|
+
*/
|
|
122
|
+
BinaryContent.prototype['contentType'] = undefined;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Base64-encoded binary data.
|
|
126
|
+
* @member {String} data
|
|
127
|
+
*/
|
|
128
|
+
BinaryContent.prototype['data'] = undefined;
|
|
129
|
+
var _default = exports["default"] = BinaryContent;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _MemoryChunkResponse = _interopRequireDefault(require("./MemoryChunkResponse"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
+
*
|
|
20
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
21
|
+
*
|
|
22
|
+
* The version of the OpenAPI document:
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
|
+
* https://openapi-generator.tech
|
|
27
|
+
* Do not edit the class manually.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The ChunkReference model module.
|
|
32
|
+
* @module model/ChunkReference
|
|
33
|
+
* @version 1.0.0
|
|
34
|
+
*/
|
|
35
|
+
var ChunkReference = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>ChunkReference</code>.
|
|
38
|
+
* Reference to a memory chunk with pointer to its parent memory
|
|
39
|
+
* @alias module:model/ChunkReference
|
|
40
|
+
* @param resultSetId {String} Result set ID that produced this chunk
|
|
41
|
+
* @param chunk {module:model/MemoryChunkResponse}
|
|
42
|
+
* @param memoryIndex {Number} Index of the chunk's memory in the client's memories array
|
|
43
|
+
* @param relevanceScore {Number} Relevance score for this chunk (0.0 to 1.0)
|
|
44
|
+
*/
|
|
45
|
+
function ChunkReference(resultSetId, chunk, memoryIndex, relevanceScore) {
|
|
46
|
+
_classCallCheck(this, ChunkReference);
|
|
47
|
+
ChunkReference.initialize(this, resultSetId, chunk, memoryIndex, relevanceScore);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Initializes the fields of this object.
|
|
52
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
53
|
+
* Only for internal use.
|
|
54
|
+
*/
|
|
55
|
+
return _createClass(ChunkReference, null, [{
|
|
56
|
+
key: "initialize",
|
|
57
|
+
value: function initialize(obj, resultSetId, chunk, memoryIndex, relevanceScore) {
|
|
58
|
+
obj['resultSetId'] = resultSetId;
|
|
59
|
+
obj['chunk'] = chunk;
|
|
60
|
+
obj['memoryIndex'] = memoryIndex;
|
|
61
|
+
obj['relevanceScore'] = relevanceScore;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a <code>ChunkReference</code> from a plain JavaScript object, optionally creating a new instance.
|
|
66
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
67
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
68
|
+
* @param {module:model/ChunkReference} obj Optional instance to populate.
|
|
69
|
+
* @return {module:model/ChunkReference} The populated <code>ChunkReference</code> instance.
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "constructFromObject",
|
|
73
|
+
value: function constructFromObject(data, obj) {
|
|
74
|
+
if (data) {
|
|
75
|
+
obj = obj || new ChunkReference();
|
|
76
|
+
if (data.hasOwnProperty('resultSetId')) {
|
|
77
|
+
obj['resultSetId'] = _ApiClient["default"].convertToType(data['resultSetId'], 'String');
|
|
78
|
+
}
|
|
79
|
+
if (data.hasOwnProperty('chunk')) {
|
|
80
|
+
obj['chunk'] = _MemoryChunkResponse["default"].constructFromObject(data['chunk']);
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('memoryIndex')) {
|
|
83
|
+
obj['memoryIndex'] = _ApiClient["default"].convertToType(data['memoryIndex'], 'Number');
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('relevanceScore')) {
|
|
86
|
+
obj['relevanceScore'] = _ApiClient["default"].convertToType(data['relevanceScore'], 'Number');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return obj;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Validates the JSON data with respect to <code>ChunkReference</code>.
|
|
94
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
95
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ChunkReference</code>.
|
|
96
|
+
*/
|
|
97
|
+
}, {
|
|
98
|
+
key: "validateJSON",
|
|
99
|
+
value: function validateJSON(data) {
|
|
100
|
+
// check to make sure all required properties are present in the JSON string
|
|
101
|
+
var _iterator = _createForOfIteratorHelper(ChunkReference.RequiredProperties),
|
|
102
|
+
_step;
|
|
103
|
+
try {
|
|
104
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
105
|
+
var property = _step.value;
|
|
106
|
+
if (!data.hasOwnProperty(property)) {
|
|
107
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// ensure the json data is a string
|
|
111
|
+
} catch (err) {
|
|
112
|
+
_iterator.e(err);
|
|
113
|
+
} finally {
|
|
114
|
+
_iterator.f();
|
|
115
|
+
}
|
|
116
|
+
if (data['resultSetId'] && !(typeof data['resultSetId'] === 'string' || data['resultSetId'] instanceof String)) {
|
|
117
|
+
throw new Error("Expected the field `resultSetId` to be a primitive type in the JSON string but got " + data['resultSetId']);
|
|
118
|
+
}
|
|
119
|
+
// validate the optional field `chunk`
|
|
120
|
+
if (data['chunk']) {
|
|
121
|
+
// data not null
|
|
122
|
+
_MemoryChunkResponse["default"].validateJSON(data['chunk']);
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
127
|
+
}();
|
|
128
|
+
ChunkReference.RequiredProperties = ["resultSetId", "chunk", "memoryIndex", "relevanceScore"];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Result set ID that produced this chunk
|
|
132
|
+
* @member {String} resultSetId
|
|
133
|
+
*/
|
|
134
|
+
ChunkReference.prototype['resultSetId'] = undefined;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @member {module:model/MemoryChunkResponse} chunk
|
|
138
|
+
*/
|
|
139
|
+
ChunkReference.prototype['chunk'] = undefined;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Index of the chunk's memory in the client's memories array
|
|
143
|
+
* @member {Number} memoryIndex
|
|
144
|
+
*/
|
|
145
|
+
ChunkReference.prototype['memoryIndex'] = undefined;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Relevance score for this chunk (0.0 to 1.0)
|
|
149
|
+
* @member {Number} relevanceScore
|
|
150
|
+
*/
|
|
151
|
+
ChunkReference.prototype['relevanceScore'] = undefined;
|
|
152
|
+
var _default = exports["default"] = ChunkReference;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _RecursiveChunkingConfiguration = _interopRequireDefault(require("./RecursiveChunkingConfiguration"));
|
|
9
|
+
var _SentenceChunkingConfiguration = _interopRequireDefault(require("./SentenceChunkingConfiguration"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
17
|
+
*
|
|
18
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
19
|
+
*
|
|
20
|
+
* The version of the OpenAPI document:
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
24
|
+
* https://openapi-generator.tech
|
|
25
|
+
* Do not edit the class manually.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The ChunkingConfiguration model module.
|
|
30
|
+
* @module model/ChunkingConfiguration
|
|
31
|
+
* @version 1.0.0
|
|
32
|
+
*/
|
|
33
|
+
var ChunkingConfiguration = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>ChunkingConfiguration</code>.
|
|
36
|
+
* Configuration for text chunking strategy used when processing content
|
|
37
|
+
* @alias module:model/ChunkingConfiguration
|
|
38
|
+
*/
|
|
39
|
+
function ChunkingConfiguration() {
|
|
40
|
+
_classCallCheck(this, ChunkingConfiguration);
|
|
41
|
+
ChunkingConfiguration.initialize(this);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initializes the fields of this object.
|
|
46
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
47
|
+
* Only for internal use.
|
|
48
|
+
*/
|
|
49
|
+
return _createClass(ChunkingConfiguration, null, [{
|
|
50
|
+
key: "initialize",
|
|
51
|
+
value: function initialize(obj) {}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a <code>ChunkingConfiguration</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
+
* @param {module:model/ChunkingConfiguration} obj Optional instance to populate.
|
|
58
|
+
* @return {module:model/ChunkingConfiguration} The populated <code>ChunkingConfiguration</code> instance.
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "constructFromObject",
|
|
62
|
+
value: function constructFromObject(data, obj) {
|
|
63
|
+
if (data) {
|
|
64
|
+
obj = obj || new ChunkingConfiguration();
|
|
65
|
+
if (data.hasOwnProperty('none')) {
|
|
66
|
+
obj['none'] = _ApiClient["default"].convertToType(data['none'], Object);
|
|
67
|
+
}
|
|
68
|
+
if (data.hasOwnProperty('recursive')) {
|
|
69
|
+
obj['recursive'] = _RecursiveChunkingConfiguration["default"].constructFromObject(data['recursive']);
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('sentence')) {
|
|
72
|
+
obj['sentence'] = _SentenceChunkingConfiguration["default"].constructFromObject(data['sentence']);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Validates the JSON data with respect to <code>ChunkingConfiguration</code>.
|
|
80
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
81
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ChunkingConfiguration</code>.
|
|
82
|
+
*/
|
|
83
|
+
}, {
|
|
84
|
+
key: "validateJSON",
|
|
85
|
+
value: function validateJSON(data) {
|
|
86
|
+
// validate the optional field `recursive`
|
|
87
|
+
if (data['recursive']) {
|
|
88
|
+
// data not null
|
|
89
|
+
_RecursiveChunkingConfiguration["default"].validateJSON(data['recursive']);
|
|
90
|
+
}
|
|
91
|
+
// validate the optional field `sentence`
|
|
92
|
+
if (data['sentence']) {
|
|
93
|
+
// data not null
|
|
94
|
+
_SentenceChunkingConfiguration["default"].validateJSON(data['sentence']);
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}]);
|
|
99
|
+
}();
|
|
100
|
+
/**
|
|
101
|
+
* No chunking strategy - preserves original content as a single unit
|
|
102
|
+
* @member {Object} none
|
|
103
|
+
*/
|
|
104
|
+
ChunkingConfiguration.prototype['none'] = undefined;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @member {module:model/RecursiveChunkingConfiguration} recursive
|
|
108
|
+
*/
|
|
109
|
+
ChunkingConfiguration.prototype['recursive'] = undefined;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @member {module:model/SentenceChunkingConfiguration} sentence
|
|
113
|
+
*/
|
|
114
|
+
ChunkingConfiguration.prototype['sentence'] = undefined;
|
|
115
|
+
var _default = exports["default"] = ChunkingConfiguration;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _BinaryContent = _interopRequireDefault(require("./BinaryContent"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
+
*
|
|
20
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
21
|
+
*
|
|
22
|
+
* The version of the OpenAPI document:
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
26
|
+
* https://openapi-generator.tech
|
|
27
|
+
* Do not edit the class manually.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The ContextItem model module.
|
|
32
|
+
* @module model/ContextItem
|
|
33
|
+
* @version 1.0.0
|
|
34
|
+
*/
|
|
35
|
+
var ContextItem = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>ContextItem</code>.
|
|
38
|
+
* Context item with either text or binary content.
|
|
39
|
+
* @alias module:model/ContextItem
|
|
40
|
+
* @param isValid {Boolean}
|
|
41
|
+
*/
|
|
42
|
+
function ContextItem(isValid) {
|
|
43
|
+
_classCallCheck(this, ContextItem);
|
|
44
|
+
ContextItem.initialize(this, isValid);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Initializes the fields of this object.
|
|
49
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
50
|
+
* Only for internal use.
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(ContextItem, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, isValid) {
|
|
55
|
+
obj['isValid'] = isValid;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>ContextItem</code> from a plain JavaScript object, optionally creating a new instance.
|
|
60
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
61
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
62
|
+
* @param {module:model/ContextItem} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/ContextItem} The populated <code>ContextItem</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new ContextItem();
|
|
70
|
+
if (data.hasOwnProperty('isValid')) {
|
|
71
|
+
obj['isValid'] = _ApiClient["default"].convertToType(data['isValid'], 'Boolean');
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('text')) {
|
|
74
|
+
obj['text'] = _ApiClient["default"].convertToType(data['text'], 'String');
|
|
75
|
+
}
|
|
76
|
+
if (data.hasOwnProperty('binary')) {
|
|
77
|
+
obj['binary'] = _BinaryContent["default"].constructFromObject(data['binary']);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validates the JSON data with respect to <code>ContextItem</code>.
|
|
85
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ContextItem</code>.
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "validateJSON",
|
|
90
|
+
value: function validateJSON(data) {
|
|
91
|
+
// check to make sure all required properties are present in the JSON string
|
|
92
|
+
var _iterator = _createForOfIteratorHelper(ContextItem.RequiredProperties),
|
|
93
|
+
_step;
|
|
94
|
+
try {
|
|
95
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
96
|
+
var property = _step.value;
|
|
97
|
+
if (!data.hasOwnProperty(property)) {
|
|
98
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
if (data['text'] && !(typeof data['text'] === 'string' || data['text'] instanceof String)) {
|
|
108
|
+
throw new Error("Expected the field `text` to be a primitive type in the JSON string but got " + data['text']);
|
|
109
|
+
}
|
|
110
|
+
// validate the optional field `binary`
|
|
111
|
+
if (data['binary']) {
|
|
112
|
+
// data not null
|
|
113
|
+
_BinaryContent["default"].validateJSON(data['binary']);
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}]);
|
|
118
|
+
}();
|
|
119
|
+
ContextItem.RequiredProperties = ["isValid"];
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @member {Boolean} isValid
|
|
123
|
+
*/
|
|
124
|
+
ContextItem.prototype['isValid'] = undefined;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Text content for this context item.
|
|
128
|
+
* @member {String} text
|
|
129
|
+
*/
|
|
130
|
+
ContextItem.prototype['text'] = undefined;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @member {module:model/BinaryContent} binary
|
|
134
|
+
*/
|
|
135
|
+
ContextItem.prototype['binary'] = undefined;
|
|
136
|
+
var _default = exports["default"] = ContextItem;
|