@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,251 @@
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 _SpaceEmbedder = _interopRequireDefault(require("./SpaceEmbedder"));
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 Space model module.
32
+ * @module model/Space
33
+ * @version v1
34
+ */
35
+ var Space = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>Space</code>.
38
+ * A Space is a container for organizing related memories with vector embeddings.
39
+ * @alias module:model/Space
40
+ * @param spaceId {String} The unique identifier for this space.
41
+ * @param name {String} The name of the space.
42
+ * @param spaceEmbedders {Array.<module:model/SpaceEmbedder>} The list of embedders associated with this space.
43
+ * @param createdAt {Number} Timestamp when this space was created (milliseconds since epoch).
44
+ * @param updatedAt {Number} Timestamp when this space was last updated (milliseconds since epoch).
45
+ * @param ownerId {String} The ID of the user who owns this space.
46
+ * @param createdById {String} The ID of the user who created this space.
47
+ * @param updatedById {String} The ID of the user who last updated this space.
48
+ * @param publicRead {Boolean} Whether this space is publicly readable by all users.
49
+ */
50
+ function Space(spaceId, name, spaceEmbedders, createdAt, updatedAt, ownerId, createdById, updatedById, publicRead) {
51
+ _classCallCheck(this, Space);
52
+ Space.initialize(this, spaceId, name, spaceEmbedders, createdAt, updatedAt, ownerId, createdById, updatedById, publicRead);
53
+ }
54
+
55
+ /**
56
+ * Initializes the fields of this object.
57
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
58
+ * Only for internal use.
59
+ */
60
+ return _createClass(Space, null, [{
61
+ key: "initialize",
62
+ value: function initialize(obj, spaceId, name, spaceEmbedders, createdAt, updatedAt, ownerId, createdById, updatedById, publicRead) {
63
+ obj['spaceId'] = spaceId;
64
+ obj['name'] = name;
65
+ obj['spaceEmbedders'] = spaceEmbedders;
66
+ obj['createdAt'] = createdAt;
67
+ obj['updatedAt'] = updatedAt;
68
+ obj['ownerId'] = ownerId;
69
+ obj['createdById'] = createdById;
70
+ obj['updatedById'] = updatedById;
71
+ obj['publicRead'] = publicRead;
72
+ }
73
+
74
+ /**
75
+ * Constructs a <code>Space</code> from a plain JavaScript object, optionally creating a new instance.
76
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @param {module:model/Space} obj Optional instance to populate.
79
+ * @return {module:model/Space} The populated <code>Space</code> instance.
80
+ */
81
+ }, {
82
+ key: "constructFromObject",
83
+ value: function constructFromObject(data, obj) {
84
+ if (data) {
85
+ obj = obj || new Space();
86
+ if (data.hasOwnProperty('spaceId')) {
87
+ obj['spaceId'] = _ApiClient["default"].convertToType(data['spaceId'], 'String');
88
+ }
89
+ if (data.hasOwnProperty('name')) {
90
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
91
+ }
92
+ if (data.hasOwnProperty('labels')) {
93
+ obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
94
+ 'String': 'String'
95
+ });
96
+ }
97
+ if (data.hasOwnProperty('spaceEmbedders')) {
98
+ obj['spaceEmbedders'] = _ApiClient["default"].convertToType(data['spaceEmbedders'], [_SpaceEmbedder["default"]]);
99
+ }
100
+ if (data.hasOwnProperty('createdAt')) {
101
+ obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
102
+ }
103
+ if (data.hasOwnProperty('updatedAt')) {
104
+ obj['updatedAt'] = _ApiClient["default"].convertToType(data['updatedAt'], 'Number');
105
+ }
106
+ if (data.hasOwnProperty('ownerId')) {
107
+ obj['ownerId'] = _ApiClient["default"].convertToType(data['ownerId'], 'String');
108
+ }
109
+ if (data.hasOwnProperty('createdById')) {
110
+ obj['createdById'] = _ApiClient["default"].convertToType(data['createdById'], 'String');
111
+ }
112
+ if (data.hasOwnProperty('updatedById')) {
113
+ obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
114
+ }
115
+ if (data.hasOwnProperty('publicRead')) {
116
+ obj['publicRead'] = _ApiClient["default"].convertToType(data['publicRead'], 'Boolean');
117
+ }
118
+ }
119
+ return obj;
120
+ }
121
+
122
+ /**
123
+ * Validates the JSON data with respect to <code>Space</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>Space</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(Space.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['spaceId'] && !(typeof data['spaceId'] === 'string' || data['spaceId'] instanceof String)) {
147
+ throw new Error("Expected the field `spaceId` to be a primitive type in the JSON string but got " + data['spaceId']);
148
+ }
149
+ // ensure the json data is a string
150
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
151
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
152
+ }
153
+ if (data['spaceEmbedders']) {
154
+ // data not null
155
+ // ensure the json data is an array
156
+ if (!Array.isArray(data['spaceEmbedders'])) {
157
+ throw new Error("Expected the field `spaceEmbedders` to be an array in the JSON data but got " + data['spaceEmbedders']);
158
+ }
159
+ // validate the optional field `spaceEmbedders` (array)
160
+ var _iterator2 = _createForOfIteratorHelper(data['spaceEmbedders']),
161
+ _step2;
162
+ try {
163
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
164
+ var item = _step2.value;
165
+ _SpaceEmbedder["default"].validateJSON(item);
166
+ }
167
+ } catch (err) {
168
+ _iterator2.e(err);
169
+ } finally {
170
+ _iterator2.f();
171
+ }
172
+ ;
173
+ }
174
+ // ensure the json data is a string
175
+ if (data['ownerId'] && !(typeof data['ownerId'] === 'string' || data['ownerId'] instanceof String)) {
176
+ throw new Error("Expected the field `ownerId` to be a primitive type in the JSON string but got " + data['ownerId']);
177
+ }
178
+ // ensure the json data is a string
179
+ if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
180
+ throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
181
+ }
182
+ // ensure the json data is a string
183
+ if (data['updatedById'] && !(typeof data['updatedById'] === 'string' || data['updatedById'] instanceof String)) {
184
+ throw new Error("Expected the field `updatedById` to be a primitive type in the JSON string but got " + data['updatedById']);
185
+ }
186
+ return true;
187
+ }
188
+ }]);
189
+ }();
190
+ Space.RequiredProperties = ["spaceId", "name", "spaceEmbedders", "createdAt", "updatedAt", "ownerId", "createdById", "updatedById", "publicRead"];
191
+
192
+ /**
193
+ * The unique identifier for this space.
194
+ * @member {String} spaceId
195
+ */
196
+ Space.prototype['spaceId'] = undefined;
197
+
198
+ /**
199
+ * The name of the space.
200
+ * @member {String} name
201
+ */
202
+ Space.prototype['name'] = undefined;
203
+
204
+ /**
205
+ * Key-value pairs of metadata associated with the space.
206
+ * @member {Object.<String, String>} labels
207
+ */
208
+ Space.prototype['labels'] = undefined;
209
+
210
+ /**
211
+ * The list of embedders associated with this space.
212
+ * @member {Array.<module:model/SpaceEmbedder>} spaceEmbedders
213
+ */
214
+ Space.prototype['spaceEmbedders'] = undefined;
215
+
216
+ /**
217
+ * Timestamp when this space was created (milliseconds since epoch).
218
+ * @member {Number} createdAt
219
+ */
220
+ Space.prototype['createdAt'] = undefined;
221
+
222
+ /**
223
+ * Timestamp when this space was last updated (milliseconds since epoch).
224
+ * @member {Number} updatedAt
225
+ */
226
+ Space.prototype['updatedAt'] = undefined;
227
+
228
+ /**
229
+ * The ID of the user who owns this space.
230
+ * @member {String} ownerId
231
+ */
232
+ Space.prototype['ownerId'] = undefined;
233
+
234
+ /**
235
+ * The ID of the user who created this space.
236
+ * @member {String} createdById
237
+ */
238
+ Space.prototype['createdById'] = undefined;
239
+
240
+ /**
241
+ * The ID of the user who last updated this space.
242
+ * @member {String} updatedById
243
+ */
244
+ Space.prototype['updatedById'] = undefined;
245
+
246
+ /**
247
+ * Whether this space is publicly readable by all users.
248
+ * @member {Boolean} publicRead
249
+ */
250
+ Space.prototype['publicRead'] = undefined;
251
+ var _default = exports["default"] = Space;
@@ -0,0 +1,178 @@
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 _SpaceEmbedderConfig = _interopRequireDefault(require("./SpaceEmbedderConfig"));
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 SpaceCreationRequest model module.
32
+ * @module model/SpaceCreationRequest
33
+ * @version v1
34
+ */
35
+ var SpaceCreationRequest = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new <code>SpaceCreationRequest</code>.
38
+ * Request body for creating a new Space. A Space is a container for organizing related memories with vector embeddings.
39
+ * @alias module:model/SpaceCreationRequest
40
+ * @param name {String} The desired name for the space. Must be unique within the user's scope.
41
+ */
42
+ function SpaceCreationRequest(name) {
43
+ _classCallCheck(this, SpaceCreationRequest);
44
+ SpaceCreationRequest.initialize(this, name);
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(SpaceCreationRequest, null, [{
53
+ key: "initialize",
54
+ value: function initialize(obj, name) {
55
+ obj['name'] = name;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>SpaceCreationRequest</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/SpaceCreationRequest} obj Optional instance to populate.
63
+ * @return {module:model/SpaceCreationRequest} The populated <code>SpaceCreationRequest</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new SpaceCreationRequest();
70
+ if (data.hasOwnProperty('name')) {
71
+ obj['name'] = _ApiClient["default"].convertToType(data['name'], 'String');
72
+ }
73
+ if (data.hasOwnProperty('labels')) {
74
+ obj['labels'] = _ApiClient["default"].convertToType(data['labels'], {
75
+ 'String': 'String'
76
+ });
77
+ }
78
+ if (data.hasOwnProperty('spaceEmbedders')) {
79
+ obj['spaceEmbedders'] = _ApiClient["default"].convertToType(data['spaceEmbedders'], [_SpaceEmbedderConfig["default"]]);
80
+ }
81
+ if (data.hasOwnProperty('publicRead')) {
82
+ obj['publicRead'] = _ApiClient["default"].convertToType(data['publicRead'], 'Boolean');
83
+ }
84
+ if (data.hasOwnProperty('ownerId')) {
85
+ obj['ownerId'] = _ApiClient["default"].convertToType(data['ownerId'], 'String');
86
+ }
87
+ }
88
+ return obj;
89
+ }
90
+
91
+ /**
92
+ * Validates the JSON data with respect to <code>SpaceCreationRequest</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>SpaceCreationRequest</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(SpaceCreationRequest.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
+ // ensure the json data is a string
110
+ } catch (err) {
111
+ _iterator.e(err);
112
+ } finally {
113
+ _iterator.f();
114
+ }
115
+ if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) {
116
+ throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']);
117
+ }
118
+ if (data['spaceEmbedders']) {
119
+ // data not null
120
+ // ensure the json data is an array
121
+ if (!Array.isArray(data['spaceEmbedders'])) {
122
+ throw new Error("Expected the field `spaceEmbedders` to be an array in the JSON data but got " + data['spaceEmbedders']);
123
+ }
124
+ // validate the optional field `spaceEmbedders` (array)
125
+ var _iterator2 = _createForOfIteratorHelper(data['spaceEmbedders']),
126
+ _step2;
127
+ try {
128
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
129
+ var item = _step2.value;
130
+ _SpaceEmbedderConfig["default"].validateJSON(item);
131
+ }
132
+ } catch (err) {
133
+ _iterator2.e(err);
134
+ } finally {
135
+ _iterator2.f();
136
+ }
137
+ ;
138
+ }
139
+ // ensure the json data is a string
140
+ if (data['ownerId'] && !(typeof data['ownerId'] === 'string' || data['ownerId'] instanceof String)) {
141
+ throw new Error("Expected the field `ownerId` to be a primitive type in the JSON string but got " + data['ownerId']);
142
+ }
143
+ return true;
144
+ }
145
+ }]);
146
+ }();
147
+ SpaceCreationRequest.RequiredProperties = ["name"];
148
+
149
+ /**
150
+ * The desired name for the space. Must be unique within the user's scope.
151
+ * @member {String} name
152
+ */
153
+ SpaceCreationRequest.prototype['name'] = undefined;
154
+
155
+ /**
156
+ * A set of key-value pairs to categorize or tag the space. Used for filtering and organizational purposes.
157
+ * @member {Object.<String, String>} labels
158
+ */
159
+ SpaceCreationRequest.prototype['labels'] = undefined;
160
+
161
+ /**
162
+ * List of embedder configurations to associate with this space. Each specifies an embedder ID and retrieval weight.
163
+ * @member {Array.<module:model/SpaceEmbedderConfig>} spaceEmbedders
164
+ */
165
+ SpaceCreationRequest.prototype['spaceEmbedders'] = undefined;
166
+
167
+ /**
168
+ * Indicates if the space and its memories can be read by unauthenticated users or users other than the owner. Defaults to false.
169
+ * @member {Boolean} publicRead
170
+ */
171
+ SpaceCreationRequest.prototype['publicRead'] = undefined;
172
+
173
+ /**
174
+ * Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_SPACE_ANY permission if specified.
175
+ * @member {String} ownerId
176
+ */
177
+ SpaceCreationRequest.prototype['ownerId'] = undefined;
178
+ var _default = exports["default"] = SpaceCreationRequest;
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18
+ * 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 SpaceEmbedder model module.
31
+ * @module model/SpaceEmbedder
32
+ * @version v1
33
+ */
34
+ var SpaceEmbedder = /*#__PURE__*/function () {
35
+ /**
36
+ * Constructs a new <code>SpaceEmbedder</code>.
37
+ * Associates an embedder with a space, including retrieval configuration.
38
+ * @alias module:model/SpaceEmbedder
39
+ * @param spaceId {String} The unique identifier for the space.
40
+ * @param embedderId {String} The unique identifier for the embedder.
41
+ * @param defaultRetrievalWeight {Number} The default weight for this embedder during retrieval operations.
42
+ * @param createdAt {Number} Timestamp when this association was created (milliseconds since epoch).
43
+ * @param updatedAt {Number} Timestamp when this association was last updated (milliseconds since epoch).
44
+ * @param createdById {String} The ID of the user who created this association.
45
+ * @param updatedById {String} The ID of the user who last updated this association.
46
+ */
47
+ function SpaceEmbedder(spaceId, embedderId, defaultRetrievalWeight, createdAt, updatedAt, createdById, updatedById) {
48
+ _classCallCheck(this, SpaceEmbedder);
49
+ SpaceEmbedder.initialize(this, spaceId, embedderId, defaultRetrievalWeight, createdAt, updatedAt, createdById, updatedById);
50
+ }
51
+
52
+ /**
53
+ * Initializes the fields of this object.
54
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
55
+ * Only for internal use.
56
+ */
57
+ return _createClass(SpaceEmbedder, null, [{
58
+ key: "initialize",
59
+ value: function initialize(obj, spaceId, embedderId, defaultRetrievalWeight, createdAt, updatedAt, createdById, updatedById) {
60
+ obj['spaceId'] = spaceId;
61
+ obj['embedderId'] = embedderId;
62
+ obj['defaultRetrievalWeight'] = defaultRetrievalWeight;
63
+ obj['createdAt'] = createdAt;
64
+ obj['updatedAt'] = updatedAt;
65
+ obj['createdById'] = createdById;
66
+ obj['updatedById'] = updatedById;
67
+ }
68
+
69
+ /**
70
+ * Constructs a <code>SpaceEmbedder</code> from a plain JavaScript object, optionally creating a new instance.
71
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
72
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
73
+ * @param {module:model/SpaceEmbedder} obj Optional instance to populate.
74
+ * @return {module:model/SpaceEmbedder} The populated <code>SpaceEmbedder</code> instance.
75
+ */
76
+ }, {
77
+ key: "constructFromObject",
78
+ value: function constructFromObject(data, obj) {
79
+ if (data) {
80
+ obj = obj || new SpaceEmbedder();
81
+ if (data.hasOwnProperty('spaceId')) {
82
+ obj['spaceId'] = _ApiClient["default"].convertToType(data['spaceId'], 'String');
83
+ }
84
+ if (data.hasOwnProperty('embedderId')) {
85
+ obj['embedderId'] = _ApiClient["default"].convertToType(data['embedderId'], 'String');
86
+ }
87
+ if (data.hasOwnProperty('defaultRetrievalWeight')) {
88
+ obj['defaultRetrievalWeight'] = _ApiClient["default"].convertToType(data['defaultRetrievalWeight'], 'Number');
89
+ }
90
+ if (data.hasOwnProperty('createdAt')) {
91
+ obj['createdAt'] = _ApiClient["default"].convertToType(data['createdAt'], 'Number');
92
+ }
93
+ if (data.hasOwnProperty('updatedAt')) {
94
+ obj['updatedAt'] = _ApiClient["default"].convertToType(data['updatedAt'], 'Number');
95
+ }
96
+ if (data.hasOwnProperty('createdById')) {
97
+ obj['createdById'] = _ApiClient["default"].convertToType(data['createdById'], 'String');
98
+ }
99
+ if (data.hasOwnProperty('updatedById')) {
100
+ obj['updatedById'] = _ApiClient["default"].convertToType(data['updatedById'], 'String');
101
+ }
102
+ }
103
+ return obj;
104
+ }
105
+
106
+ /**
107
+ * Validates the JSON data with respect to <code>SpaceEmbedder</code>.
108
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
109
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>SpaceEmbedder</code>.
110
+ */
111
+ }, {
112
+ key: "validateJSON",
113
+ value: function validateJSON(data) {
114
+ // check to make sure all required properties are present in the JSON string
115
+ var _iterator = _createForOfIteratorHelper(SpaceEmbedder.RequiredProperties),
116
+ _step;
117
+ try {
118
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
119
+ var property = _step.value;
120
+ if (!data.hasOwnProperty(property)) {
121
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
122
+ }
123
+ }
124
+ // ensure the json data is a string
125
+ } catch (err) {
126
+ _iterator.e(err);
127
+ } finally {
128
+ _iterator.f();
129
+ }
130
+ if (data['spaceId'] && !(typeof data['spaceId'] === 'string' || data['spaceId'] instanceof String)) {
131
+ throw new Error("Expected the field `spaceId` to be a primitive type in the JSON string but got " + data['spaceId']);
132
+ }
133
+ // ensure the json data is a string
134
+ if (data['embedderId'] && !(typeof data['embedderId'] === 'string' || data['embedderId'] instanceof String)) {
135
+ throw new Error("Expected the field `embedderId` to be a primitive type in the JSON string but got " + data['embedderId']);
136
+ }
137
+ // ensure the json data is a string
138
+ if (data['createdById'] && !(typeof data['createdById'] === 'string' || data['createdById'] instanceof String)) {
139
+ throw new Error("Expected the field `createdById` to be a primitive type in the JSON string but got " + data['createdById']);
140
+ }
141
+ // ensure the json data is a string
142
+ if (data['updatedById'] && !(typeof data['updatedById'] === 'string' || data['updatedById'] instanceof String)) {
143
+ throw new Error("Expected the field `updatedById` to be a primitive type in the JSON string but got " + data['updatedById']);
144
+ }
145
+ return true;
146
+ }
147
+ }]);
148
+ }();
149
+ SpaceEmbedder.RequiredProperties = ["spaceId", "embedderId", "defaultRetrievalWeight", "createdAt", "updatedAt", "createdById", "updatedById"];
150
+
151
+ /**
152
+ * The unique identifier for the space.
153
+ * @member {String} spaceId
154
+ */
155
+ SpaceEmbedder.prototype['spaceId'] = undefined;
156
+
157
+ /**
158
+ * The unique identifier for the embedder.
159
+ * @member {String} embedderId
160
+ */
161
+ SpaceEmbedder.prototype['embedderId'] = undefined;
162
+
163
+ /**
164
+ * The default weight for this embedder during retrieval operations.
165
+ * @member {Number} defaultRetrievalWeight
166
+ */
167
+ SpaceEmbedder.prototype['defaultRetrievalWeight'] = undefined;
168
+
169
+ /**
170
+ * Timestamp when this association was created (milliseconds since epoch).
171
+ * @member {Number} createdAt
172
+ */
173
+ SpaceEmbedder.prototype['createdAt'] = undefined;
174
+
175
+ /**
176
+ * Timestamp when this association was last updated (milliseconds since epoch).
177
+ * @member {Number} updatedAt
178
+ */
179
+ SpaceEmbedder.prototype['updatedAt'] = undefined;
180
+
181
+ /**
182
+ * The ID of the user who created this association.
183
+ * @member {String} createdById
184
+ */
185
+ SpaceEmbedder.prototype['createdById'] = undefined;
186
+
187
+ /**
188
+ * The ID of the user who last updated this association.
189
+ * @member {String} updatedById
190
+ */
191
+ SpaceEmbedder.prototype['updatedById'] = undefined;
192
+ var _default = exports["default"] = SpaceEmbedder;