@pairsystems/goodmem-client 1.0.0-beta.1

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 (36) hide show
  1. package/README.md +200 -0
  2. package/dist/ApiClient.js +718 -0
  3. package/dist/api/APIKeysApi.js +188 -0
  4. package/dist/api/EmbeddersApi.js +232 -0
  5. package/dist/api/MemoriesApi.js +290 -0
  6. package/dist/api/SpacesApi.js +240 -0
  7. package/dist/api/SystemApi.js +77 -0
  8. package/dist/api/UsersApi.js +86 -0
  9. package/dist/client.js +150 -0
  10. package/dist/index.js +230 -0
  11. package/dist/model/ApiKeyResponse.js +203 -0
  12. package/dist/model/BatchMemoryCreationRequest.js +140 -0
  13. package/dist/model/BatchMemoryDeletionRequest.js +122 -0
  14. package/dist/model/BatchMemoryRetrievalRequest.js +131 -0
  15. package/dist/model/CreateApiKeyRequest.js +98 -0
  16. package/dist/model/CreateApiKeyResponse.js +105 -0
  17. package/dist/model/EmbedderCreationRequest.js +288 -0
  18. package/dist/model/EmbedderResponse.js +336 -0
  19. package/dist/model/ListApiKeysResponse.js +112 -0
  20. package/dist/model/ListEmbeddersResponse.js +132 -0
  21. package/dist/model/ListSpacesResponse.js +125 -0
  22. package/dist/model/Memory.js +248 -0
  23. package/dist/model/MemoryCreationRequest.js +187 -0
  24. package/dist/model/MemoryListResponse.js +145 -0
  25. package/dist/model/Modality.js +68 -0
  26. package/dist/model/ProviderType.js +63 -0
  27. package/dist/model/Space.js +251 -0
  28. package/dist/model/SpaceCreationRequest.js +178 -0
  29. package/dist/model/SpaceEmbedder.js +192 -0
  30. package/dist/model/SpaceEmbedderConfig.js +125 -0
  31. package/dist/model/SystemInitResponse.js +151 -0
  32. package/dist/model/UpdateApiKeyRequest.js +121 -0
  33. package/dist/model/UpdateEmbedderRequest.js +244 -0
  34. package/dist/model/UpdateSpaceRequest.js +166 -0
  35. package/dist/model/UserResponse.js +179 -0
  36. package/package.json +78 -0
