@pairsystems/goodmem-client 1.0.9 → 1.0.11

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 (87) hide show
  1. package/README.md +29 -5
  2. package/dist/api/EmbeddersApi.js +27 -12
  3. package/dist/api/LLMsApi.js +25 -10
  4. package/dist/api/MemoriesApi.js +197 -69
  5. package/dist/api/RerankersApi.js +25 -10
  6. package/dist/api/SpacesApi.js +31 -16
  7. package/dist/index.js +157 -3
  8. package/dist/model/ActiveLicenseMetadata.js +5 -1
  9. package/dist/model/AdminDrainRequest.js +3 -0
  10. package/dist/model/AdminDrainResponse.js +33 -2
  11. package/dist/model/AdminPurgeJobsRequest.js +4 -0
  12. package/dist/model/AdminPurgeJobsResponse.js +8 -4
  13. package/dist/model/AdminReloadLicenseResponse.js +4 -1
  14. package/dist/model/ApiKeyAuth.js +7 -3
  15. package/dist/model/ApiKeyResponse.js +67 -5
  16. package/dist/model/BackgroundJobSummary.js +35 -2
  17. package/dist/model/BatchDeleteMemorySelectorRequest.js +106 -0
  18. package/dist/model/BatchMemoryDeletionRequest.js +33 -15
  19. package/dist/model/BatchMemoryResult.js +4 -2
  20. package/dist/model/ChunkReference.js +3 -2
  21. package/dist/model/ChunkingConfiguration.js +109 -47
  22. package/dist/model/ChunkingConfigurationOneOf.js +109 -0
  23. package/dist/model/ChunkingConfigurationOneOf1.js +109 -0
  24. package/dist/model/ChunkingConfigurationOneOf2.js +109 -0
  25. package/dist/model/ContextItem.js +91 -73
  26. package/dist/model/ContextItemOneOf.js +109 -0
  27. package/dist/model/ContextItemOneOf1.js +109 -0
  28. package/dist/model/CreateApiKeyResponse.js +2 -1
  29. package/dist/model/CreateLLMResponse.js +3 -2
  30. package/dist/model/EmbedderCreationRequest.js +8 -5
  31. package/dist/model/EmbedderResponse.js +16 -11
  32. package/dist/model/EndpointAuthentication.js +7 -4
  33. package/dist/model/FilteredDeleteMemorySelectorRequest.js +140 -0
  34. package/dist/model/HnswIterativeScan.js +68 -0
  35. package/dist/model/HnswOptions.js +115 -0
  36. package/dist/model/JsonBatchMemoryCreationRequest.js +132 -0
  37. package/dist/model/JsonMemoryCreationContentRequirement.js +151 -0
  38. package/dist/model/JsonMemoryCreationContentRequirementOneOf.js +109 -0
  39. package/dist/model/JsonMemoryCreationContentRequirementOneOf1.js +109 -0
  40. package/dist/model/JsonMemoryCreationRequest.js +289 -0
  41. package/dist/model/LLMCreationRequest.js +12 -6
  42. package/dist/model/LLMResponse.js +18 -12
  43. package/dist/model/LLMUpdateRequest.js +6 -3
  44. package/dist/model/LLMUpdateRequestNot.js +118 -0
  45. package/dist/model/ListApiKeysResponse.js +29 -9
  46. package/dist/model/ListMemoryPageImagesResponse.js +145 -0
  47. package/dist/model/ListSpacesResponse.js +29 -9
  48. package/dist/model/Memory.js +106 -10
  49. package/dist/model/MemoryChunkResponse.js +39 -2
  50. package/dist/model/MemoryCreationRequest.js +15 -3
  51. package/dist/model/MemoryPageImage.js +225 -0
  52. package/dist/model/OcrCell.js +5 -3
  53. package/dist/model/OcrDocumentRequest.js +2 -1
  54. package/dist/model/OcrDocumentResponse.js +6 -4
  55. package/dist/model/OcrPage.js +9 -6
  56. package/dist/model/OcrPageResult.js +4 -2
  57. package/dist/model/PingEndpointInfo.js +3 -2
  58. package/dist/model/PingEvent.js +108 -50
  59. package/dist/model/PingEventOneOf.js +109 -0
  60. package/dist/model/PingEventOneOf1.js +109 -0
  61. package/dist/model/PingEventOneOf2.js +109 -0
  62. package/dist/model/PingOnceRequest.js +4 -2
  63. package/dist/model/PingResult.js +6 -4
  64. package/dist/model/PingStreamRequest.js +7 -3
  65. package/dist/model/PingSummary.js +3 -2
  66. package/dist/model/ProcessingHistory.js +2 -1
  67. package/dist/model/RecursiveChunkingConfiguration.js +6 -4
  68. package/dist/model/RerankerCreationRequest.js +5 -3
  69. package/dist/model/RerankerResponse.js +13 -9
  70. package/dist/model/ResultSetBoundary.js +20 -2
  71. package/dist/model/RetrieveMemoryEvent.js +10 -5
  72. package/dist/model/RetrieveMemoryRequest.js +25 -5
  73. package/dist/model/RetrievedItem.js +91 -42
  74. package/dist/model/RetrievedItemOneOf.js +109 -0
  75. package/dist/model/RetrievedItemOneOf1.js +109 -0
  76. package/dist/model/SecretReference.js +27 -4
  77. package/dist/model/SentenceChunkingConfiguration.js +3 -2
  78. package/dist/model/SortOrder.js +63 -0
  79. package/dist/model/Space.js +8 -5
  80. package/dist/model/SpaceCreationRequest.js +13 -8
  81. package/dist/model/SpaceEmbedderConfig.js +3 -1
  82. package/dist/model/SystemInfoResponse.js +13 -4
  83. package/dist/model/UpdateApiKeyRequest.js +19 -9
  84. package/dist/model/UpdateEmbedderRequest.js +2 -9
  85. package/dist/model/UpdateRerankerRequest.js +2 -9
  86. package/dist/model/UpdateSpaceRequest.js +0 -22
  87. package/package.json +1 -1
