@pairsystems/goodmem-client 1.0.6 → 1.0.7
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 +28 -2
- package/dist/api/EmbeddersApi.js +8 -8
- package/dist/api/LLMsApi.js +8 -8
- package/dist/api/MemoriesApi.js +36 -34
- package/dist/api/OCRApi.js +85 -0
- package/dist/api/PingApi.js +133 -0
- package/dist/api/RerankersApi.js +8 -8
- package/dist/api/SpacesApi.js +14 -14
- package/dist/index.js +175 -0
- package/dist/model/BatchMemoryCreationRequest.js +0 -8
- package/dist/model/BatchMemoryDeletionRequest.js +0 -8
- package/dist/model/BatchMemoryRetrievalRequest.js +0 -8
- package/dist/model/BoundingBox.js +143 -0
- package/dist/model/DocumentTimings.js +154 -0
- package/dist/model/EmbedderCreationRequest.js +0 -8
- package/dist/model/ImageInfo.js +132 -0
- package/dist/model/LLMCreationRequest.js +3 -11
- package/dist/model/LLMResponse.js +2 -2
- package/dist/model/LLMUpdateRequest.js +1 -9
- package/dist/model/MemoryCreationRequest.js +13 -8
- package/dist/model/OcrCategory.js +118 -0
- package/dist/model/OcrCell.js +154 -0
- package/dist/model/OcrDocumentRequest.js +159 -0
- package/dist/model/OcrDocumentResponse.js +170 -0
- package/dist/model/OcrInputFormat.js +78 -0
- package/dist/model/OcrLayout.js +132 -0
- package/dist/model/OcrPage.js +173 -0
- package/dist/model/OcrPageResult.js +138 -0
- package/dist/model/PageTimings.js +143 -0
- package/dist/model/PingEndpointInfo.js +170 -0
- package/dist/model/PingEvent.js +120 -0
- package/dist/model/PingNotice.js +140 -0
- package/dist/model/PingOnceRequest.js +163 -0
- package/dist/model/PingPayloadType.js +68 -0
- package/dist/model/PingResult.js +221 -0
- package/dist/model/PingStreamRequest.js +210 -0
- package/dist/model/PingSummary.js +269 -0
- package/dist/model/PingTargetType.js +68 -0
- package/dist/model/PingTiming.js +143 -0
- package/dist/model/RerankerCreationRequest.js +1 -9
- package/dist/model/RpcStatus.js +123 -0
- package/dist/model/SpaceCreationRequest.js +7 -5
- package/dist/model/SpaceEmbedderConfig.js +5 -7
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
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 _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); } /**
|
|
16
|
+
*
|
|
17
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
18
|
+
*
|
|
19
|
+
* The version of the OpenAPI document:
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Enum class OcrInputFormat.
|
|
29
|
+
* @enum {}
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
32
|
+
var OcrInputFormat = exports["default"] = /*#__PURE__*/function () {
|
|
33
|
+
function OcrInputFormat() {
|
|
34
|
+
_classCallCheck(this, OcrInputFormat);
|
|
35
|
+
/**
|
|
36
|
+
* value: "AUTO"
|
|
37
|
+
* @const
|
|
38
|
+
*/
|
|
39
|
+
_defineProperty(this, "AUTO", "AUTO");
|
|
40
|
+
/**
|
|
41
|
+
* value: "PDF"
|
|
42
|
+
* @const
|
|
43
|
+
*/
|
|
44
|
+
_defineProperty(this, "PDF", "PDF");
|
|
45
|
+
/**
|
|
46
|
+
* value: "TIFF"
|
|
47
|
+
* @const
|
|
48
|
+
*/
|
|
49
|
+
_defineProperty(this, "TIFF", "TIFF");
|
|
50
|
+
/**
|
|
51
|
+
* value: "PNG"
|
|
52
|
+
* @const
|
|
53
|
+
*/
|
|
54
|
+
_defineProperty(this, "PNG", "PNG");
|
|
55
|
+
/**
|
|
56
|
+
* value: "JPEG"
|
|
57
|
+
* @const
|
|
58
|
+
*/
|
|
59
|
+
_defineProperty(this, "JPEG", "JPEG");
|
|
60
|
+
/**
|
|
61
|
+
* value: "BMP"
|
|
62
|
+
* @const
|
|
63
|
+
*/
|
|
64
|
+
_defineProperty(this, "BMP", "BMP");
|
|
65
|
+
}
|
|
66
|
+
return _createClass(OcrInputFormat, null, [{
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value:
|
|
69
|
+
/**
|
|
70
|
+
* Returns a <code>OcrInputFormat</code> enum value from a Javascript object name.
|
|
71
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
72
|
+
* @return {module:model/OcrInputFormat} The enum <code>OcrInputFormat</code> value.
|
|
73
|
+
*/
|
|
74
|
+
function constructFromObject(object) {
|
|
75
|
+
return object;
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
}();
|
|
@@ -0,0 +1,132 @@
|
|
|
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 _OcrCell = _interopRequireDefault(require("./OcrCell"));
|
|
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 OcrLayout model module.
|
|
32
|
+
* @module model/OcrLayout
|
|
33
|
+
* @version 1.0.0
|
|
34
|
+
*/
|
|
35
|
+
var OcrLayout = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a new <code>OcrLayout</code>.
|
|
38
|
+
* Parsed OCR layout output for a page.
|
|
39
|
+
* @alias module:model/OcrLayout
|
|
40
|
+
* @param cells {Array.<module:model/OcrCell>} Layout cells in reading order
|
|
41
|
+
*/
|
|
42
|
+
function OcrLayout(cells) {
|
|
43
|
+
_classCallCheck(this, OcrLayout);
|
|
44
|
+
OcrLayout.initialize(this, cells);
|
|
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(OcrLayout, null, [{
|
|
53
|
+
key: "initialize",
|
|
54
|
+
value: function initialize(obj, cells) {
|
|
55
|
+
obj['cells'] = cells;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>OcrLayout</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/OcrLayout} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/OcrLayout} The populated <code>OcrLayout</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new OcrLayout();
|
|
70
|
+
if (data.hasOwnProperty('cells')) {
|
|
71
|
+
obj['cells'] = _ApiClient["default"].convertToType(data['cells'], [_OcrCell["default"]]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Validates the JSON data with respect to <code>OcrLayout</code>.
|
|
79
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
80
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>OcrLayout</code>.
|
|
81
|
+
*/
|
|
82
|
+
}, {
|
|
83
|
+
key: "validateJSON",
|
|
84
|
+
value: function validateJSON(data) {
|
|
85
|
+
// check to make sure all required properties are present in the JSON string
|
|
86
|
+
var _iterator = _createForOfIteratorHelper(OcrLayout.RequiredProperties),
|
|
87
|
+
_step;
|
|
88
|
+
try {
|
|
89
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
90
|
+
var property = _step.value;
|
|
91
|
+
if (!data.hasOwnProperty(property)) {
|
|
92
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} catch (err) {
|
|
96
|
+
_iterator.e(err);
|
|
97
|
+
} finally {
|
|
98
|
+
_iterator.f();
|
|
99
|
+
}
|
|
100
|
+
if (data['cells']) {
|
|
101
|
+
// data not null
|
|
102
|
+
// ensure the json data is an array
|
|
103
|
+
if (!Array.isArray(data['cells'])) {
|
|
104
|
+
throw new Error("Expected the field `cells` to be an array in the JSON data but got " + data['cells']);
|
|
105
|
+
}
|
|
106
|
+
// validate the optional field `cells` (array)
|
|
107
|
+
var _iterator2 = _createForOfIteratorHelper(data['cells']),
|
|
108
|
+
_step2;
|
|
109
|
+
try {
|
|
110
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
111
|
+
var item = _step2.value;
|
|
112
|
+
_OcrCell["default"].validateJSON(item);
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator2.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator2.f();
|
|
118
|
+
}
|
|
119
|
+
;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}]);
|
|
124
|
+
}();
|
|
125
|
+
OcrLayout.RequiredProperties = ["cells"];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Layout cells in reading order
|
|
129
|
+
* @member {Array.<module:model/OcrCell>} cells
|
|
130
|
+
*/
|
|
131
|
+
OcrLayout.prototype['cells'] = undefined;
|
|
132
|
+
var _default = exports["default"] = OcrLayout;
|
|
@@ -0,0 +1,173 @@
|
|
|
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 _ImageInfo = _interopRequireDefault(require("./ImageInfo"));
|
|
9
|
+
var _OcrLayout = _interopRequireDefault(require("./OcrLayout"));
|
|
10
|
+
var _PageTimings = _interopRequireDefault(require("./PageTimings"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; } } }; }
|
|
14
|
+
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; } }
|
|
15
|
+
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; }
|
|
16
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
+
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); } }
|
|
18
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
|
+
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); } /**
|
|
21
|
+
*
|
|
22
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
23
|
+
*
|
|
24
|
+
* The version of the OpenAPI document:
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
28
|
+
* https://openapi-generator.tech
|
|
29
|
+
* Do not edit the class manually.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The OcrPage model module.
|
|
34
|
+
* @module model/OcrPage
|
|
35
|
+
* @version 1.0.0
|
|
36
|
+
*/
|
|
37
|
+
var OcrPage = /*#__PURE__*/function () {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new <code>OcrPage</code>.
|
|
40
|
+
* OCR output for a single page.
|
|
41
|
+
* @alias module:model/OcrPage
|
|
42
|
+
* @param layout {module:model/OcrLayout}
|
|
43
|
+
* @param timings {module:model/PageTimings}
|
|
44
|
+
* @param image {module:model/ImageInfo}
|
|
45
|
+
*/
|
|
46
|
+
function OcrPage(layout, timings, image) {
|
|
47
|
+
_classCallCheck(this, OcrPage);
|
|
48
|
+
OcrPage.initialize(this, layout, timings, image);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the fields of this object.
|
|
53
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
54
|
+
* Only for internal use.
|
|
55
|
+
*/
|
|
56
|
+
return _createClass(OcrPage, null, [{
|
|
57
|
+
key: "initialize",
|
|
58
|
+
value: function initialize(obj, layout, timings, image) {
|
|
59
|
+
obj['layout'] = layout;
|
|
60
|
+
obj['timings'] = timings;
|
|
61
|
+
obj['image'] = image;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Constructs a <code>OcrPage</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/OcrPage} obj Optional instance to populate.
|
|
69
|
+
* @return {module:model/OcrPage} The populated <code>OcrPage</code> instance.
|
|
70
|
+
*/
|
|
71
|
+
}, {
|
|
72
|
+
key: "constructFromObject",
|
|
73
|
+
value: function constructFromObject(data, obj) {
|
|
74
|
+
if (data) {
|
|
75
|
+
obj = obj || new OcrPage();
|
|
76
|
+
if (data.hasOwnProperty('rawJson')) {
|
|
77
|
+
obj['rawJson'] = _ApiClient["default"].convertToType(data['rawJson'], 'String');
|
|
78
|
+
}
|
|
79
|
+
if (data.hasOwnProperty('markdown')) {
|
|
80
|
+
obj['markdown'] = _ApiClient["default"].convertToType(data['markdown'], 'String');
|
|
81
|
+
}
|
|
82
|
+
if (data.hasOwnProperty('layout')) {
|
|
83
|
+
obj['layout'] = _OcrLayout["default"].constructFromObject(data['layout']);
|
|
84
|
+
}
|
|
85
|
+
if (data.hasOwnProperty('timings')) {
|
|
86
|
+
obj['timings'] = _PageTimings["default"].constructFromObject(data['timings']);
|
|
87
|
+
}
|
|
88
|
+
if (data.hasOwnProperty('image')) {
|
|
89
|
+
obj['image'] = _ImageInfo["default"].constructFromObject(data['image']);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return obj;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Validates the JSON data with respect to <code>OcrPage</code>.
|
|
97
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
98
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>OcrPage</code>.
|
|
99
|
+
*/
|
|
100
|
+
}, {
|
|
101
|
+
key: "validateJSON",
|
|
102
|
+
value: function validateJSON(data) {
|
|
103
|
+
// check to make sure all required properties are present in the JSON string
|
|
104
|
+
var _iterator = _createForOfIteratorHelper(OcrPage.RequiredProperties),
|
|
105
|
+
_step;
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
108
|
+
var property = _step.value;
|
|
109
|
+
if (!data.hasOwnProperty(property)) {
|
|
110
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// ensure the json data is a string
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator.f();
|
|
118
|
+
}
|
|
119
|
+
if (data['rawJson'] && !(typeof data['rawJson'] === 'string' || data['rawJson'] instanceof String)) {
|
|
120
|
+
throw new Error("Expected the field `rawJson` to be a primitive type in the JSON string but got " + data['rawJson']);
|
|
121
|
+
}
|
|
122
|
+
// ensure the json data is a string
|
|
123
|
+
if (data['markdown'] && !(typeof data['markdown'] === 'string' || data['markdown'] instanceof String)) {
|
|
124
|
+
throw new Error("Expected the field `markdown` to be a primitive type in the JSON string but got " + data['markdown']);
|
|
125
|
+
}
|
|
126
|
+
// validate the optional field `layout`
|
|
127
|
+
if (data['layout']) {
|
|
128
|
+
// data not null
|
|
129
|
+
_OcrLayout["default"].validateJSON(data['layout']);
|
|
130
|
+
}
|
|
131
|
+
// validate the optional field `timings`
|
|
132
|
+
if (data['timings']) {
|
|
133
|
+
// data not null
|
|
134
|
+
_PageTimings["default"].validateJSON(data['timings']);
|
|
135
|
+
}
|
|
136
|
+
// validate the optional field `image`
|
|
137
|
+
if (data['image']) {
|
|
138
|
+
// data not null
|
|
139
|
+
_ImageInfo["default"].validateJSON(data['image']);
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
}]);
|
|
144
|
+
}();
|
|
145
|
+
OcrPage.RequiredProperties = ["layout", "timings", "image"];
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Raw OCR JSON payload when requested
|
|
149
|
+
* @member {String} rawJson
|
|
150
|
+
*/
|
|
151
|
+
OcrPage.prototype['rawJson'] = undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Markdown rendering when requested
|
|
155
|
+
* @member {String} markdown
|
|
156
|
+
*/
|
|
157
|
+
OcrPage.prototype['markdown'] = undefined;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @member {module:model/OcrLayout} layout
|
|
161
|
+
*/
|
|
162
|
+
OcrPage.prototype['layout'] = undefined;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @member {module:model/PageTimings} timings
|
|
166
|
+
*/
|
|
167
|
+
OcrPage.prototype['timings'] = undefined;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @member {module:model/ImageInfo} image
|
|
171
|
+
*/
|
|
172
|
+
OcrPage.prototype['image'] = undefined;
|
|
173
|
+
var _default = exports["default"] = OcrPage;
|
|
@@ -0,0 +1,138 @@
|
|
|
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 _OcrPage = _interopRequireDefault(require("./OcrPage"));
|
|
9
|
+
var _RpcStatus = _interopRequireDefault(require("./RpcStatus"));
|
|
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 _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; } } }; }
|
|
13
|
+
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; } }
|
|
14
|
+
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; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); } /**
|
|
20
|
+
*
|
|
21
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document:
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* The OcrPageResult model module.
|
|
33
|
+
* @module model/OcrPageResult
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
var OcrPageResult = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new <code>OcrPageResult</code>.
|
|
39
|
+
* Per-page OCR result containing output or error status.
|
|
40
|
+
* @alias module:model/OcrPageResult
|
|
41
|
+
* @param pageIndex {Number} 0-based page index
|
|
42
|
+
*/
|
|
43
|
+
function OcrPageResult(pageIndex) {
|
|
44
|
+
_classCallCheck(this, OcrPageResult);
|
|
45
|
+
OcrPageResult.initialize(this, pageIndex);
|
|
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(OcrPageResult, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, pageIndex) {
|
|
56
|
+
obj['pageIndex'] = pageIndex;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Constructs a <code>OcrPageResult</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/OcrPageResult} obj Optional instance to populate.
|
|
64
|
+
* @return {module:model/OcrPageResult} The populated <code>OcrPageResult</code> instance.
|
|
65
|
+
*/
|
|
66
|
+
}, {
|
|
67
|
+
key: "constructFromObject",
|
|
68
|
+
value: function constructFromObject(data, obj) {
|
|
69
|
+
if (data) {
|
|
70
|
+
obj = obj || new OcrPageResult();
|
|
71
|
+
if (data.hasOwnProperty('pageIndex')) {
|
|
72
|
+
obj['pageIndex'] = _ApiClient["default"].convertToType(data['pageIndex'], 'Number');
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('page')) {
|
|
75
|
+
obj['page'] = _OcrPage["default"].constructFromObject(data['page']);
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('status')) {
|
|
78
|
+
obj['status'] = _RpcStatus["default"].constructFromObject(data['status']);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validates the JSON data with respect to <code>OcrPageResult</code>.
|
|
86
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
87
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>OcrPageResult</code>.
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "validateJSON",
|
|
91
|
+
value: function validateJSON(data) {
|
|
92
|
+
// check to make sure all required properties are present in the JSON string
|
|
93
|
+
var _iterator = _createForOfIteratorHelper(OcrPageResult.RequiredProperties),
|
|
94
|
+
_step;
|
|
95
|
+
try {
|
|
96
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
97
|
+
var property = _step.value;
|
|
98
|
+
if (!data.hasOwnProperty(property)) {
|
|
99
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// validate the optional field `page`
|
|
103
|
+
} catch (err) {
|
|
104
|
+
_iterator.e(err);
|
|
105
|
+
} finally {
|
|
106
|
+
_iterator.f();
|
|
107
|
+
}
|
|
108
|
+
if (data['page']) {
|
|
109
|
+
// data not null
|
|
110
|
+
_OcrPage["default"].validateJSON(data['page']);
|
|
111
|
+
}
|
|
112
|
+
// validate the optional field `status`
|
|
113
|
+
if (data['status']) {
|
|
114
|
+
// data not null
|
|
115
|
+
_RpcStatus["default"].validateJSON(data['status']);
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
}]);
|
|
120
|
+
}();
|
|
121
|
+
OcrPageResult.RequiredProperties = ["pageIndex"];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 0-based page index
|
|
125
|
+
* @member {Number} pageIndex
|
|
126
|
+
*/
|
|
127
|
+
OcrPageResult.prototype['pageIndex'] = undefined;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @member {module:model/OcrPage} page
|
|
131
|
+
*/
|
|
132
|
+
OcrPageResult.prototype['page'] = undefined;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @member {module:model/RpcStatus} status
|
|
136
|
+
*/
|
|
137
|
+
OcrPageResult.prototype['status'] = undefined;
|
|
138
|
+
var _default = exports["default"] = OcrPageResult;
|
|
@@ -0,0 +1,143 @@
|
|
|
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 PageTimings model module.
|
|
31
|
+
* @module model/PageTimings
|
|
32
|
+
* @version 1.0.0
|
|
33
|
+
*/
|
|
34
|
+
var PageTimings = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a new <code>PageTimings</code>.
|
|
37
|
+
* Per-page timing breakdown for OCR processing.
|
|
38
|
+
* @alias module:model/PageTimings
|
|
39
|
+
* @param queueWaitMs {Number} Time spent waiting in the render queue (ms)
|
|
40
|
+
* @param renderMs {Number} Time spent rendering the page image (ms)
|
|
41
|
+
* @param ocrMs {Number} Time spent running OCR (ms)
|
|
42
|
+
* @param totalMs {Number} Total page processing time (ms)
|
|
43
|
+
*/
|
|
44
|
+
function PageTimings(queueWaitMs, renderMs, ocrMs, totalMs) {
|
|
45
|
+
_classCallCheck(this, PageTimings);
|
|
46
|
+
PageTimings.initialize(this, queueWaitMs, renderMs, ocrMs, totalMs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Initializes the fields of this object.
|
|
51
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
52
|
+
* Only for internal use.
|
|
53
|
+
*/
|
|
54
|
+
return _createClass(PageTimings, null, [{
|
|
55
|
+
key: "initialize",
|
|
56
|
+
value: function initialize(obj, queueWaitMs, renderMs, ocrMs, totalMs) {
|
|
57
|
+
obj['queueWaitMs'] = queueWaitMs;
|
|
58
|
+
obj['renderMs'] = renderMs;
|
|
59
|
+
obj['ocrMs'] = ocrMs;
|
|
60
|
+
obj['totalMs'] = totalMs;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Constructs a <code>PageTimings</code> from a plain JavaScript object, optionally creating a new instance.
|
|
65
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
66
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
67
|
+
* @param {module:model/PageTimings} obj Optional instance to populate.
|
|
68
|
+
* @return {module:model/PageTimings} The populated <code>PageTimings</code> instance.
|
|
69
|
+
*/
|
|
70
|
+
}, {
|
|
71
|
+
key: "constructFromObject",
|
|
72
|
+
value: function constructFromObject(data, obj) {
|
|
73
|
+
if (data) {
|
|
74
|
+
obj = obj || new PageTimings();
|
|
75
|
+
if (data.hasOwnProperty('queueWaitMs')) {
|
|
76
|
+
obj['queueWaitMs'] = _ApiClient["default"].convertToType(data['queueWaitMs'], 'Number');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('renderMs')) {
|
|
79
|
+
obj['renderMs'] = _ApiClient["default"].convertToType(data['renderMs'], 'Number');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('ocrMs')) {
|
|
82
|
+
obj['ocrMs'] = _ApiClient["default"].convertToType(data['ocrMs'], 'Number');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('totalMs')) {
|
|
85
|
+
obj['totalMs'] = _ApiClient["default"].convertToType(data['totalMs'], 'Number');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Validates the JSON data with respect to <code>PageTimings</code>.
|
|
93
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
94
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PageTimings</code>.
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "validateJSON",
|
|
98
|
+
value: function validateJSON(data) {
|
|
99
|
+
// check to make sure all required properties are present in the JSON string
|
|
100
|
+
var _iterator = _createForOfIteratorHelper(PageTimings.RequiredProperties),
|
|
101
|
+
_step;
|
|
102
|
+
try {
|
|
103
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
104
|
+
var property = _step.value;
|
|
105
|
+
if (!data.hasOwnProperty(property)) {
|
|
106
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
} catch (err) {
|
|
110
|
+
_iterator.e(err);
|
|
111
|
+
} finally {
|
|
112
|
+
_iterator.f();
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}]);
|
|
117
|
+
}();
|
|
118
|
+
PageTimings.RequiredProperties = ["queueWaitMs", "renderMs", "ocrMs", "totalMs"];
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Time spent waiting in the render queue (ms)
|
|
122
|
+
* @member {Number} queueWaitMs
|
|
123
|
+
*/
|
|
124
|
+
PageTimings.prototype['queueWaitMs'] = undefined;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Time spent rendering the page image (ms)
|
|
128
|
+
* @member {Number} renderMs
|
|
129
|
+
*/
|
|
130
|
+
PageTimings.prototype['renderMs'] = undefined;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Time spent running OCR (ms)
|
|
134
|
+
* @member {Number} ocrMs
|
|
135
|
+
*/
|
|
136
|
+
PageTimings.prototype['ocrMs'] = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Total page processing time (ms)
|
|
140
|
+
* @member {Number} totalMs
|
|
141
|
+
*/
|
|
142
|
+
PageTimings.prototype['totalMs'] = undefined;
|
|
143
|
+
var _default = exports["default"] = PageTimings;
|