@pairsystems/goodmem-client 1.0.4 → 1.0.6

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.
Files changed (41) hide show
  1. package/README.md +28 -12
  2. package/dist/api/AdministrationApi.js +158 -0
  3. package/dist/api/EmbeddersApi.js +6 -6
  4. package/dist/api/LLMsApi.js +2 -2
  5. package/dist/api/MemoriesApi.js +77 -18
  6. package/dist/api/RerankersApi.js +4 -4
  7. package/dist/api/SystemApi.js +39 -5
  8. package/dist/index.js +133 -0
  9. package/dist/model/ActiveLicenseMetadata.js +140 -0
  10. package/dist/model/AdminDrainRequest.js +105 -0
  11. package/dist/model/AdminDrainResponse.js +132 -0
  12. package/dist/model/AdminPurgeJobsRequest.js +117 -0
  13. package/dist/model/AdminPurgeJobsResponse.js +138 -0
  14. package/dist/model/AdminReloadLicenseResponse.js +115 -0
  15. package/dist/model/ApiKeyAuth.js +131 -0
  16. package/dist/model/BackgroundJobAttempt.js +242 -0
  17. package/dist/model/BackgroundJobSummary.js +215 -0
  18. package/dist/model/BatchMemoryResponse.js +132 -0
  19. package/dist/model/BatchMemoryResult.js +151 -0
  20. package/dist/model/BatchMemoryRetrievalRequest.js +9 -0
  21. package/dist/model/CreateApiKeyRequest.js +13 -0
  22. package/dist/model/CredentialKind.js +63 -0
  23. package/dist/model/EmbedderCreationRequest.js +25 -13
  24. package/dist/model/EndpointAuthentication.js +149 -0
  25. package/dist/model/ErrorDetail.js +125 -0
  26. package/dist/model/GcpAdcAuth.js +104 -0
  27. package/dist/model/LLMCreationRequest.js +24 -14
  28. package/dist/model/LLMUpdateRequest.js +7 -6
  29. package/dist/model/Memory.js +36 -0
  30. package/dist/model/MemoryCreationRequest.js +13 -0
  31. package/dist/model/PostProcessor.js +4 -4
  32. package/dist/model/ProcessingHistory.js +126 -0
  33. package/dist/model/ProviderType.js +15 -0
  34. package/dist/model/RerankerCreationRequest.js +20 -6
  35. package/dist/model/SecretReference.js +101 -0
  36. package/dist/model/SpaceCreationRequest.js +13 -0
  37. package/dist/model/SpaceKey.js +13 -0
  38. package/dist/model/SystemInfoResponse.js +192 -0
  39. package/dist/model/UpdateEmbedderRequest.js +7 -6
  40. package/dist/model/UpdateRerankerRequest.js +7 -6
  41. package/package.json +2 -1