@@ -41,15 +41,17 @@ var Memory = /*#__PURE__*/function () {
41
41
  * @param memoryId {String} Unique identifier of the memory
42
42
  * @param spaceId {String} ID of the space containing this memory
43
43
  * @param contentType {String} MIME type of the content
44
- * @param processingStatus {String} Processing status of the memory
44
+ * @param processingStatus {module:model/Memory.ProcessingStatusEnum} Processing status of the memory
45
+ * @param pageImageStatus {module:model/Memory.PageImageStatusEnum} Processing status of page-image extraction for this memory
46
+ * @param pageImageCount {Number} Number of extracted page-image renditions linked to this memory
45
47
  * @param createdAt {Number} Timestamp when the memory was created (milliseconds since epoch)
46
48
  * @param updatedAt {Number} Timestamp when the memory was last updated (milliseconds since epoch)
47
49
  * @param createdById {String} ID of the user who created this memory
48
50
  * @param updatedById {String} ID of the user who last updated this memory
49
51
  */
50
- function Memory(memoryId, spaceId, contentType, processingStatus, createdAt, updatedAt, createdById, updatedById) {
52
+ function Memory(memoryId, spaceId, contentType, processingStatus, pageImageStatus, pageImageCount, createdAt, updatedAt, createdById, updatedById) {
51
53
  _classCallCheck(this, Memory);
52
- Memory.initialize(this, memoryId, spaceId, contentType, processingStatus, createdAt, updatedAt, createdById, updatedById);
54
+ Memory.initialize(this, memoryId, spaceId, contentType, processingStatus, pageImageStatus, pageImageCount, createdAt, updatedAt, createdById, updatedById);
53
55
  }
54
56
 
55
57
  /**
@@ -59,11 +61,13 @@ var Memory = /*#__PURE__*/function () {
59
61
  */
60
62
  return _createClass(Memory, null, [{
61
63
  key: "initialize",
62
- value: function initialize(obj, memoryId, spaceId, contentType, processingStatus, createdAt, updatedAt, createdById, updatedById) {
64
+ value: function initialize(obj, memoryId, spaceId, contentType, processingStatus, pageImageStatus, pageImageCount, createdAt, updatedAt, createdById, updatedById) {
63
65
  obj['memoryId'] = memoryId;
64
66
  obj['spaceId'] = spaceId;
65
67
  obj['contentType'] = contentType;
66
68
  obj['processingStatus'] = processingStatus;
69
+ obj['pageImageStatus'] = pageImageStatus;
70
+ obj['pageImageCount'] = pageImageCount;
67
71
  obj['createdAt'] = createdAt;
68
72
  obj['updatedAt'] = updatedAt;
69
73
  obj['createdById'] = createdById;
@@ -106,8 +110,16 @@ var Memory = /*#__PURE__*/function () {
106
110
  if (data.hasOwnProperty('processingStatus')) {
107
111
  obj['processingStatus'] = _ApiClient["default"].convertToType(data['processingStatus'], 'String');
108
112
  }
113
+ if (data.hasOwnProperty('pageImageStatus')) {
114
+ obj['pageImageStatus'] = _ApiClient["default"].convertToType(data['pageImageStatus'], 'String');
115
+ }
116
+ if (data.hasOwnProperty('pageImageCount')) {
117
+ obj['pageImageCount'] = _ApiClient["default"].convertToType(data['pageImageCount'], 'Number');
118
+ }
109
119
  if (data.hasOwnProperty('metadata')) {
110
- obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
120
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], {
121
+ 'String': Object
122
+ });
111
123
  }
112
124
  if (data.hasOwnProperty('createdAt')) {
113
125
  obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
@@ -122,10 +134,10 @@ var Memory = /*#__PURE__*/function () {
122
134
  obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
123
135
  }
124
136
  if (data.hasOwnProperty('chunkingConfig')) {
125
- obj['chunkingConfig'] = _ChunkingConfiguration["default"].constructFromObject(data['chunkingConfig']);
137
+ obj['chunkingConfig'] = _ApiClient["default"].convertToType(data['chunkingConfig'], _ChunkingConfiguration["default"]);
126
138
  }
127
139
  if (data.hasOwnProperty('processingHistory')) {
128
- obj['processingHistory'] = _ProcessingHistory["default"].constructFromObject(data['processingHistory']);
140
+ obj['processingHistory'] = _ApiClient["default"].convertToType(data['processingHistory'], _ProcessingHistory["default"]);
129
141
  }
130
142
  }
131
143
  return obj;
@@ -179,6 +191,10 @@ var Memory = /*#__PURE__*/function () {
179
191
  throw new Error("Expected the field `processingStatus` to be a primitive type in the JSON string but got " + data['processingStatus']);
180
192
  }
181
193
  // ensure the json data is a string
194
+ if (data['pageImageStatus'] && !(typeof data['pageImageStatus'] === 'string' || data['pageImageStatus'] instanceof String)) {
195
+ throw new Error("Expected the field `pageImageStatus` to be a primitive type in the JSON string but got " + data['pageImageStatus']);
196
+ }
197
+ // ensure the json data is a string
182
198
  if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
183
199
  throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
184
200
  }
@@ -200,7 +216,7 @@ var Memory = /*#__PURE__*/function () {
200
216
  }
201
217
  }]);
202
218
  }();
203
- Memory.RequiredProperties = ["memoryId", "spaceId", "contentType", "processingStatus", "createdAt", "updatedAt", "createdById", "updatedById"];
219
+ Memory.RequiredProperties = ["memoryId", "spaceId", "contentType", "processingStatus", "pageImageStatus", "pageImageCount", "createdAt", "updatedAt", "createdById", "updatedById"];
204
220
 
205
221
  /**
206
222
  * Unique identifier of the memory
@@ -246,13 +262,25 @@ Memory.prototype['contentType'] = undefined;
246
262
 
247
263
  /**
248
264
  * Processing status of the memory
249
- * @member {String} processingStatus
265
+ * @member {module:model/Memory.ProcessingStatusEnum} processingStatus
250
266
  */
251
267
  Memory.prototype['processingStatus'] = undefined;
252
268
 
269
+ /**
270
+ * Processing status of page-image extraction for this memory
271
+ * @member {module:model/Memory.PageImageStatusEnum} pageImageStatus
272
+ */
273
+ Memory.prototype['pageImageStatus'] = undefined;
274
+
275
+ /**
276
+ * Number of extracted page-image renditions linked to this memory
277
+ * @member {Number} pageImageCount
278
+ */
279
+ Memory.prototype['pageImageCount'] = undefined;
280
+
253
281
  /**
254
282
  * Additional metadata for the memory
255
- * @member {Object} metadata
283
+ * @member {Object.<String, Object>} metadata
256
284
  */
257
285
  Memory.prototype['metadata'] = undefined;
258
286
 
@@ -281,12 +309,80 @@ Memory.prototype['createdById'] = undefined;
281
309
  Memory.prototype['updatedById'] = undefined;
282
310
 
283
311
  /**
312
+ * Chunking strategy used for this memory
284
313
  * @member {module:model/ChunkingConfiguration} chunkingConfig
285
314
  */
286
315
  Memory.prototype['chunkingConfig'] = undefined;
287
316
 
288
317
  /**
318
+ * Background job processing history associated with this memory
289
319
  * @member {module:model/ProcessingHistory} processingHistory
290
320
  */
291
321
  Memory.prototype['processingHistory'] = undefined;
322
+
323
+ /**
324
+ * Allowed values for the <code>processingStatus</code> property.
325
+ * @enum {String}
326
+ * @readonly
327
+ */
328
+ Memory['ProcessingStatusEnum'] = {
329
+ /**
330
+ * value: "UNSPECIFIED"
331
+ * @const
332
+ */
333
+ "UNSPECIFIED": "UNSPECIFIED",
334
+ /**
335
+ * value: "PENDING"
336
+ * @const
337
+ */
338
+ "PENDING": "PENDING",
339
+ /**
340
+ * value: "PROCESSING"
341
+ * @const
342
+ */
343
+ "PROCESSING": "PROCESSING",
344
+ /**
345
+ * value: "COMPLETED"
346
+ * @const
347
+ */
348
+ "COMPLETED": "COMPLETED",
349
+ /**
350
+ * value: "FAILED"
351
+ * @const
352
+ */
353
+ "FAILED": "FAILED"
354
+ };
355
+
356
+ /**
357
+ * Allowed values for the <code>pageImageStatus</code> property.
358
+ * @enum {String}
359
+ * @readonly
360
+ */
361
+ Memory['PageImageStatusEnum'] = {
362
+ /**
363
+ * value: "UNSPECIFIED"
364
+ * @const
365
+ */
366
+ "UNSPECIFIED": "UNSPECIFIED",
367
+ /**
368
+ * value: "PENDING"
369
+ * @const
370
+ */
371
+ "PENDING": "PENDING",
372
+ /**
373
+ * value: "PROCESSING"
374
+ * @const
375
+ */
376
+ "PROCESSING": "PROCESSING",
377
+ /**
378
+ * value: "COMPLETED"
379
+ * @const
380
+ */
381
+ "COMPLETED": "COMPLETED",
382
+ /**
383
+ * value: "FAILED"
384
+ * @const
385
+ */
386
+ "FAILED": "FAILED"
387
+ };
292
388
  var _default = exports["default"] = Memory;
@@ -40,7 +40,7 @@ var MemoryChunkResponse = /*#__PURE__*/function () {
40
40
  * @param memoryId {String} ID of the memory this chunk belongs to
41
41
  * @param chunkSequenceNumber {Number} Sequence number of this chunk within the memory
42
42
  * @param chunkText {String} The text content of this chunk
43
- * @param vectorStatus {String} Status of vector processing for this chunk
43
+ * @param vectorStatus {module:model/MemoryChunkResponse.VectorStatusEnum} Status of vector processing for this chunk
44
44
  * @param createdAt {Number} Creation timestamp (milliseconds since epoch)
45
45
  * @param updatedAt {Number} Last update timestamp (milliseconds since epoch)
46
46
  * @param createdById {String} ID of the user who created the chunk
@@ -103,6 +103,9 @@ var MemoryChunkResponse = /*#__PURE__*/function () {
103
103
  if (data.hasOwnProperty('endOffset')) {
104
104
  obj['endOffset'] = _ApiClient["default"].convertToType(data['endOffset'], 'Number');
105
105
  }
106
+ if (data.hasOwnProperty('metadata')) {
107
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
108
+ }
106
109
  if (data.hasOwnProperty('createdAt')) {
107
110
  obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
108
111
  }
@@ -198,7 +201,7 @@ MemoryChunkResponse.prototype['chunkText'] = undefined;
198
201
 
199
202
  /**
200
203
  * Status of vector processing for this chunk
201
- * @member {String} vectorStatus
204
+ * @member {module:model/MemoryChunkResponse.VectorStatusEnum} vectorStatus
202
205
  */
203
206
  MemoryChunkResponse.prototype['vectorStatus'] = undefined;
204
207
 
@@ -214,6 +217,12 @@ MemoryChunkResponse.prototype['startOffset'] = undefined;
214
217
  */
215
218
  MemoryChunkResponse.prototype['endOffset'] = undefined;
216
219
 
220
+ /**
221
+ * Additional metadata for the memory chunk
222
+ * @member {Object} metadata
223
+ */
224
+ MemoryChunkResponse.prototype['metadata'] = undefined;
225
+
217
226
  /**
218
227
  * Creation timestamp (milliseconds since epoch)
219
228
  * @member {Number} createdAt
@@ -237,4 +246,32 @@ MemoryChunkResponse.prototype['createdById'] = undefined;
237
246
  * @member {String} updatedById
238
247
  */
239
248
  MemoryChunkResponse.prototype['updatedById'] = undefined;
249
+
250
+ /**
251
+ * Allowed values for the <code>vectorStatus</code> property.
252
+ * @enum {String}
253
+ * @readonly
254
+ */
255
+ MemoryChunkResponse['VectorStatusEnum'] = {
256
+ /**
257
+ * value: "PENDING"
258
+ * @const
259
+ */
260
+ "PENDING": "PENDING",
261
+ /**
262
+ * value: "PROCESSING"
263
+ * @const
264
+ */
265
+ "PROCESSING": "PROCESSING",
266
+ /**
267
+ * value: "COMPLETED"
268
+ * @const
269
+ */
270
+ "COMPLETED": "COMPLETED",
271
+ /**
272
+ * value: "FAILED"
273
+ * @const
274
+ */
275
+ "FAILED": "FAILED"
276
+ };
240
277
  var _default = exports["default"] = MemoryChunkResponse;
@@ -88,10 +88,15 @@ var MemoryCreationRequest = /*#__PURE__*/function () {
88
88
  obj['contentType'] = _ApiClient["default"].convertToType(data['contentType'], 'String');
89
89
  }
90
90
  if (data.hasOwnProperty('metadata')) {
91
- obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
91
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], {
92
+ 'String': Object
93
+ });
92
94
  }
93
95
  if (data.hasOwnProperty('chunkingConfig')) {
94
- obj['chunkingConfig'] = _ChunkingConfiguration["default"].constructFromObject(data['chunkingConfig']);
96
+ obj['chunkingConfig'] = _ApiClient["default"].convertToType(data['chunkingConfig'], _ChunkingConfiguration["default"]);
97
+ }
98
+ if (data.hasOwnProperty('extractPageImages')) {
99
+ obj['extractPageImages'] = _ApiClient["default"].convertToType(data['extractPageImages'], 'Boolean');
95
100
  }
96
101
  if (data.hasOwnProperty('fileField')) {
97
102
  obj['fileField'] = _ApiClient["default"].convertToType(data['fileField'], 'String');
@@ -200,15 +205,22 @@ MemoryCreationRequest.prototype['contentType'] = undefined;
200
205
 
201
206
  /**
202
207
  * Additional metadata for the memory
203
- * @member {Object} metadata
208
+ * @member {Object.<String, Object>} metadata
204
209
  */
205
210
  MemoryCreationRequest.prototype['metadata'] = undefined;
206
211
 
207
212
  /**
213
+ * Chunking strategy for this memory (if not provided, uses space default)
208
214
  * @member {module:model/ChunkingConfiguration} chunkingConfig
209
215
  */
210
216
  MemoryCreationRequest.prototype['chunkingConfig'] = undefined;
211
217
 
218
+ /**
219
+ * Optional hint to extract page images for eligible document types (for example, PDFs)
220
+ * @member {Boolean} extractPageImages
221
+ */
222
+ MemoryCreationRequest.prototype['extractPageImages'] = undefined;
223
+
212
224
  /**
213
225
  * Optional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request.
214
226
  * @member {String} fileField
@@ -0,0 +1,225 @@
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 MemoryPageImage model module.
31
+ * @module model/MemoryPageImage
32
+ * @version 1.0.0
33
+ */
34
+ var MemoryPageImage = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>MemoryPageImage</code>.
37
+ * Metadata for one memory page-image rendition
38
+ * @alias module:model/MemoryPageImage
39
+ * @param memoryId {String} Memory UUID
40
+ * @param pageIndex {Number} 0-based page index
41
+ * @param dpi {Number} Render DPI
42
+ * @param contentType {String} Image MIME type
43
+ * @param createdAt {Number} Creation timestamp (milliseconds since epoch)
44
+ * @param updatedAt {Number} Last update timestamp (milliseconds since epoch)
45
+ * @param createdById {String} Creator user UUID
46
+ * @param updatedById {String} Last updater user UUID
47
+ */
48
+ function MemoryPageImage(memoryId, pageIndex, dpi, contentType, createdAt, updatedAt, createdById, updatedById) {
49
+ _classCallCheck(this, MemoryPageImage);
50
+ MemoryPageImage.initialize(this, memoryId, pageIndex, dpi, contentType, createdAt, updatedAt, createdById, updatedById);
51
+ }
52
+
53
+ /**
54
+ * Initializes the fields of this object.
55
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
56
+ * Only for internal use.
57
+ */
58
+ return _createClass(MemoryPageImage, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, memoryId, pageIndex, dpi, contentType, createdAt, updatedAt, createdById, updatedById) {
61
+ obj['memoryId'] = memoryId;
62
+ obj['pageIndex'] = pageIndex;
63
+ obj['dpi'] = dpi;
64
+ obj['contentType'] = contentType;
65
+ obj['createdAt'] = createdAt;
66
+ obj['updatedAt'] = updatedAt;
67
+ obj['createdById'] = createdById;
68
+ obj['updatedById'] = updatedById;
69
+ }
70
+
71
+ /**
72
+ * Constructs a <code>MemoryPageImage</code> from a plain JavaScript object, optionally creating a new instance.
73
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
74
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
75
+ * @param {module:model/MemoryPageImage} obj Optional instance to populate.
76
+ * @return {module:model/MemoryPageImage} The populated <code>MemoryPageImage</code> instance.
77
+ */
78
+ }, {
79
+ key: "constructFromObject",
80
+ value: function constructFromObject(data, obj) {
81
+ if (data) {
82
+ obj = obj || new MemoryPageImage();
83
+ if (data.hasOwnProperty('memoryId')) {
84
+ obj['memoryId'] = _ApiClient["default"].convertToType(data['memoryId'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('pageIndex')) {
87
+ obj['pageIndex'] = _ApiClient["default"].convertToType(data['pageIndex'], 'Number');
88
+ }
89
+ if (data.hasOwnProperty('dpi')) {
90
+ obj['dpi'] = _ApiClient["default"].convertToType(data['dpi'], 'Number');
91
+ }
92
+ if (data.hasOwnProperty('contentType')) {
93
+ obj['contentType'] = _ApiClient["default"].convertToType(data['contentType'], 'String');
94
+ }
95
+ if (data.hasOwnProperty('imageContentLength')) {
96
+ obj['imageContentLength'] = _ApiClient["default"].convertToType(data['imageContentLength'], 'Number');
97
+ }
98
+ if (data.hasOwnProperty('imageContentSha256')) {
99
+ obj['imageContentSha256'] = _ApiClient["default"].convertToType(data['imageContentSha256'], 'String');
100
+ }
101
+ if (data.hasOwnProperty('createdAt')) {
102
+ obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
103
+ }
104
+ if (data.hasOwnProperty('updatedAt')) {
105
+ obj['updatedAt'] = _ApiClient["default"].convertToType(data['updatedAt'], 'Number');
106
+ }
107
+ if (data.hasOwnProperty('createdById')) {
108
+ obj['createdById'] = _ApiClient["default"].convertToType(data['createdById'], 'String');
109
+ }
110
+ if (data.hasOwnProperty('updatedById')) {
111
+ obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
112
+ }
113
+ }
114
+ return obj;
115
+ }
116
+
117
+ /**
118
+ * Validates the JSON data with respect to <code>MemoryPageImage</code>.
119
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
120
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>MemoryPageImage</code>.
121
+ */
122
+ }, {
123
+ key: "validateJSON",
124
+ value: function validateJSON(data) {
125
+ // check to make sure all required properties are present in the JSON string
126
+ var _iterator = _createForOfIteratorHelper(MemoryPageImage.RequiredProperties),
127
+ _step;
128
+ try {
129
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
130
+ var property = _step.value;
131
+ if (!data.hasOwnProperty(property)) {
132
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
133
+ }
134
+ }
135
+ // ensure the json data is a string
136
+ } catch (err) {
137
+ _iterator.e(err);
138
+ } finally {
139
+ _iterator.f();
140
+ }
141
+ if (data['memoryId'] && !(typeof data['memoryId'] === 'string' || data['memoryId'] instanceof String)) {
142
+ throw new Error("Expected the field `memoryId` to be a primitive type in the JSON string but got " + data['memoryId']);
143
+ }
144
+ // ensure the json data is a string
145
+ if (data['contentType'] && !(typeof data['contentType'] === 'string' || data['contentType'] instanceof String)) {
146
+ throw new Error("Expected the field `contentType` to be a primitive type in the JSON string but got " + data['contentType']);
147
+ }
148
+ // ensure the json data is a string
149
+ if (data['imageContentSha256'] && !(typeof data['imageContentSha256'] === 'string' || data['imageContentSha256'] instanceof String)) {
150
+ throw new Error("Expected the field `imageContentSha256` to be a primitive type in the JSON string but got " + data['imageContentSha256']);
151
+ }
152
+ // ensure the json data is a string
153
+ if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
154
+ throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
155
+ }
156
+ // ensure the json data is a string
157
+ if (data['updatedById'] && !(typeof data['updatedById'] === 'string' || data['updatedById'] instanceof String)) {
158
+ throw new Error("Expected the field `updatedById` to be a primitive type in the JSON string but got " + data['updatedById']);
159
+ }
160
+ return true;
161
+ }
162
+ }]);
163
+ }();
164
+ MemoryPageImage.RequiredProperties = ["memoryId", "pageIndex", "dpi", "contentType", "createdAt", "updatedAt", "createdById", "updatedById"];
165
+
166
+ /**
167
+ * Memory UUID
168
+ * @member {String} memoryId
169
+ */
170
+ MemoryPageImage.prototype['memoryId'] = undefined;
171
+
172
+ /**
173
+ * 0-based page index
174
+ * @member {Number} pageIndex
175
+ */
176
+ MemoryPageImage.prototype['pageIndex'] = undefined;
177
+
178
+ /**
179
+ * Render DPI
180
+ * @member {Number} dpi
181
+ */
182
+ MemoryPageImage.prototype['dpi'] = undefined;
183
+
184
+ /**
185
+ * Image MIME type
186
+ * @member {String} contentType
187
+ */
188
+ MemoryPageImage.prototype['contentType'] = undefined;
189
+
190
+ /**
191
+ * Image byte length
192
+ * @member {Number} imageContentLength
193
+ */
194
+ MemoryPageImage.prototype['imageContentLength'] = undefined;
195
+
196
+ /**
197
+ * Hex-encoded SHA-256 digest of image content
198
+ * @member {String} imageContentSha256
199
+ */
200
+ MemoryPageImage.prototype['imageContentSha256'] = undefined;
201
+
202
+ /**
203
+ * Creation timestamp (milliseconds since epoch)
204
+ * @member {Number} createdAt
205
+ */
206
+ MemoryPageImage.prototype['createdAt'] = undefined;
207
+
208
+ /**
209
+ * Last update timestamp (milliseconds since epoch)
210
+ * @member {Number} updatedAt
211
+ */
212
+ MemoryPageImage.prototype['updatedAt'] = undefined;
213
+
214
+ /**
215
+ * Creator user UUID
216
+ * @member {String} createdById
217
+ */
218
+ MemoryPageImage.prototype['createdById'] = undefined;
219
+
220
+ /**
221
+ * Last updater user UUID
222
+ * @member {String} updatedById
223
+ */
224
+ MemoryPageImage.prototype['updatedById'] = undefined;
225
+ var _default = exports["default"] = MemoryPageImage;
@@ -39,7 +39,7 @@ var OcrCell = /*#__PURE__*/function () {
39
39
  * Single OCR layout element.
40
40
  * @alias module:model/OcrCell
41
41
  * @param categoryLabel {String} Raw category label emitted by OCR
42
- * @param category {module:model/OcrCategory}
42
+ * @param category {module:model/OcrCategory} Normalized OCR category
43
43
  * @param text {String} OCR text content
44
44
  */
45
45
  function OcrCell(categoryLabel, category, text) {
@@ -73,13 +73,13 @@ var OcrCell = /*#__PURE__*/function () {
73
73
  if (data) {
74
74
  obj = obj || new OcrCell();
75
75
  if (data.hasOwnProperty('bbox')) {
76
- obj['bbox'] = _BoundingBox["default"].constructFromObject(data['bbox']);
76
+ obj['bbox'] = _ApiClient["default"].convertToType(data['bbox'], _BoundingBox["default"]);
77
77
  }
78
78
  if (data.hasOwnProperty('categoryLabel')) {
79
79
  obj['categoryLabel'] = _ApiClient["default"].convertToType(data['categoryLabel'], 'String');
80
80
  }
81
81
  if (data.hasOwnProperty('category')) {
82
- obj['category'] = _OcrCategory["default"].constructFromObject(data['category']);
82
+ obj['category'] = _ApiClient["default"].convertToType(data['category'], _OcrCategory["default"]);
83
83
  }
84
84
  if (data.hasOwnProperty('text')) {
85
85
  obj['text'] = _ApiClient["default"].convertToType(data['text'], 'String');
@@ -131,6 +131,7 @@ var OcrCell = /*#__PURE__*/function () {
131
131
  OcrCell.RequiredProperties = ["categoryLabel", "category", "text"];
132
132
 
133
133
  /**
134
+ * Bounding box in page coordinates
134
135
  * @member {module:model/BoundingBox} bbox
135
136
  */
136
137
  OcrCell.prototype['bbox'] = undefined;
@@ -142,6 +143,7 @@ OcrCell.prototype['bbox'] = undefined;
142
143
  OcrCell.prototype['categoryLabel'] = undefined;
143
144
 
144
145
  /**
146
+ * Normalized OCR category
145
147
  * @member {module:model/OcrCategory} category
146
148
  */
147
149
  OcrCell.prototype['category'] = undefined;
@@ -71,7 +71,7 @@ var OcrDocumentRequest = /*#__PURE__*/function () {
71
71
  obj['content'] = _ApiClient["default"].convertToType(data['content'], 'String');
72
72
  }
73
73
  if (data.hasOwnProperty('format')) {
74
- obj['format'] = _OcrInputFormat["default"].constructFromObject(data['format']);
74
+ obj['format'] = _ApiClient["default"].convertToType(data['format'], _OcrInputFormat["default"]);
75
75
  }
76
76
  if (data.hasOwnProperty('includeRawJson')) {
77
77
  obj['includeRawJson'] = _ApiClient["default"].convertToType(data['includeRawJson'], 'Boolean');
@@ -129,6 +129,7 @@ OcrDocumentRequest.RequiredProperties = ["content"];
129
129
  OcrDocumentRequest.prototype['content'] = undefined;
130
130
 
131
131
  /**
132
+ * Input format hint (AUTO, PDF, TIFF, PNG, JPEG, BMP)
132
133
  * @member {module:model/OcrInputFormat} format
133
134
  */
134
135
  OcrDocumentRequest.prototype['format'] = undefined;
@@ -39,10 +39,10 @@ var OcrDocumentResponse = /*#__PURE__*/function () {
39
39
  * Constructs a new <code>OcrDocumentResponse</code>.
40
40
  * Response containing page-ordered OCR results.
41
41
  * @alias module:model/OcrDocumentResponse
42
- * @param detectedFormat {module:model/OcrInputFormat}
42
+ * @param detectedFormat {module:model/OcrInputFormat} Detected input format
43
43
  * @param pageCount {Number} Number of pages processed after applying the range
44
44
  * @param pages {Array.<module:model/OcrPageResult>} Ordered per-page OCR results
45
- * @param timings {module:model/DocumentTimings}
45
+ * @param timings {module:model/DocumentTimings} Aggregate timing statistics
46
46
  */
47
47
  function OcrDocumentResponse(detectedFormat, pageCount, pages, timings) {
48
48
  _classCallCheck(this, OcrDocumentResponse);
@@ -76,7 +76,7 @@ var OcrDocumentResponse = /*#__PURE__*/function () {
76
76
  if (data) {
77
77
  obj = obj || new OcrDocumentResponse();
78
78
  if (data.hasOwnProperty('detectedFormat')) {
79
- obj['detectedFormat'] = _OcrInputFormat["default"].constructFromObject(data['detectedFormat']);
79
+ obj['detectedFormat'] = _ApiClient["default"].convertToType(data['detectedFormat'], _OcrInputFormat["default"]);
80
80
  }
81
81
  if (data.hasOwnProperty('pageCount')) {
82
82
  obj['pageCount'] = _ApiClient["default"].convertToType(data['pageCount'], 'Number');
@@ -85,7 +85,7 @@ var OcrDocumentResponse = /*#__PURE__*/function () {
85
85
  obj['pages'] = _ApiClient["default"].convertToType(data['pages'], [_OcrPageResult["default"]]);
86
86
  }
87
87
  if (data.hasOwnProperty('timings')) {
88
- obj['timings'] = _DocumentTimings["default"].constructFromObject(data['timings']);
88
+ obj['timings'] = _ApiClient["default"].convertToType(data['timings'], _DocumentTimings["default"]);
89
89
  }
90
90
  }
91
91
  return obj;
@@ -147,6 +147,7 @@ var OcrDocumentResponse = /*#__PURE__*/function () {
147
147
  OcrDocumentResponse.RequiredProperties = ["detectedFormat", "pageCount", "pages", "timings"];
148
148
 
149
149
  /**
150
+ * Detected input format
150
151
  * @member {module:model/OcrInputFormat} detectedFormat
151
152
  */
152
153
  OcrDocumentResponse.prototype['detectedFormat'] = undefined;
@@ -164,6 +165,7 @@ OcrDocumentResponse.prototype['pageCount'] = undefined;
164
165
  OcrDocumentResponse.prototype['pages'] = undefined;
165
166
 
166
167
  /**
168
+ * Aggregate timing statistics
167
169
  * @member {module:model/DocumentTimings} timings
168
170
  */
169
171
  OcrDocumentResponse.prototype['timings'] = undefined;