@@ -0,0 +1,112 @@
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 _ApiKeyResponse = _interopRequireDefault(require("./ApiKeyResponse"));
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
+ * GoodMem API
20
+ * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
21
+ *
22
+ * The version of the OpenAPI document: v1
23
+ * Contact: support@goodmem.io
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 ListApiKeysResponse model module.
32
+ * @module model/ListApiKeysResponse
33
+ * @version v1
34
+ */
35
+ var ListApiKeysResponse = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>ListApiKeysResponse</code>.
38
+ * Response containing a list of API keys.
39
+ * @alias module:model/ListApiKeysResponse
40
+ */
41
+ function ListApiKeysResponse() {
42
+ _classCallCheck(this, ListApiKeysResponse);
43
+ ListApiKeysResponse.initialize(this);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(ListApiKeysResponse, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj) {}
54
+
55
+ /**
56
+ * Constructs a <code>ListApiKeysResponse</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/ListApiKeysResponse} obj Optional instance to populate.
60
+ * @return {module:model/ListApiKeysResponse} The populated <code>ListApiKeysResponse</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new ListApiKeysResponse();
67
+ if (data.hasOwnProperty('keys')) {
68
+ obj['keys'] = _ApiClient["default"].convertToType(data['keys'], [_ApiKeyResponse["default"]]);
69
+ }
70
+ }
71
+ return obj;
72
+ }
73
+
74
+ /**
75
+ * Validates the JSON data with respect to <code>ListApiKeysResponse</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>ListApiKeysResponse</code>.
78
+ */
79
+ }, {
80
+ key: "validateJSON",
81
+ value: function validateJSON(data) {
82
+ if (data['keys']) {
83
+ // data not null
84
+ // ensure the json data is an array
85
+ if (!Array.isArray(data['keys'])) {
86
+ throw new Error("Expected the field `keys` to be an array in the JSON data but got " + data['keys']);
87
+ }
88
+ // validate the optional field `keys` (array)
89
+ var _iterator = _createForOfIteratorHelper(data['keys']),
90
+ _step;
91
+ try {
92
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
93
+ var item = _step.value;
94
+ _ApiKeyResponse["default"].validateJSON(item);
95
+ }
96
+ } catch (err) {
97
+ _iterator.e(err);
98
+ } finally {
99
+ _iterator.f();
100
+ }
101
+ ;
102
+ }
103
+ return true;
104
+ }
105
+ }]);
106
+ }();
107
+ /**
108
+ * List of API keys belonging to the authenticated user.
109
+ * @member {Array.<module:model/ApiKeyResponse>} keys
110
+ */
111
+ ListApiKeysResponse.prototype['keys'] = undefined;
112
+ var _default = exports["default"] = ListApiKeysResponse;
@@ -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 _EmbedderResponse = _interopRequireDefault(require("./EmbedderResponse"));
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
+ * GoodMem API
20
+ * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
21
+ *
22
+ * The version of the OpenAPI document: v1
23
+ * Contact: support@goodmem.io
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 ListEmbeddersResponse model module.
32
+ * @module model/ListEmbeddersResponse
33
+ * @version v1
34
+ */
35
+ var ListEmbeddersResponse = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>ListEmbeddersResponse</code>.
38
+ * Response containing a list of embedders
39
+ * @alias module:model/ListEmbeddersResponse
40
+ * @param embedders {Array.<module:model/EmbedderResponse>} List of embedder configurations
41
+ */
42
+ function ListEmbeddersResponse(embedders) {
43
+ _classCallCheck(this, ListEmbeddersResponse);
44
+ ListEmbeddersResponse.initialize(this, embedders);
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(ListEmbeddersResponse, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, embedders) {
55
+ obj['embedders'] = embedders;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>ListEmbeddersResponse</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/ListEmbeddersResponse} obj Optional instance to populate.
63
+ * @return {module:model/ListEmbeddersResponse} The populated <code>ListEmbeddersResponse</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new ListEmbeddersResponse();
70
+ if (data.hasOwnProperty('embedders')) {
71
+ obj['embedders'] = _ApiClient["default"].convertToType(data['embedders'], [_EmbedderResponse["default"]]);
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>ListEmbeddersResponse</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>ListEmbeddersResponse</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(ListEmbeddersResponse.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['embedders']) {
101
+ // data not null
102
+ // ensure the json data is an array
103
+ if (!Array.isArray(data['embedders'])) {
104
+ throw new Error("Expected the field `embedders` to be an array in the JSON data but got " + data['embedders']);
105
+ }
106
+ // validate the optional field `embedders` (array)
107
+ var _iterator2 = _createForOfIteratorHelper(data['embedders']),
108
+ _step2;
109
+ try {
110
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
111
+ var item = _step2.value;
112
+ _EmbedderResponse["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
+ ListEmbeddersResponse.RequiredProperties = ["embedders"];
126
+
127
+ /**
128
+ * List of embedder configurations
129
+ * @member {Array.<module:model/EmbedderResponse>} embedders
130
+ */
131
+ ListEmbeddersResponse.prototype['embedders'] = undefined;
132
+ var _default = exports["default"] = ListEmbeddersResponse;
@@ -0,0 +1,125 @@
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 _Space = _interopRequireDefault(require("./Space"));
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
+ * GoodMem API
20
+ * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
21
+ *
22
+ * The version of the OpenAPI document: v1
23
+ * Contact: support@goodmem.io
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 ListSpacesResponse model module.
32
+ * @module model/ListSpacesResponse
33
+ * @version v1
34
+ */
35
+ var ListSpacesResponse = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>ListSpacesResponse</code>.
38
+ * Response containing a list of spaces and optional pagination token.
39
+ * @alias module:model/ListSpacesResponse
40
+ */
41
+ function ListSpacesResponse() {
42
+ _classCallCheck(this, ListSpacesResponse);
43
+ ListSpacesResponse.initialize(this);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(ListSpacesResponse, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj) {}
54
+
55
+ /**
56
+ * Constructs a <code>ListSpacesResponse</code> from a plain JavaScript object, optionally creating a new instance.
57
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
58
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
59
+ * @param {module:model/ListSpacesResponse} obj Optional instance to populate.
60
+ * @return {module:model/ListSpacesResponse} The populated <code>ListSpacesResponse</code> instance.
61
+ */
62
+ }, {
63
+ key: "constructFromObject",
64
+ value: function constructFromObject(data, obj) {
65
+ if (data) {
66
+ obj = obj || new ListSpacesResponse();
67
+ if (data.hasOwnProperty('spaces')) {
68
+ obj['spaces'] = _ApiClient["default"].convertToType(data['spaces'], [_Space["default"]]);
69
+ }
70
+ if (data.hasOwnProperty('nextToken')) {
71
+ obj['nextToken'] = _ApiClient["default"].convertToType(data['nextToken'], 'String');
72
+ }
73
+ }
74
+ return obj;
75
+ }
76
+
77
+ /**
78
+ * Validates the JSON data with respect to <code>ListSpacesResponse</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>ListSpacesResponse</code>.
81
+ */
82
+ }, {
83
+ key: "validateJSON",
84
+ value: function validateJSON(data) {
85
+ if (data['spaces']) {
86
+ // data not null
87
+ // ensure the json data is an array
88
+ if (!Array.isArray(data['spaces'])) {
89
+ throw new Error("Expected the field `spaces` to be an array in the JSON data but got " + data['spaces']);
90
+ }
91
+ // validate the optional field `spaces` (array)
92
+ var _iterator = _createForOfIteratorHelper(data['spaces']),
93
+ _step;
94
+ try {
95
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
+ var item = _step.value;
97
+ _Space["default"].validateJSON(item);
98
+ }
99
+ } catch (err) {
100
+ _iterator.e(err);
101
+ } finally {
102
+ _iterator.f();
103
+ }
104
+ ;
105
+ }
106
+ // ensure the json data is a string
107
+ if (data['nextToken'] && !(typeof data['nextToken'] === 'string' || data['nextToken'] instanceof String)) {
108
+ throw new Error("Expected the field `nextToken` to be a primitive type in the JSON string but got " + data['nextToken']);
109
+ }
110
+ return true;
111
+ }
112
+ }]);
113
+ }();
114
+ /**
115
+ * The list of spaces matching the query criteria.
116
+ * @member {Array.<module:model/Space>} spaces
117
+ */
118
+ ListSpacesResponse.prototype['spaces'] = undefined;
119
+
120
+ /**
121
+ * Pagination token for retrieving the next set of results. Only present if there are more results available.
122
+ * @member {String} nextToken
123
+ */
124
+ ListSpacesResponse.prototype['nextToken'] = undefined;
125
+ var _default = exports["default"] = ListSpacesResponse;
@@ -0,0 +1,248 @@
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
+ * GoodMem API
19
+ * API for interacting with the GoodMem service, providing vector-based memory storage and retrieval with multiple embedder support. The service enables creation of memory spaces, storing memories with vector representations, and efficient similarity-based retrieval.
20
+ *
21
+ * The version of the OpenAPI document: v1
22
+ * Contact: support@goodmem.io
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 Memory model module.
31
+ * @module model/Memory
32
+ * @version v1
33
+ */
34
+ var Memory = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>Memory</code>.
37
+ * Memory object containing stored content and metadata
38
+ * @alias module:model/Memory
39
+ * @param memoryId {String} Unique identifier of the memory
40
+ * @param spaceId {String} ID of the space containing this memory
41
+ * @param contentType {String} MIME type of the content
42
+ * @param processingStatus {String} Processing status of the memory
43
+ * @param createdAt {Number} Timestamp when the memory was created (milliseconds since epoch)
44
+ * @param updatedAt {Number} Timestamp when the memory was last updated (milliseconds since epoch)
45
+ * @param createdById {String} ID of the user who created this memory
46
+ * @param updatedById {String} ID of the user who last updated this memory
47
+ */
48
+ function Memory(memoryId, spaceId, contentType, processingStatus, createdAt, updatedAt, createdById, updatedById) {
49
+ _classCallCheck(this, Memory);
50
+ Memory.initialize(this, memoryId, spaceId, contentType, processingStatus, 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(Memory, null, [{
59
+ key: "initialize",
60
+ value: function initialize(obj, memoryId, spaceId, contentType, processingStatus, createdAt, updatedAt, createdById, updatedById) {
61
+ obj['memoryId'] = memoryId;
62
+ obj['spaceId'] = spaceId;
63
+ obj['contentType'] = contentType;
64
+ obj['processingStatus'] = processingStatus;
65
+ obj['createdAt'] = createdAt;
66
+ obj['updatedAt'] = updatedAt;
67
+ obj['createdById'] = createdById;
68
+ obj['updatedById'] = updatedById;
69
+ }
70
+
71
+ /**
72
+ * Constructs a <code>Memory</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/Memory} obj Optional instance to populate.
76
+ * @return {module:model/Memory} The populated <code>Memory</code> instance.
77
+ */
78
+ }, {
79
+ key: "constructFromObject",
80
+ value: function constructFromObject(data, obj) {
81
+ if (data) {
82
+ obj = obj || new Memory();
83
+ if (data.hasOwnProperty('memoryId')) {
84
+ obj['memoryId'] = _ApiClient["default"].convertToType(data['memoryId'], 'String');
85
+ }
86
+ if (data.hasOwnProperty('spaceId')) {
87
+ obj['spaceId'] = _ApiClient["default"].convertToType(data['spaceId'], 'String');
88
+ }
89
+ if (data.hasOwnProperty('originalContent')) {
90
+ obj['originalContent'] = _ApiClient["default"].convertToType(data['originalContent'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('originalContentRef')) {
93
+ obj['originalContentRef'] = _ApiClient["default"].convertToType(data['originalContentRef'], 'String');
94
+ }
95
+ if (data.hasOwnProperty('contentType')) {
96
+ obj['contentType'] = _ApiClient["default"].convertToType(data['contentType'], 'String');
97
+ }
98
+ if (data.hasOwnProperty('processingStatus')) {
99
+ obj['processingStatus'] = _ApiClient["default"].convertToType(data['processingStatus'], 'String');
100
+ }
101
+ if (data.hasOwnProperty('metadata')) {
102
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], {
103
+ 'String': Object
104
+ });
105
+ }
106
+ if (data.hasOwnProperty('createdAt')) {
107
+ obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
108
+ }
109
+ if (data.hasOwnProperty('updatedAt')) {
110
+ obj['updatedAt'] = _ApiClient["default"].convertToType(data['updatedAt'], 'Number');
111
+ }
112
+ if (data.hasOwnProperty('createdById')) {
113
+ obj['createdById'] = _ApiClient["default"].convertToType(data['createdById'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('updatedById')) {
116
+ obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
117
+ }
118
+ }
119
+ return obj;
120
+ }
121
+
122
+ /**
123
+ * Validates the JSON data with respect to <code>Memory</code>.
124
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
125
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>Memory</code>.
126
+ */
127
+ }, {
128
+ key: "validateJSON",
129
+ value: function validateJSON(data) {
130
+ // check to make sure all required properties are present in the JSON string
131
+ var _iterator = _createForOfIteratorHelper(Memory.RequiredProperties),
132
+ _step;
133
+ try {
134
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
135
+ var property = _step.value;
136
+ if (!data.hasOwnProperty(property)) {
137
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
138
+ }
139
+ }
140
+ // ensure the json data is a string
141
+ } catch (err) {
142
+ _iterator.e(err);
143
+ } finally {
144
+ _iterator.f();
145
+ }
146
+ if (data['memoryId'] && !(typeof data['memoryId'] === 'string' || data['memoryId'] instanceof String)) {
147
+ throw new Error("Expected the field `memoryId` to be a primitive type in the JSON string but got " + data['memoryId']);
148
+ }
149
+ // ensure the json data is a string
150
+ if (data['spaceId'] && !(typeof data['spaceId'] === 'string' || data['spaceId'] instanceof String)) {
151
+ throw new Error("Expected the field `spaceId` to be a primitive type in the JSON string but got " + data['spaceId']);
152
+ }
153
+ // ensure the json data is a string
154
+ if (data['originalContent'] && !(typeof data['originalContent'] === 'string' || data['originalContent'] instanceof String)) {
155
+ throw new Error("Expected the field `originalContent` to be a primitive type in the JSON string but got " + data['originalContent']);
156
+ }
157
+ // ensure the json data is a string
158
+ if (data['originalContentRef'] && !(typeof data['originalContentRef'] === 'string' || data['originalContentRef'] instanceof String)) {
159
+ throw new Error("Expected the field `originalContentRef` to be a primitive type in the JSON string but got " + data['originalContentRef']);
160
+ }
161
+ // ensure the json data is a string
162
+ if (data['contentType'] && !(typeof data['contentType'] === 'string' || data['contentType'] instanceof String)) {
163
+ throw new Error("Expected the field `contentType` to be a primitive type in the JSON string but got " + data['contentType']);
164
+ }
165
+ // ensure the json data is a string
166
+ if (data['processingStatus'] && !(typeof data['processingStatus'] === 'string' || data['processingStatus'] instanceof String)) {
167
+ throw new Error("Expected the field `processingStatus` to be a primitive type in the JSON string but got " + data['processingStatus']);
168
+ }
169
+ // ensure the json data is a string
170
+ if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
171
+ throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
172
+ }
173
+ // ensure the json data is a string
174
+ if (data['updatedById'] && !(typeof data['updatedById'] === 'string' || data['updatedById'] instanceof String)) {
175
+ throw new Error("Expected the field `updatedById` to be a primitive type in the JSON string but got " + data['updatedById']);
176
+ }
177
+ return true;
178
+ }
179
+ }]);
180
+ }();
181
+ Memory.RequiredProperties = ["memoryId", "spaceId", "contentType", "processingStatus", "createdAt", "updatedAt", "createdById", "updatedById"];
182
+
183
+ /**
184
+ * Unique identifier of the memory
185
+ * @member {String} memoryId
186
+ */
187
+ Memory.prototype['memoryId'] = undefined;
188
+
189
+ /**
190
+ * ID of the space containing this memory
191
+ * @member {String} spaceId
192
+ */
193
+ Memory.prototype['spaceId'] = undefined;
194
+
195
+ /**
196
+ * Original content (only included if requested)
197
+ * @member {String} originalContent
198
+ */
199
+ Memory.prototype['originalContent'] = undefined;
200
+
201
+ /**
202
+ * Reference to external content location
203
+ * @member {String} originalContentRef
204
+ */
205
+ Memory.prototype['originalContentRef'] = undefined;
206
+
207
+ /**
208
+ * MIME type of the content
209
+ * @member {String} contentType
210
+ */
211
+ Memory.prototype['contentType'] = undefined;
212
+
213
+ /**
214
+ * Processing status of the memory
215
+ * @member {String} processingStatus
216
+ */
217
+ Memory.prototype['processingStatus'] = undefined;
218
+
219
+ /**
220
+ * Additional metadata for the memory
221
+ * @member {Object.<String, Object>} metadata
222
+ */
223
+ Memory.prototype['metadata'] = undefined;
224
+
225
+ /**
226
+ * Timestamp when the memory was created (milliseconds since epoch)
227
+ * @member {Number} createdAt
228
+ */
229
+ Memory.prototype['createdAt'] = undefined;
230
+
231
+ /**
232
+ * Timestamp when the memory was last updated (milliseconds since epoch)
233
+ * @member {Number} updatedAt
234
+ */
235
+ Memory.prototype['updatedAt'] = undefined;
236
+
237
+ /**
238
+ * ID of the user who created this memory
239
+ * @member {String} createdById
240
+ */
241
+ Memory.prototype['createdById'] = undefined;
242
+
243
+ /**
244
+ * ID of the user who last updated this memory
245
+ * @member {String} updatedById
246
+ */
247
+ Memory.prototype['updatedById'] = undefined;
248
+ var _default = exports["default"] = Memory;