@@ -0,0 +1,101 @@
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ 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); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
17
+ *
18
+ * The version of the OpenAPI document:
19
+ *
20
+ *
21
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22
+ * https://openapi-generator.tech
23
+ * Do not edit the class manually.
24
+ *
25
+ */
26
+ /**
27
+ * The SecretReference model module.
28
+ * @module model/SecretReference
29
+ * @version 1.0.0
30
+ */
31
+ var SecretReference = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>SecretReference</code>.
34
+ * @alias module:model/SecretReference
35
+ */
36
+ function SecretReference() {
37
+ _classCallCheck(this, SecretReference);
38
+ SecretReference.initialize(this);
39
+ }
40
+
41
+ /**
42
+ * Initializes the fields of this object.
43
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
+ * Only for internal use.
45
+ */
46
+ return _createClass(SecretReference, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>SecretReference</code> from a plain JavaScript object, optionally creating a new instance.
52
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
54
+ * @param {module:model/SecretReference} obj Optional instance to populate.
55
+ * @return {module:model/SecretReference} The populated <code>SecretReference</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new SecretReference();
62
+ if (data.hasOwnProperty('uri')) {
63
+ obj['uri'] = _ApiClient["default"].convertToType(data['uri'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('hints')) {
66
+ obj['hints'] = _ApiClient["default"].convertToType(data['hints'], {
67
+ 'String': 'String'
68
+ });
69
+ }
70
+ }
71
+ return obj;
72
+ }
73
+
74
+ /**
75
+ * Validates the JSON data with respect to <code>SecretReference</code>.
76
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
77
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SecretReference</code>.
78
+ */
79
+ }, {
80
+ key: "validateJSON",
81
+ value: function validateJSON(data) {
82
+ // ensure the json data is a string
83
+ if (data['uri'] && !(typeof data['uri'] === 'string' || data['uri'] instanceof String)) {
84
+ throw new Error("Expected the field `uri` to be a primitive type in the JSON string but got " + data['uri']);
85
+ }
86
+ return true;
87
+ }
88
+ }]);
89
+ }();
90
+ /**
91
+ * URI identifying where the secret can be resolved (e.g., vault://, env://)
92
+ * @member {String} uri
93
+ */
94
+ SecretReference.prototype['uri'] = undefined;
95
+
96
+ /**
97
+ * Optional metadata to help resolvers decode the secret (e.g., {\"encoding\":\"base64\"})
98
+ * @member {Object.<String, String>} hints
99
+ */
100
+ SecretReference.prototype['hints'] = undefined;
101
+ var _default = exports["default"] = SecretReference;
@@ -88,6 +88,9 @@ var SpaceCreationRequest = /*#__PURE__*/function () {
88
88
  if (data.hasOwnProperty('defaultChunkingConfig')) {
89
89
  obj['defaultChunkingConfig'] = _ChunkingConfiguration["default"].constructFromObject(data['defaultChunkingConfig']);
90
90
  }
91
+ if (data.hasOwnProperty('spaceId')) {
92
+ obj['spaceId'] = _ApiClient["default"].convertToType(data['spaceId'], 'String');
93
+ }
91
94
  }
92
95
  return obj;
93
96
  }
@@ -149,6 +152,10 @@ var SpaceCreationRequest = /*#__PURE__*/function () {
149
152
  // data not null
150
153
  _ChunkingConfiguration["default"].validateJSON(data['defaultChunkingConfig']);
151
154
  }
155
+ // ensure the json data is a string
156
+ if (data['spaceId'] && !(typeof data['spaceId'] === 'string' || data['spaceId'] instanceof String)) {
157
+ throw new Error("Expected the field `spaceId` to be a primitive type in the JSON string but got " + data['spaceId']);
158
+ }
152
159
  return true;
153
160
  }
154
161
  }]);
@@ -189,4 +196,10 @@ SpaceCreationRequest.prototype['ownerId'] = undefined;
189
196
  * @member {module:model/ChunkingConfiguration} defaultChunkingConfig
190
197
  */
191
198
  SpaceCreationRequest.prototype['defaultChunkingConfig'] = undefined;
199
+
200
+ /**
201
+ * Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use.
202
+ * @member {String} spaceId
203
+ */
204
+ SpaceCreationRequest.prototype['spaceId'] = undefined;
192
205
  var _default = exports["default"] = SpaceCreationRequest;
@@ -73,6 +73,9 @@ var SpaceKey = /*#__PURE__*/function () {
73
73
  if (data.hasOwnProperty('embedderWeights')) {
74
74
  obj['embedderWeights'] = _ApiClient["default"].convertToType(data['embedderWeights'], [_EmbedderWeight["default"]]);
75
75
  }
76
+ if (data.hasOwnProperty('filter')) {
77
+ obj['filter'] = _ApiClient["default"].convertToType(data['filter'], 'String');
78
+ }
76
79
  }
77
80
  return obj;
78
81
  }
@@ -125,6 +128,10 @@ var SpaceKey = /*#__PURE__*/function () {
125
128
  }
126
129
  ;
127
130
  }
131
+ // ensure the json data is a string
132
+ if (data['filter'] && !(typeof data['filter'] === 'string' || data['filter'] instanceof String)) {
133
+ throw new Error("Expected the field `filter` to be a primitive type in the JSON string but got " + data['filter']);
134
+ }
128
135
  return true;
129
136
  }
130
137
  }]);
@@ -142,4 +149,10 @@ SpaceKey.prototype['spaceId'] = undefined;
142
149
  * @member {Array.<module:model/EmbedderWeight>} embedderWeights
143
150
  */
144
151
  SpaceKey.prototype['embedderWeights'] = undefined;
152
+
153
+ /**
154
+ * Optional filter expression that must evaluate to true for memories in this space.
155
+ * @member {String} filter
156
+ */
157
+ SpaceKey.prototype['filter'] = undefined;
145
158
  var _default = exports["default"] = SpaceKey;
@@ -0,0 +1,192 @@
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 SystemInfoResponse model module.
31
+ * @module model/SystemInfoResponse
32
+ * @version 1.0.0
33
+ */
34
+ var SystemInfoResponse = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>SystemInfoResponse</code>.
37
+ * @alias module:model/SystemInfoResponse
38
+ * @param major {Number}
39
+ * @param minor {Number}
40
+ * @param patch {Number}
41
+ * @param dirty {Boolean}
42
+ */
43
+ function SystemInfoResponse(major, minor, patch, dirty) {
44
+ _classCallCheck(this, SystemInfoResponse);
45
+ SystemInfoResponse.initialize(this, major, minor, patch, dirty);
46
+ }
47
+
48
+ /**
49
+ * Initializes the fields of this object.
50
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
51
+ * Only for internal use.
52
+ */
53
+ return _createClass(SystemInfoResponse, null, [{
54
+ key: "initialize",
55
+ value: function initialize(obj, major, minor, patch, dirty) {
56
+ obj['major'] = major;
57
+ obj['minor'] = minor;
58
+ obj['patch'] = patch;
59
+ obj['dirty'] = dirty;
60
+ }
61
+
62
+ /**
63
+ * Constructs a <code>SystemInfoResponse</code> from a plain JavaScript object, optionally creating a new instance.
64
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
65
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
66
+ * @param {module:model/SystemInfoResponse} obj Optional instance to populate.
67
+ * @return {module:model/SystemInfoResponse} The populated <code>SystemInfoResponse</code> instance.
68
+ */
69
+ }, {
70
+ key: "constructFromObject",
71
+ value: function constructFromObject(data, obj) {
72
+ if (data) {
73
+ obj = obj || new SystemInfoResponse();
74
+ if (data.hasOwnProperty('version')) {
75
+ obj['version'] = _ApiClient["default"].convertToType(data['version'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('major')) {
78
+ obj['major'] = _ApiClient["default"].convertToType(data['major'], 'Number');
79
+ }
80
+ if (data.hasOwnProperty('minor')) {
81
+ obj['minor'] = _ApiClient["default"].convertToType(data['minor'], 'Number');
82
+ }
83
+ if (data.hasOwnProperty('patch')) {
84
+ obj['patch'] = _ApiClient["default"].convertToType(data['patch'], 'Number');
85
+ }
86
+ if (data.hasOwnProperty('dirty')) {
87
+ obj['dirty'] = _ApiClient["default"].convertToType(data['dirty'], 'Boolean');
88
+ }
89
+ if (data.hasOwnProperty('gitCommit')) {
90
+ obj['gitCommit'] = _ApiClient["default"].convertToType(data['gitCommit'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('gitDescribe')) {
93
+ obj['gitDescribe'] = _ApiClient["default"].convertToType(data['gitDescribe'], 'String');
94
+ }
95
+ if (data.hasOwnProperty('buildTime')) {
96
+ obj['buildTime'] = _ApiClient["default"].convertToType(data['buildTime'], 'Date');
97
+ }
98
+ if (data.hasOwnProperty('capabilities')) {
99
+ obj['capabilities'] = _ApiClient["default"].convertToType(data['capabilities'], {
100
+ 'String': 'String'
101
+ });
102
+ }
103
+ }
104
+ return obj;
105
+ }
106
+
107
+ /**
108
+ * Validates the JSON data with respect to <code>SystemInfoResponse</code>.
109
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
110
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SystemInfoResponse</code>.
111
+ */
112
+ }, {
113
+ key: "validateJSON",
114
+ value: function validateJSON(data) {
115
+ // check to make sure all required properties are present in the JSON string
116
+ var _iterator = _createForOfIteratorHelper(SystemInfoResponse.RequiredProperties),
117
+ _step;
118
+ try {
119
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
120
+ var property = _step.value;
121
+ if (!data.hasOwnProperty(property)) {
122
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
123
+ }
124
+ }
125
+ // ensure the json data is a string
126
+ } catch (err) {
127
+ _iterator.e(err);
128
+ } finally {
129
+ _iterator.f();
130
+ }
131
+ if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
132
+ throw new Error("Expected the field `version` to be a primitive type in the JSON string but got " + data['version']);
133
+ }
134
+ // ensure the json data is a string
135
+ if (data['gitCommit'] && !(typeof data['gitCommit'] === 'string' || data['gitCommit'] instanceof String)) {
136
+ throw new Error("Expected the field `gitCommit` to be a primitive type in the JSON string but got " + data['gitCommit']);
137
+ }
138
+ // ensure the json data is a string
139
+ if (data['gitDescribe'] && !(typeof data['gitDescribe'] === 'string' || data['gitDescribe'] instanceof String)) {
140
+ throw new Error("Expected the field `gitDescribe` to be a primitive type in the JSON string but got " + data['gitDescribe']);
141
+ }
142
+ return true;
143
+ }
144
+ }]);
145
+ }();
146
+ SystemInfoResponse.RequiredProperties = ["major", "minor", "patch", "dirty"];
147
+
148
+ /**
149
+ * @member {String} version
150
+ */
151
+ SystemInfoResponse.prototype['version'] = undefined;
152
+
153
+ /**
154
+ * @member {Number} major
155
+ */
156
+ SystemInfoResponse.prototype['major'] = undefined;
157
+
158
+ /**
159
+ * @member {Number} minor
160
+ */
161
+ SystemInfoResponse.prototype['minor'] = undefined;
162
+
163
+ /**
164
+ * @member {Number} patch
165
+ */
166
+ SystemInfoResponse.prototype['patch'] = undefined;
167
+
168
+ /**
169
+ * @member {Boolean} dirty
170
+ */
171
+ SystemInfoResponse.prototype['dirty'] = undefined;
172
+
173
+ /**
174
+ * @member {String} gitCommit
175
+ */
176
+ SystemInfoResponse.prototype['gitCommit'] = undefined;
177
+
178
+ /**
179
+ * @member {String} gitDescribe
180
+ */
181
+ SystemInfoResponse.prototype['gitDescribe'] = undefined;
182
+
183
+ /**
184
+ * @member {Date} buildTime
185
+ */
186
+ SystemInfoResponse.prototype['buildTime'] = undefined;
187
+
188
+ /**
189
+ * @member {Object.<String, String>} capabilities
190
+ */
191
+ SystemInfoResponse.prototype['capabilities'] = undefined;
192
+ var _default = exports["default"] = SystemInfoResponse;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _EndpointAuthentication = _interopRequireDefault(require("./EndpointAuthentication"));
8
9
  var _Modality = _interopRequireDefault(require("./Modality"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
@@ -89,7 +90,7 @@ var UpdateEmbedderRequest = /*#__PURE__*/function () {
89
90
  obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
90
91
  }
91
92
  if (data.hasOwnProperty('credentials')) {
92
- obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], 'String');
93
+ obj['credentials'] = _EndpointAuthentication["default"].constructFromObject(data['credentials']);
93
94
  }
94
95
  if (data.hasOwnProperty('replaceLabels')) {
95
96
  obj['replaceLabels'] = _ApiClient["default"].convertToType(data['replaceLabels'], {
@@ -143,9 +144,10 @@ var UpdateEmbedderRequest = /*#__PURE__*/function () {
143
144
  if (!Array.isArray(data['supportedModalities'])) {
144
145
  throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
145
146
  }
146
- // ensure the json data is a string
147
- if (data['credentials'] && !(typeof data['credentials'] === 'string' || data['credentials'] instanceof String)) {
148
- throw new Error("Expected the field `credentials` to be a primitive type in the JSON string but got " + data['credentials']);
147
+ // validate the optional field `credentials`
148
+ if (data['credentials']) {
149
+ // data not null
150
+ _EndpointAuthentication["default"].validateJSON(data['credentials']);
149
151
  }
150
152
  // ensure the json data is a string
151
153
  if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
@@ -213,8 +215,7 @@ UpdateEmbedderRequest.prototype['maxSequenceLength'] = undefined;
213
215
  UpdateEmbedderRequest.prototype['supportedModalities'] = undefined;
214
216
 
215
217
  /**
216
- * API credentials
217
- * @member {String} credentials
218
+ * @member {module:model/EndpointAuthentication} credentials
218
219
  */
219
220
  UpdateEmbedderRequest.prototype['credentials'] = undefined;
220
221
 
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _EndpointAuthentication = _interopRequireDefault(require("./EndpointAuthentication"));
8
9
  var _Modality = _interopRequireDefault(require("./Modality"));
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
@@ -83,7 +84,7 @@ var UpdateRerankerRequest = /*#__PURE__*/function () {
83
84
  obj['supportedModalities'] = _ApiClient["default"].convertToType(data['supportedModalities'], [_Modality["default"]]);
84
85
  }
85
86
  if (data.hasOwnProperty('credentials')) {
86
- obj['credentials'] = _ApiClient["default"].convertToType(data['credentials'], 'String');
87
+ obj['credentials'] = _EndpointAuthentication["default"].constructFromObject(data['credentials']);
87
88
  }
88
89
  if (data.hasOwnProperty('replaceLabels')) {
89
90
  obj['replaceLabels'] = _ApiClient["default"].convertToType(data['replaceLabels'], {
@@ -137,9 +138,10 @@ var UpdateRerankerRequest = /*#__PURE__*/function () {
137
138
  if (!Array.isArray(data['supportedModalities'])) {
138
139
  throw new Error("Expected the field `supportedModalities` to be an array in the JSON data but got " + data['supportedModalities']);
139
140
  }
140
- // ensure the json data is a string
141
- if (data['credentials'] && !(typeof data['credentials'] === 'string' || data['credentials'] instanceof String)) {
142
- throw new Error("Expected the field `credentials` to be a primitive type in the JSON string but got " + data['credentials']);
141
+ // validate the optional field `credentials`
142
+ if (data['credentials']) {
143
+ // data not null
144
+ _EndpointAuthentication["default"].validateJSON(data['credentials']);
143
145
  }
144
146
  // ensure the json data is a string
145
147
  if (data['version'] && !(typeof data['version'] === 'string' || data['version'] instanceof String)) {
@@ -195,8 +197,7 @@ UpdateRerankerRequest.prototype['modelIdentifier'] = undefined;
195
197
  UpdateRerankerRequest.prototype['supportedModalities'] = undefined;
196
198
 
197
199
  /**
198
- * API credentials
199
- * @member {String} credentials
200
+ * @member {module:model/EndpointAuthentication} credentials
200
201
  */
201
202
  UpdateRerankerRequest.prototype['credentials'] = undefined;
202
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pairsystems/goodmem-client",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "JavaScript client for GoodMem API",
5
5
  "license": "Unlicense",
6
6
  "main": "dist/index.js",
@@ -36,6 +36,7 @@
36
36
  "@babel/plugin-syntax-import-meta": "^7.0.0",
37
37
  "@babel/preset-env": "^7.0.0",
38
38
  "@babel/register": "^7.0.0",
39
+ "chai": "^4.3.0",
39
40
  "expect.js": "^0.3.1",
40
41
  "mocha": "^8.0.1",
41
42
  "sinon": "^7.2.0"